logo elektroda
logo elektroda
X
logo elektroda

Conflicting ESP32 with Bluetooth and SPIFFS support in a weather station

powerT 1611 9
Best answers LABEL_AI_GENERATED

Why does adding BluetoothSerial on an ESP32 break SPIFFS/SD writes, and what can I use instead?

The practical workaround is to avoid the Arduino Core classic BluetoothSerial path and switch to BLE or use ESP-IDF directly. Switching from Classic BT to BLE reportedly made the setup work [#19356390], and another reply recommends using ESP-IDF v3.3 directly because the current Arduino Core for ESP32 is based on it [#19356351] If you only need to store data, consider writing to NVS with the Preferences class instead of SPIFFS, since it was reported to work without problems [#19358522] SimpleBLE was also suggested as an Arduino-core-friendly alternative for ESP32 BLE [#19356732]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • BluetoothSerial.h appears to break SPIFFS support

    #1 19356216
    powerT
    Level 9  
    Posts: 43
    Help: 1
    Rate: 3
    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
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • Classic Bluetooth conflicts with SPIFFS and SD on ESP32

    #3 19356271
    powerT
    Level 9  
    Posts: 43
    Help: 1
    Rate: 3
    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
    Anonymous
    Level 1  
  • #5 19356390
    powerT
    Level 9  
    Posts: 43
    Help: 1
    Rate: 3
    It looks interesting.
    In the meantime I used BLE instead of Classic BT and it works. Thanks for the hint.
  • #6 19356430
    TvWidget
    Level 39  
    Posts: 4425
    Help: 472
    Rate: 699
    In my case, enabling BLE scanning interfered with writing to SPIFFS memory.
  • ADVERTISEMENT
  • Pin conflicts between Bluetooth and SPIFFS libraries

    #7 19356640
    powerT
    Level 9  
    Posts: 43
    Help: 1
    Rate: 3
    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
    Anonymous
    Level 1  
  • BLE scan interferes with SPIFFS writes

    #9 19358362
    powerT
    Level 9  
    Posts: 43
    Help: 1
    Rate: 3
    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
  • Use Preferences NVS instead of SPIFFS

    #10 19358522
    Anonymous
    Level 1  

Topic summary

LABEL_AI_GENERATED
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.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT