Initialize Bluetooth Serial and BLE server

If both BLE and Bluetooth are required to operate in the code, the initialization sequence seems to be critical. Complete initialization of a BLE server and then separate initialization of Bluetooth Serial didn’t work. The correct sequence seems to be

Here is a code extract that worked for me

Full code example for the initialization can be found in this Github repo.

Read more

WiFi connection problem – NVS corrupted

If you have WiFi connection problems where WiFi.status() always returns WL_NO_SSID_AVAIL even you are sure that the AP is available and working, it might be that the NVS storage has been corrupted. The NVS storage is the place where esp-idf stores the WiFi credentials. See issue wifi connection problem on Arduino-esp32. To check if your NVS storage is corrupted you can use ESP32-Show_nvs_keys provided by stickbreaker. If your NVS storage is corrupted you can use the following code snippet to

Read more

Deep-Sleep needs WiFi and Bluetooth switched OFF for low current consumption

rudi48 made some investigations regarding power saving during deep sleep here. Summary: To achieve maximum power saving during deep sleep it is necessary to switch off Bluetooth and WiFi before calling esp_deep_sleep_start(); Example:

 

Read more

Missing DNS settings when using static IP

Use

instead of

  A valid DNS will be available only if you started the network connection with default parameters (like Wifi.begin(ssid,sspass)), but will not be available in case you started your network connection with WiFi.config(IP,gateway,subnet) (used to get fix IP) without giving it valid DNS -> WiFi.config(IP,GW,SUB,DNS1,DNS2)!!!

Read more
Free Link Directory