-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
esp rainmaker and esp32c3 #10119
Comments
Hi @hasan12977, thank you for nice report.
How ever, the switch is working normally, so if toggle the switch in APP I am receiving the messages:
And also if I toggle the switch with the button on the board, the state is updated in the RainMaker app. Is your code not working at all or it's working even though you got those errors. Thanks |
Hello. I did not say that there is something wrong with the functionality of the code, ie the switch itself. The issue is that in the beginning, right after uploading the code to esp32c3, the QR code should be printed but it is not. I get the error I mentioned above, the first error. In order to initialize the esp rainmaker, I would need to hold the reset button for more than 3 seconds. Then I can see QR code and BLE provision would work. Then I would get the same errors as you got while adding the device to rainmaker app. Switching the button on and off would work fine. But if I click on reset button or power off and on the esp32c3, I would get the same errors as I got in the beginning, ie the first error. I forgot to mention but I have three esp32c3 super mini that I am testing the code with and all shows the same errors. I don't think there is any problem with regular esp32, and I kind of want to get rid of esp32c3 because I basically can't get them work the way I want. I mainly wanted to use these for low power applications but seems like it is easier and more reliable to use regular esp32. I am pretty sure these issues have something to do with RISC V architecture and development process. |
Hi @hasan12977, I am currently investigating this issue. The QR code is shown only if the device is on factory reset or WiFi reset. If you have your board already added in the RainMaker, and you just flashed new firmware, it will connect again to the same wifi, no need for QR code. With this workaround I made it to work. Can you please test it on your end?
With this workaround this error will get printed: To see the QR code you would need to do one of the following:
The other errors that gets printed I am discussing with the RainMaker team. |
One more thing, as you are not using OTA -> used partition without OTA. You should comment/remove |
Hi @P-R-O-C-H-Y i faced one of above issue which is ESP32 will not connect to wifi after its restart/power off i follow your workaround "mentioned above" and it works . 18:40:57.508 -> https://rainmaker.espressif.com/qrcode.html?data={"ver":"v1","name":"PROV_1234","pop":"12345678","transport":"ble"}
18:41:30.259 -> [ 40723][I][RMaker.cpp:19] event_handler(): RainMaker Claim Successful.
18:41:45.262 -> E (55721) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
18:41:45.262 -> E (55722) esp-tls: create_ssl_handle failed
18:41:45.262 -> E (55722) esp-tls: Failed to open new connection
18:41:45.262 -> E (55724) transport_base: Failed to open a new connection
18:41:45.262 -> E (55730) mqtt_client: Error transport connect
18:41:45.262 -> E (55733) esp_mqtt_glue: MQTT_EVENT_ERROR
18:41:55.989 -> E (79686) wifi_prov_scheme_ble: bt_mem_release of BTDM failed 259
18:42:04.353 -> [ 74859][I][RMaker.cpp:21] event_handler(): Unhandled RainMaker Event:
18:42:19.647 -> Received value = false for Switch - Power
18:42:22.680 -> Received value = true for Switch - Power i tested it from app the i clicked (Reboot ) from app 18:42:38.435 -> E (122123) wifi:NAN WiFi stop
18:42:38.435 -> E (122126) transport_base: poll_read select error 113, errno = Software caused connection abort, fd = 48
18:42:38.435 -> E (122126) mqtt_client: Poll read error: 119, aborting connection
18:42:38.435 -> ets Jul 29 2019 12:21:46
18:42:38.435 ->
18:42:38.435 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
18:42:38.494 -> configsip: 0, SPIWP:0xee
18:42:38.494 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
18:42:38.494 -> mode:DIO, clock div:1
18:42:38.494 -> load:0x3fff0030,len:4832
18:42:38.494 -> load:0x40078000,len:16460
18:42:38.494 -> load:0x40080400,len:4
18:42:38.494 -> load:0x40080404,len:3504
18:42:38.494 -> entry 0x400805cc
18:42:39.216 -> [ 85][I][RMaker.cpp:17] event_handler(): RainMaker Initialized.
18:42:39.216 -> [ 101][I][WiFiProv.cpp:159] beginProvision(): Already Provisioned
18:42:39.216 -> [ 108][I][WiFiProv.cpp:163] beginProvision(): Attempting connect to AP: xxxxxxx
18:42:39.217 ->
18:42:39.310 -> E (188) wifi_prov_scheme_ble: bt_mem_release of BTDM failed 259
18:42:40.301 -> [ 1193][E][STA.cpp:302] begin(): NETIF_STARTED_BIT not set! try to connect anyway...
18:43:00.776 -> Received value = false for Switch - Power
18:43:02.343 -> Received value = true for Switch - Power` |
yes, the workaround works and gives the errors that you mentioned. it does reconnect after I restart the esp32c3 super minis. but I prefer to have these in my serial monitor: so I can see what is happening in the background. this is from esp idf example. also, as you can see OTA works too. but I dont have that option in arduino. only 4mb and 4mb without ota. when I choose rainmaker 4mb, it gives error saying the program is bigger than 2 mb. |
Our binary is quite bigger as we use BlueDroid as the BLE lib. In IDF the default one is NimBLE, which is taking less space. I am already discussing the errors with the RainMaker team. |
Board
ESP32C3
Device Description
[
![92f1e8e2fcc888726ff7838dad725dd94f43438d_2_690x301](https://private-user-images.githubusercontent.com/158322598/355292841-7d31596e-06bd-411a-88be-8ca5cbfac486.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg0NDUsIm5iZiI6MTczOTA5ODE0NSwicGF0aCI6Ii8xNTgzMjI1OTgvMzU1MjkyODQxLTdkMzE1OTZlLTA2YmQtNDExYS04OGJlLThjYTVjYmZhYzQ4Ni5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMTA0OTA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTEwY2U2Y2M4MjE2Nzc1MjBmOGQyZmQ3NTQwNjYyNTcxZmJjMGFkODE3NWM2NDYxMjhhNDc4YWZjMGNiZjRiOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Bs-GuU8u-TTzkJt56b0afGXK-9mgz-3rKFiLX2aVl3k)
]
Hardware Configuration
no
Version
v3.0.4
IDE Name
arduino
Operating System
macos 14.5 (23F79)
Flash frequency
80
PSRAM enabled
no
Upload speed
921600
Description
the esp rainmker example codes dont work propperly. after uploading the codes with rainmaker 4Mb no ota partition, it uploads the code but gives this error. in order to connect it to wifi, I have to hold the reset button for more than 3 seconds to initialize the esp rainmmaker, otherwise it does not initialize and fails. the failing part is 'failed to start STA!'.
![Screenshot 2024-08-05 at 10 30 52 PM](https://private-user-images.githubusercontent.com/158322598/355293476-6a436306-4ec4-41c3-acfa-219d372c713d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg0NDUsIm5iZiI6MTczOTA5ODE0NSwicGF0aCI6Ii8xNTgzMjI1OTgvMzU1MjkzNDc2LTZhNDM2MzA2LTRlYzQtNDFjMy1hY2ZhLTIxOWQzNzJjNzEzZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxMDQ5MDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lM2I4N2U1Y2RlODY3ZmZhODNlOTczODRhY2JiODk0NGFlMzE1NjE0ZGY4Yzc3YjU1MGFlZDRlM2UyYjZkZmFmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.M6F20iHAaKzZNqKHbK0vFUZFvQo-HPWbrFAW9Ki6Fsk)
after I manually reset the code using reset button, it gives me the qr code and let me connect to it. while connecting the esp to wifi and confirming, I get these error that sound like something did not work right.
![WhatsApp Image 2024-08-05 at 22 46 00](https://private-user-images.githubusercontent.com/158322598/355294780-16baa7f2-4384-435e-86f0-fb1c347f884e.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg0NDUsIm5iZiI6MTczOTA5ODE0NSwicGF0aCI6Ii8xNTgzMjI1OTgvMzU1Mjk0NzgwLTE2YmFhN2YyLTQzODQtNDM1ZS04NmYwLWZiMWMzNDdmODg0ZS5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMTA0OTA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmQyMmZmZDA4N2NkYzJiNjY5OThjZmEyNzQ5MDg0OGIxYzNhYjBhODBmNGY0NzI0YWYwMzNjMzQzMmJhNzJlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.QxEMZUyo0lccpjBQa6w79H1GqtsJHKxUPiBbOPQ3444)
![Screenshot 2024-08-05 at 10 17 38 PM](https://private-user-images.githubusercontent.com/158322598/355294835-331b991b-f600-4feb-881c-387c035335da.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg0NDUsIm5iZiI6MTczOTA5ODE0NSwicGF0aCI6Ii8xNTgzMjI1OTgvMzU1Mjk0ODM1LTMzMWI5OTFiLWY2MDAtNGZlYi04ODFjLTM4N2MwMzUzMzVkYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxMDQ5MDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYjNiYTY3Mzc1ODQzZDU1NGQyMmUwMDljMmQzYTA4ZTNjMDA2NzJlZmU5YzUwYWU1YTQyNzIxMWUzZjhiYzIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pGRou-cDt6khnYPi8IystXFSbeRqxlZf0n0NiwmRzJI)
after the device is added to esp rainmaker app, If I disconnect and reconnect the esp32, I get the same error I got in the beginning. so basically, esp rainmaker is not usable at the moment.
on the other side, when I used esp idf examples of esp rainmaker, I would get the qr code after uploading the code and the process would go seemless. and after discoonecting and reconnecting, the esp32c3 would reconnect to wifi with no problem.
Sketch
Debug Message
Other Steps to Reproduce
please try esp idf rainmaker example and compare it to this one. you will see that many thing is different, even the texts from the core debug info is different than the one in arduino.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: