-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
BLE provisioning sample doesn't work on release/v2.x branch #8176
Comments
Same issue on ESP32-C3 and 2.0.9. |
@sidwarkd do you have a temporary fix for this? I tried disable the memory release, however when I try to connect to it through rainmaker app, it always fails and no error in console. |
can you please help with triage @PilnyTomas? Thanks |
@MingyaoLiu Yes, the fix which worked for me was to simply comment out the call to |
Using the provided sketch, I was not able to reproduce the mentioned Error. |
Closing this issue as expired, if needed you can reopen. |
@PilnyTomas I am not able to use the master branch as it requires v5.1 of the IDF. When I check out the 2.0.11 tag I know longer get the error but I also do not get any WiFi networks returned in the provisioning app. If I roll back to my fixed branch I see them appear again. Then I tried different tags: 2.0.11 - No error but no WiFi networks returned in the app So at least on the 2.x release it seems like this was kind of fixed and then regressed again. Is there some other commit I should try? |
@SuGlider PTAL. |
@sidwarkd / @me-no-dev - I have made it work using the sketch presented in this issue.
These are the step that I used to make it work: This is the output:
|
I have used Arduino Core 3.0.0-alpha2 ... |
I also get no list of WiFi networks in the APP, but I can set it manually with "Join Other Network" button. |
@SuGlider On older versions the scan actually returns a list of WiFi networks but the later versions do not. I was able to "Join Other Network" but the flow is supposed to return a list of available WiFi networks. That is a bug, right? |
The quesiton would be if this is an APP issue or ESP32 Software issue. Both could supply the list of WiFi SSIDs, given that both shall be close to each other for a BLE connection. |
@sidwarkd - I have just run all over again here with Arduino Core 3.0.0-Alpha2 and it is running perfectly fine, including listing the WiFi SSIDs in my Android APP. Sometime it doesn't list it immediately, but it seems to be running fine with no bugs. |
@sidwarkd - Please try it again from scratch. It shall run fine. |
@azmi-plavaga can you please retest on version 3.1.0-RC1? |
@VojtechBartoska
|
@lucasssvaz can you please retest this on RC2? Thanks a lot |
@VojtechBartoska The sketches from this issue and the examples both with ESP32 and ESP32-C3. Everything worked as expected. |
I am having the exact same problem. It was working fine on Arduino IDE. I migrated the project to PlatformIO. After migration, WiFi BLE Provisioning stopped working. Please see the log below: E (10920) simple_ble: simple_ble_start enable controller failed 259 Thanks Edit:
FYI |
@Jason2866 Have you ever seen this issue ? |
Without an example sketch and the used platformio.ini can't say anything. |
Closing this. Seems to be a migration issue or something else, using old release. If tested against current/updated software and problem persists, open new issue. |
Facing same issue (runtime error) when using The runtime error:
#include <Arduino.h>
#include <WiFiProv.h>
const uint8_t LED_PIN = 2;
const char *pop = "12345678"; // Proof of possession - otherwise called a PIN - string provided by the device, entered by the user in the phone app
const char *service_name = "PROV_MYAPP"; // Name of your device (the Espressif apps expects by default device name starting with "Prov_")
const char *service_key = NULL; // Password used for SofAP method (NULL = no password needed)
bool reset_provisioned = true; // When true the library will automatically delete previously provisioned data.
void setup() {
pinMode(2, OUTPUT);
Serial.begin(115200);
Serial.println("Begin Provisioning using BLE");
// Sample uuid that user can pass during provisioning using BLE
uint8_t uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02 };
WiFiProv.beginProvision(
NETWORK_PROV_SCHEME_BLE, NETWORK_PROV_SCHEME_HANDLER_FREE_BLE, NETWORK_PROV_SECURITY_1, pop, service_name, service_key, uuid, reset_provisioned);
Serial.println("You may use this BLE QRCode:");
WiFiProv.printQR(service_name, pop, "ble");
}
void loop() {
bool isConnected = WiFi.isConnected();
if (isConnected) {
digitalWrite(LED_PIN, HIGH);
} else {
digitalWrite(LED_PIN, LOW);
delay(200);
digitalWrite(LED_PIN, HIGH);
delay(200);
}
}
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip
board = esp32dev
framework = arduino
board_build.partitions = rainmaker_4MB_no_ota.csv
monitor_speed = 115200 @Jason2866 Sorry to disturb, can you please take a look at this? |
Hey @kumardeo , I had the same problem when I was working with ESP32. I added this to my platformio.ini and it worked.
Hope it helps! |
Didn't work for me :( |
Issue can be reproduced with this example https://github.com/pioarduino/test-rainmaker/tree/wifiprov Fix as suggested here is working #8176 (comment) to solve the issue |
Board
ESP32 Dev Module
Device Description
DevKitC plain
Hardware Configuration
No additional hardware connected.
Version
latest master (checkout manually)
IDE Name
VSCode
Operating System
Linux
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
2000000
Description
The use of
esp_bt_controller_mem_release
does not seem correct in esp32-hal-misc.c. In the functioninitArduino()
if you have set BT_ENABLED in sdkconfig, it will callbtInUse
to determine whether to release the BT memory. There are two problems.First, in using the sample sketch below (a slightly modified version of the provisioning sample included with this library) it does not appear to link correctly. The sample will fail to run properly as the BT memory is released in
initArduino
so trying to enable BT later for provisioning fails. The weak linking is not working as expected.Secondly, this pattern seems wrong as well. The code in
initArduino()
would imply that you could have CONFIG_BT_ENABLED but havebtInUse()
return false which, per the code, would never be possible. If CONFIG_BT_ENABLED is yes then esp32-hal-bt.c declaresbtInUse()
to return true always. So there is no scenario where if the config is enabledbtInUse()
should return false (although it does per the first problem mentioned above).This makes the following block of code in esp32-hal-misc.c puzzling:
To get the provisioning example code to work with BLE the call to
esp_bt_controller_mem_release
must NOT be called ininitArduino
.Sketch
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: