The app connects perfectly with ESP32 and receive data. But, if i turned off the ESP32, the app crashes and stops.
I spend 2 days fighting with this issue. It cannot be so difficult!
I thought that the failure was because i begin a scanning when the disconnect event was raised, and i also had activated the BluetoothLE1 “AutoReconnect” option, but it is not that.
In the proyect attached i do nothing when the connection is lost… and it crash!
I have disabled most part off blocks, just in case, but it continue to crash.
I also did a small proyect, with only the BLE, and it work perfectly. Not a single crash!.
Can be a proyect be corrupted?
Or maybe the BLE cannot work if the screen has timers, firebasedb, TinyDB, or any other component?
BLE3: is the proyect that works fine
paramotor_BLE_v11: is the one that fails
The default from TinyDB for a list should be an empty list (I corrected it here in this procedure.) to prevent errors trying to treat a text as a list.
All the BLE when …s received blocks receive multi item LISTS, which need to be addressed item by item, not just peeling off ( ) on the outside. For floats, this is important because you might be trying to feed two or more blank separated floats into a format as decimal block, which does not recognize internal blanks. For Each fixes that.
Hi ABG.
Thanks foutr your help.
I have already corrected your suggestions about TinyDB and about how you did thee BLE loop.
Now i will try to modify the ESP32 software in order to use the “registerfloats” instead “readfloats”.
Regards,
Patricio
Solved.
Using “registertfloats” instead “readfloats” the app do not crash when the connection with device is lost.
I had to modify a bit the ESP32 software, but now it works perfectly.
Thanks!!!