-->
Page 1 of 1

Task not depending on WiFi status

PostPosted: Mon Jul 04, 2016 4:15 am
by Baoshi
Hi,
Have been working with SDK for a while and now I am interested in the Arduino stuff.
So, here is a quick question:
How can I organize the code so that some task can run without WiFi?

Long story:
I have some background task to run independent of WiFi, i.e., do some analog read and output some control signal.
There will be a webserver for user to read the data but the webserver shall not affect the background task even if WiFi connection is lost.
So I basically need two things on WiFi:
1. To initialize WiFi in setup(), be AP or STA mode or some configuration webpage, etc.
2. To run the task in loop(), and also handle WiFi tasks. Once WiFi is connected, start the web server.

I think this is quite doable using SDK but how to have it using Arduino? Any suggestions?

Thanks and Regards,

Baoshi

Re: Task not depending on WiFi status

PostPosted: Mon Jul 11, 2016 5:31 pm
by PmoshBR
Hello, I'm having the same problem, did you found a solution?
I'm did a setup() normaly (without infinite loop to connect), and in the main loop I check the conection, if is OK handle with webserver and after my IO's, if not try to connect (with not infinite loop, just one try) and after handle with IO's.
But when the connections drops my ESP still say that the connection is OK, and not retry to reconnect...

Re: Task not depending on WiFi status

PostPosted: Sat Jul 16, 2016 9:55 pm
by mrburnette