You can chat about native SDK questions and issues here.

User avatar
By Agentsmithers
#82400 Hi Everyone! I wrote a simple loop in the software that will connect to any open SSID around it on disconnect to keep this device connect to any available hotspot. The method I use is to kick off a scan manually in one of the System Post tasks. Once it connects it will call WiFi_Handle_event_cb. On disconnect, it will do the same kicking off the scan and looping over until it finds an open ssid.
Heres the thing though, Every time the WiFi is about to kick off a scan I get the status of the WiFi station and it reflects the station is in either connecting mode or some other mode... but the moment the mode reflects Idle on a random loop the system crashes with LoadProhitbitedCaused.
I wrote this code and I don't take any code paths any differently based on the Stations status.. I just know that when it reads Idle it crashes and I'm not sure why. Anyone else ever come across this issue before?
User avatar
By quackmore
#82407 Not sure I get it all

but the when I see errors like that I usually think about pointers issues in my code

assuming that sdk tends to be a bit autonomous when it comes to wifi
make sure you have disabled auto-connect and auto-reconnect
Code: Select all    wifi_station_set_auto_connect(0);
    wifi_station_set_reconnect_policy(false);

cause it could be that when the station status is not idle then it's sdk code doing the job
while when the station code is idle then your code is failing
User avatar
By Agentsmithers
#82413
quackmore wrote:Not sure I get it all

but the when I see errors like that I usually think about pointers issues in my code

assuming that sdk tends to be a bit autonomous when it comes to wifi
make sure you have disabled auto-connect and auto-reconnect
Code: Select all    wifi_station_set_auto_connect(0);
    wifi_station_set_reconnect_policy(false);

cause it could be that when the station status is not idle then it's sdk code doing the job
while when the station code is idle then your code is failing


Interesting, I do have wifi_station_set_reconnect_policy(false); but not the other one.. Doesn't wifi_station_set_auto_connect(0) only take place when you call to save the SSID in memory using the API? I thought it needs like a profile saved or something in order to know what to connect to.. or does it do this when you call connect() for the first time in the background anyhow?
I'll disable it anyways and give it a shot.