Hi!, I’m new to PlatformioIDE and i was converting my Arduino project, using the ArduinoBLE library, for a BLE central device into a Platformio one, the only issue is that the actual BLE connection between my central arduino and my other arduino peripheral, won’t work on PlatformioIDE while on ArduinoIDE it does. I’m using the same code for both cases, here is the code:
#include <Arduino.h>
#include <ArduinoBLE.h>
BLEDevice device;
bool is_device_connected = false;
String uuid = "my-service-uuid";
void setup()
{
Serial.begin(115200);
while (!Serial)
continue;
Serial.println("Serial beginned!");
while (!BLE.begin())
continue;
Serial.println("BLE beginned!");
while (!is_device_connected)
{
while (!BLE.scanForUuid(uuid))
continue;
device = BLE.available();
if (device)
{
Serial.println("Service found, connecting to device");
if (device.connect())
is_device_connected = true;
else
is_device_connected = false;
}
else
{
Serial.println("No advertised service was found with this UUID");
}
delay(1000);
}
}
void loop()
{
BLE.poll();
device.poll();
Serial.print(".");
}
And this is my current platformio.ini:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 115200
board_build.f_cpu = 240000000L
board_build.flash_mode = qio
board_build.f_flash = 80000000L
board_build.flash_size = 4MB
upload_port = COM5
lib_deps =
arduino-libraries/ArduinoBLE@^1.4.0
The boards I’m using:
- CHEAP YELLOW DISPLAY JC2432W328 as an ESP32 DEV MODULE (Central)
- ESP32 DEVKIT V1 as a DOIT ESP32 DEVKIT V1 (Peripheral)
As suggested by Gemini I tried also:
- specifying “platform = espressif32@3.2.1” (same as the one used in arduino) in the platformio.ini, as a result it gave me an error with the ArduinoBLE library saying there was a file “freertos/stream_buffer.h” not found
- adding the following settings (settings shown below) used by arduino in the platformio.ini, it compiles with no errors but nothing changes
upload_speed = 115200
board_build.f_cpu = 240000000L
board_build.flash_mode = qio
board_build.f_flash = 80000000L
board_build.flash_size = 4MB
upload_port = COM5
Here is what the serial monitor shows:
Serial beginned!
BLE beginned!
No advertised service was found with this UUID
Service found, connecting to device
Service found, connecting to device
No advertised service was found with this UUID
Service found, connecting to device
Service found, connecting to device
Service found, connecting to device
No advertised service was found with this UUID
Service found, connecting to device
Service found, connecting to device
Service found, connecting to device
Service found, connecting to device
No advertised service was found with this UUID
Service found, connecting to device
Service found, connecting to device
Service found, connecting to device
No advertised service was found with this UUID
Service found, connecting to device
...etc...
So thanks in advance for any feedback, and also sorry for bad english…