St-device-sdk-c switch_example wifi problem

can you elaborate on run any patches part?

ps. after doing clean build I got past MNID issue (seems the change in onboarding_config.json didn’t trigger something

From within the repo root:

cd bsp/esp8266/
git am ../../patches/esp8266/*.patch

Agree on the elaborate on patches bit please :slight_smile:

Also, I had done a git fetch last night when it brought down a few bits, and i tried again this evening just over one hour ago.

Then i deleted all my projects in workspace and created new.
Generated new serial and key and QR
placed the 2 json files
deleted the build dir just for fun
rebuilt it all and no luck with getting it to join wifi

I then tried changing the 2 files you kindly posted. The partitions was significantly different.
I recompiled, flashed and same results again

Did the patches. fetched from github again. still using your version of the partitions and sdkconfig

Deleted device from project
Made new serial and key
added device to project
pasted device json into folder
rebuilt and flashed

no change :frowning:

I’m going to have to defer to the ST staff for assistance. I have been noticing weird things in the app since the update, might be something regional maybe.

So, i decided to delete the -ref folder and cloned it back from github. New device, keys etc
When I did the initial compile I noticed this error

Blockquote
make[1]: Entering directory ‘/home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig’
cc -c -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC=“<ncurses.h>” -DNCURSES_WIDECHAR=1 -DLOCALE -MMD /home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig/mconf.c -o mconf.o
flex -L -Pzconf -ozconf.lex.c /home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig/zconf.l
bison -t -l -p zconf -o zconf.tab.c /home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig/zconf.y
sed -E “s/\x0D$//” /home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig/zconf.gperf | gperf -t --output-file zconf.hash.c -a -C -E -g -k ‘1,3,$’ -p -t
cc -I /home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig -c -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC=“<ncurses.h>” -DNCURSES_WIDECHAR=1 -DLOCALE -MMD zconf.tab.c -o zconf.tab.o
In file included from zconf.tab.c:2421:
confdata.c: In function ‘conf_write’:
confdata.c:769:23: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
769 | sprintf(tmpname, “%s.tmpconfig.%d”, newname, (int)getpid());
| ^~~~~~~~~~~
confdata.c:769:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097
769 | sprintf(tmpname, “%s.tmpconfig.%d”, newname, (int)getpid());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/brendan/st-device-sdk-c-ref/bsp/esp8266/tools/kconfig/lxdialog/check-lxdialog.sh -check cc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC=“<ncurses.h>” -DNCURSES_WIDECHAR=1 -DLOCALE -MMD -Wl,-Bsymbolic-functions -lncursesw -ltinfo

I have the same warning as well.

I think the patches are applied automatically when you set up a platform with a script since when I tried to run this command it returned me an error that the change is not applicable.

Yes, they should be applied on initial setup. That was in case there were new patches after a git pull. You can just “git am --skip” any that complain or fail. I’m still not sure what I’m doing differently from you and @bmc to get my ESP8266 to on-board successfully.

Dear All,

Regarding “81-001” onboarding failure issue,
We have found and fixed cloud side problem which occurred at some regions of us and eu.
Could you please try again?

Thanks for your issue reports and our apologies for the inconvenience.

Kwang-Hui Cho

1 Like

Ok - Generated new key, made QR, copied device json, re flashed, created new device in workspace.

Now the phone finds the device and I can join my wifi :slight_smile:
On the Android now gets to 99% although nothing seems to change on device from when app say about 50/60% then gives a 15-100 error
Below are last few messages from monitoring device.

I (48824) [IoT]: _iot_net_tls_connect(160) > Loading the CA root certificate 2655@0x401098f0
I (50854) [IoT]: iot_es_connect(1010) > MQTT connect success
I (51124) [IoT]: _do_cmd_tout_check(913) > New state updated for 6

The iphone appears to do similar. My local wifi password now appear to be saved to device as i dont have to rekey password between join attempts even switching between phones.

Hi @bmc
I think this is very exceptional case.
Could you send your full serial terminal log to build@smartthings.com?

Thanks.

emailed as requested

I can confirm that the fix on the cloud side works for me (started working after 2nd attempt).
I can see the status of the device and control it from the cloud.

@kwanghui: thank you for your help.

@bmc: what board you’re using for development?

2 Likes

Wemos D1 likein your pic - i just havent wired anything to it

Thanks @bmc
We are under analysis from your device log.

2 Likes

Success!!!

Only change I have made was to update the Produc Info for my device in the Developer Workplace to include all 214 countries. I had been doing this previously but on the last couple of attempts had only left the US ticked as thats what it showed instructions. So looks like it is important to registration.

Thanks to everyone for their help in sorting the raft of problems with the SDK, servers and phone Apps.

2 Likes

@bmc: great.
I’m not sure what it was with the countries though. I have never changed anything there (only have US).
If I were to guess there is some additional bug on the server side and you changing the countries triggered your device to be properly registered.

Now a fun fact: after playing with switch_example i wanted to “upgrade” to light_example.
After flashing I noticed that the device kept the wifi information and didn’t go to pairing mode

ps. running erase_flash helped and I have successfully onboarded light_example as well

./bsp/esp8266/components/esptool_py/esptool/esptool.py --port /dev/ttyS4 erase_flash
1 Like

Great. @bmc
Actually our finding wasn’t related with Product Info itself.
I think you can make it work without selecting all the countries.
There was hot fix on our side to make it works for you.

Thanks

1 Like

I (79190) [IoT]: _do_iot_main_command(412) > curr_main_cmd:8, curr_main_state:4/6
W (79200) [IoT]: _do_iot_main_command(838) > self device cleanup
I (79200) [IoT]: iot_device_cleanup(925) > start to erase device information
W (79220) [IoT]: iot_security_storage_remove(211) > id:10 not found
E (79220) [IoT]: iot_device_cleanup(937) > iot_device_cleanup: failed to erase device ID: -15
I (79230) [IoT]: iot_device_cleanup(950) > There is active registering, disconnect it first.

code error: 15-100

esptool.py --port /dev/ttyS4 erase_flash ----- don’t work

help, please