logo elektroda
logo elektroda
X
logo elektroda

Conflicting ESP32 with Bluetooth and SPIFFS support in a weather station

powerT 750 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19356216
    powerT
    Level 9  
    ESP32

    I am creating a weather station, everything works but ... after attaching the library for BT support ("BluetoothSerial.h") a conflict arises and support for writing weather data to SPIFFS memory stops working (similar to SD) - anyone had to deal with such a problem ?

    #include "BluetoothSerial.h"
    BluetoothSerial SerialBT;

    and this crashes the whole project ? two lines and it gets messed up

    Conflicting ESP32 with Bluetooth and SPIFFS support in a weather station .
    Conflicting ESP32 with Bluetooth and SPIFFS support in a weather station .
    Conflicting ESP32 with Bluetooth and SPIFFS support in a weather station .
  • ADVERTISEMENT
  • #2 19356246
    khoam
    Level 42  
    First of all, check what memory occupancy you have on the stack and heap after initiating the SerialBT constructor. You have provided so little information that more cannot be "deduced".
  • ADVERTISEMENT
  • #3 19356271
    powerT
    Level 9  
    It's not a memory problem, even an empty project where Wi-Fi, Serial BT and SPIFFS (or SD) is switched on gets dumped.

    Remove BT - > SPIFFS or SD works
    Remove SD or SPIFFS -> BT works

    I have read forums from all over the world - the problem is the same, either one or the other - no one has found a solution :(
    in the worst case, I will plug in a second ESP32 and make a Data Logger on it

    I suspect this is the fault of Serial BT (classic Bluetooth) anyone know of a library but for Classic BT other than SerialBT
  • ADVERTISEMENT
  • Helpful post
    #4 19356351
    khoam
    Level 42  
    You can always use ESP-IDF v3.3 directly, on which the current Arduino Core for ESP32 is based. Link .
  • #5 19356390
    powerT
    Level 9  
    It looks interesting.
    In the meantime I used BLE instead of Classic BT and it works. Thanks for the hint.
  • #6 19356430
    TvWidget
    Level 38  
    In my case, enabling BLE scanning interfered with writing to SPIFFS memory.
  • ADVERTISEMENT
  • #7 19356640
    powerT
    Level 9  
    something is playing, the problem from what I've read (because I'm still studying the subject) is the pin-out settings in the libraries - they are the same. Personally I prefer classic-BT I'm intensely thinking how to get around this. I still have a second problem and I don't think I'll get past it. ESP32 WiFi which pulls various data from the net (NTP, Weather) and how to make it into a MESH Server - to receive data from temp/humidity sensors (3 ESP-01S modules). I also have to get around this somehow, because either MESH or access to the ROUTER.
  • Helpful post
    #8 19356732
    khoam
    Level 42  
    You could still consider using SimpleBLE with Arduino Core for ESP32.

    powerT wrote:
    I also need to get around this somehow, because it's either MESH or ROUTER access.
    .
    I think it is a matter of keeping the same WiFi channel for both modes. Link .
  • #9 19358362
    powerT
    Level 9  
    The good thing is that ESP32 is cheap, 1 or 2 modules are not a problem, I can always use Rx and Tx and transfer the necessary data, maybe a bit of fun, but I always pursue the topic to the end - there is always someone who has dealt with it and will direct me to a good solution.

    Added after 40 [seconds]:

    TvWidget wrote:
    In my case, enabling the BLE scan interfered with writing to SPIFFS memory.


    Well, I guess this is a standard problem for ESP
  • #10 19358522
    khoam
    Level 42  
    powerT wrote:
    Well this is a standard problem I guess for ESP
    .
    Rather only when programming with Arduino Core. I only use ESP-IDF myself and haven't come across such a problem. The fact is that the Arduino BLE library for ESP32 is a picture of misery and despair :) .
    By the way, maybe instead of SPIFFS you could use the Preferences class to write data directly to the NVS? I have never had any problems with it. It is interesting because the writing/reading is done in an "object based" way.

Topic summary

The discussion revolves around a conflict encountered when integrating Bluetooth support via the "BluetoothSerial.h" library with SPIFFS memory in an ESP32-based weather station project. Users report that enabling Bluetooth causes SPIFFS (or SD) functionality to fail, with no clear solution found despite extensive research. Some users suggest switching to BLE (Bluetooth Low Energy) as a workaround, which has proven successful for one participant. Others mention potential issues with pin-out settings in libraries and propose using the Preferences class for data storage instead of SPIFFS. The conversation highlights the challenges of using the Arduino Core for ESP32 and suggests exploring ESP-IDF for better compatibility.
Summary generated by the language model.
ADVERTISEMENT