how to restart bluetooth after light sleep
Posted: Sat Dec 22, 2018 8:41 pm
I have a couple of art installations playing sound and light effects based on an ESP32.
My program has a serial menu interface that can give access to configuration
and a lot of infos about the running patterns.
Out of home at installations or for performances a wireless inteface is much more convenient,
so I looked a into bluetooth, now I have tons of questions...
I gave BluetoothSerial a try, and it works fine.
But I have two major problems:
* BluetoothSerial eats a *lot* of program space, much more then I want to give for it
I can get away with that, as the installations I have currently running do not need all
the program features.
But for the longer perspective I would prefer a solution that needs less ressources.
Pointers very welcome...
The two installations currently running run on an activation trigger, if there's nobody,
they go light sleep. To be able to sleep I run esp_bluedroid_disable() and get no error.
* But how can I activate bluetooth after wakup again?
How do I get my bluetooth connection back?
I do not understand what 'bluedroid' or 'bt_controller' mean.
Could somebody explain that?
I have tried so many things, but do not get a connection again without resetting esp.
Thanks a lot for any help
Robert
My code is at https://github.com/reppr/pulses
My program has a serial menu interface that can give access to configuration
and a lot of infos about the running patterns.
Out of home at installations or for performances a wireless inteface is much more convenient,
so I looked a into bluetooth, now I have tons of questions...
I gave BluetoothSerial a try, and it works fine.
But I have two major problems:
* BluetoothSerial eats a *lot* of program space, much more then I want to give for it
I can get away with that, as the installations I have currently running do not need all
the program features.
But for the longer perspective I would prefer a solution that needs less ressources.
Pointers very welcome...
The two installations currently running run on an activation trigger, if there's nobody,
they go light sleep. To be able to sleep I run esp_bluedroid_disable() and get no error.
* But how can I activate bluetooth after wakup again?
Code: Select all
BLUEtoothSerial.begin(ESP alpha 0.009) ok // no effect, no error
ERROR: esp_bluedroid_enable() ESP_ERR_INVALID_STATE
// or tried (with different modes)
ERROR: esp_bt_controller_enable(ESP_BT_MODE_BTDM) ESP_ERR_INVALID_STATE
I do not understand what 'bluedroid' or 'bt_controller' mean.
Could somebody explain that?
I have tried so many things, but do not get a connection again without resetting esp.
Thanks a lot for any help
Robert
My code is at https://github.com/reppr/pulses