gromeck / BLE-Scanner

ESP32-based Bluetooth Low Energy (BLE) scanner to report presence of bluetooth devices into an MQTT service.
GNU General Public License v3.0
90 stars 21 forks source link

Running BLE-Scanner in Platformio #23

Open heinpuett opened 7 months ago

heinpuett commented 7 months ago

hi there, i have a problem compiling the sourcecode in platformio. i think the issue is, that i cannot find the right the right libs. im using a esp-cam module without cam. espressif-32s. is there anybodey out there to solve my problem. i spend many hours yet, but i cannot compile it an get it running. best regards ralf

gromeck commented 7 months ago

Hi Ralf, a few more details would help? What output does your compiler produce? What error messages are shown?

heinpuett commented 6 months ago

hi christian, sorry for beeing absent for so long, i were on a camper without internet...

here is the platformio.ini: ;------------------------------------------------------------------------------------------------------------------- ; PlatformIO Project Configuration File ; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags ; Library options: dependencies, extra library storages ; Advanced options: extra scripting ; ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html

[env:esp32dev] platform = espressif32 board = esp32cam framework = arduino lib_deps = bblanchon/ArduinoJson@^7.0.4 h2zero/NimBLE-Arduino@^1.3.1 knolleary/PubSubClient@^2.8 paulstoffregen/Time@^1.6.1 ;-------------------------------------------------------------------------------------------------------------------

and her is what the compiler says:

;------------------------------------------------------------------------------------------------------------------- Processing esp32dev (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html PLATFORM: Espressif 32 (6.1.0) > AI Thinker ESP32-CAM HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:

;-------------------------------------------------------------------------------------------------------------------

do you have an idea what might be the problem?

best regards ralf

gromeck commented 5 months ago

Sorry for the late reply.

I have no experience with plaffromio, but did you install the esp32 package? EEPROM is part of this package -- at least in the Arduion IDE context.

wprinz commented 4 months ago

Hi @heinpuett - I ran into similar problems, but in the meantime I was able to compile the code on PlatformIO. Here is the workaround:

old:

 esp_task_wdt_config_t config;

  config.timeout_ms = timeout * 1000;
  config.idle_core_mask = 1 << 0;
  config.trigger_panic = true;

  if ((rc = esp_task_wdt_init(&config)) == ESP_ERR_INVALID_STATE) {
    LogMsg("WATCHDOG: already configured -- trying reconfiguration");
    rc = esp_task_wdt_reconfigure(&config);
  }
  if (rc != ESP_OK) {
    LogMsg("WATCHDOG: configuration of watchdog failed -- restarting");
    ESP.restart();
  }

new:

   if ((rc = esp_task_wdt_init(timeout * 1000, true)) == ESP_OK) {
    LogMsg("WATCHDOG: configuration OK");

  } else
{
    LogMsg("WATCHDOG: configuration of watchdog failed -- restarting");
    ESP.restart();
  }

After these modifications the code compiled with the following platformio.ini file:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1   ; replace with our specific board
framework = arduino

lib_ldf_mode = chain+  ; required otherwise the following error occurs: fatal error: TimeLib.h: No such file or directory 

lib_deps = 
    PubSubClient@^2.8
    NimBLE-Arduino@^1.4.0
    Time@^1.6.1

monitor_speed = 115200

I hope this helps!