-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Ibeacon and wifi in esp32 #1756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am using WiFi + BLE scanning for IBeacons in my project and it mostly works. The only problems I am facing are:
Of course, I had to resize the board's partitions, otherwise the sketch was just too big to load. |
I tried to synchronize between wifi and ibeacon. First I connect to the wifi and then disconnect to ensure ibeacon connection but it does not reconnect to wifi unless after reboot... |
You also have to modify
And in boards.txt I have
About the WiFI, I connect and disconnect it multiple times with little issues, does it happen every time to you? |
yes unfortunately... |
Are you using
For some reason Edit: edited because I forgot the |
almost the same |
(I edited my comment above) I'll try to replicate the issue and let you know what I get |
okay..i'm working to find a solution as soon as possible |
I tried using the code you posted here and it reconnects every single time without any issues. Bear in mind that, at least for me, it won't reconnect immediately. You might have to wait a little until it is connected. I have set a 40 seconds timeout and usually all connections happen in less than 15 secondes. By the way how much heap is still free in your board at execution time? Heve you freed the memory used by bluetooth functionalities that you don't use? |
did you put them in loop() function or in setup() ?...also for me ibeacon (ble) takes a lot of space.. |
I'm using the code you posted here in the loop function of my WiFi+BLE program. It takes a lot of space for me too, but luckily you can free some of it by calling
before initializing the BLE. It frees the resources needed for classic Bluetooth, which are useless if you are only gonna use BLE |
i have this error |
When and where? Could you add a little more detail? |
Connecting to WiFi E (128892) phy_init: failed to allocate memory for RF calibration data |
i think wifi and beacon use the same RF |
Could you post the code that provides these messages? You could also use this tool to decode your backtrace |
void ibeacon() |
From your logs it looks like that it is connecting just fine and instead Also you should really try the tool I linked in my comment above to decode which line is failing from this backtrace
|
WiFiClientSecure.h and PubSubClient.h |
What is |
yes but it doesn't work for me |
Is the function not working or does the function work but still get the same error? In the first case try adding
|
sorry for being late to answer you .. yes, I used it but when I want to know the free memory after each instruction, even using all the functions you told me...I get this |
when i use ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT)); my esp32 reboot |
Are you calling it from nvs_flash_init();
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_bt_controller_init(&bt_cfg));
ESP_ERROR_CHECK(esp_bt_controller_enable(ESP_BT_MODE_BLE)); Which is basically what you do when you call |
finally it works but just for a while |
I'm working with esp32 as ibeacon generator to be detected on other devices and with wifi to send data via mqtt to google cloud..but I have not found a way to make them work together ... suggestions?
The text was updated successfully, but these errors were encountered: