These are chat archives for SmingHub/Sming

29th
Dec 2018
Curtis Pope
@piperpilot
Dec 29 2018 00:02

Hey guys, running into my first big problem. In my app, the first time a device runs, it sets the WiFi config parameters. There seems to be an issue with the WifiStation.config. Here is the code I am using...you can see that it crashes after trying to set the station config.

Code:

if (WifiStation.getSSID().length() == 0)
        {
            WifiStation.enable(true);
            Serial.println("Finished Enable");

            WifiStation.config(WIFI_SSID, WIFI_PWD);
            Serial.println("Finished Config");

            WifiAccessPoint.enable(false, true);
            Serial.printf("Finished AP Enable");
        }

Results:

SBVN6;
SBID16704210;
SBIPConnecting ;
Configuring AP: SMOBOT WiFi
Finished Enable
úP..FX
XûBþ
...X’.Ò.{FH.ZÊ.Ò.~†v.Z.
ÒÒ....”.HHvJ.Hþÿ.þ;ˍšsÇÃ.¸øO.õÆsáå.N.ªzËHòSBWF;
SBVN6;
SBID16704210;
SBIPConnecting ;
Configuring AP: SMOBOT WiFi
Finished Enable
Anyone have any thoughts?
Oh and I have tried it both ways, with the enable before and after the config with the same results.
Curtis Pope
@piperpilot
Dec 29 2018 01:00
Did a little debugging and it seems to be failing on this line...
Station.cpp:82
success = wifi_station_set_config(&config);
Curtis Pope
@piperpilot
Dec 29 2018 03:50
more detail....if I rboot OTA update to the new version, then the WifiStation.config command works fine, but it has already been run once on an older version. Seems like the config command doesn't like being run on an empty config set any more. Any ideas?
frankdownunder
@frankdownunder
Dec 29 2018 05:14
@mikee47 Hi Mike I tried your istructions to swap to SDk 3, but got linker errors
AR out/build/app_app.a
LD out/build/app_0.out
/mnt/c/opt/Sming/Sming/compiler/lib//liblwip_full.a(dhcpserver.o): In function `node_remove_from_list':
dhcpserver.c:(.irom0.text+0x295): undefined reference to `pvPortZallocIram'
/mnt/c/opt/Sming/Sming/compiler/lib//liblwip_full.a(dhcpserver.o): In function `handle_dhcp':
dhcpserver.c:(.irom0.text+0x43f): undefined reference to `pvPortZallocIram'
dhcpserver.c:(.irom0.text+0x46b): undefined reference to `pvPortZallocIram'
/mnt/c/opt/Sming/Sming/compiler/lib//libsming.a(user_main.o): In function `user_rf_cal_sector_set':
user_main.cpp:(.irom0.text+0x48): undefined reference to `system_partition_table_regist'
/mnt/c/opt/Sming/Sming/compiler/lib//libsming.a(user_main.o): In function `user_pre_init':
/mnt/c/opt/Sming/Sming/appinit/user_main.cpp:118: undefined reference to `system_partition_table_regist'
/mnt/c/opt/Sming/Sming/compiler/lib//liblwip_full.a(dns.o): In function `dns_parse_name':
dns.c:(.irom0.text+0x3c): undefined reference to `pvPortZallocIram'
/mnt/c/opt/Sming/Sming/compiler/lib//liblwip_full.a(dns.o): In function `dns_recv':
dns.c:(.irom0.text+0x5a): undefined reference to `pvPortZallocIram'
collect2: error: ld returned 1 exit status
/mnt/c/opt/Sming/Sming/Makefile-rboot.mk:546: recipe for target 'out/build/app_0.out' failed
make: *** [out/build/app_0.out] Error 1
Mike
@mikee47
Dec 29 2018 06:40
@frankdownunder I think (could be wrong) your app. is building with ENABLE_ESPCONN defined, if so Sming also needs to be built with 'make ENABLE_ESPCONN=1'
You can check by inspecting timestamp on liblwip_full.a