-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add optional callbacks to wifi.sta.connect() and wifi.sta.disconnect() #1131
Comments
Alex, that's the second or 3rd time you've referred to EDD. Can you please explain for poor old farts who have been in this business for 40 years but totally missed this acronym? Good old google doesn't help. The second thing is that this is mainly a wrapper around the SDK API call Not sure at this stage what we do about it. |
@TerryE I had to look it up myself and I'm pretty sure EDD means Event Driven Development. |
OK figures. Alex is right. Developing a nodeMCU Lua app is more like developing a jQuery or DB triggered app. Giving a more rigorous temporal dependency model would be better. |
This got me to thinking -- when we get the callbacks from the Espressif SDK (for these events or net events), what environment are we in? Should we be posting to the task queue to get the system into a known state? Are there any restrictions on making calls in these callbacks? |
@pjsg to be honest I don't know at what priority level the net and WiFi cb's are at our even how they are positioned relative to the user high/medium/low. Writing some Lua scripts to retro-engineer this is on my to-do list unless someone gets there first. I do know that the more recent SDK programming guides have warnings on some espconn and wifi API calls about not calling further calls in this task. This wifi_connect issue is complicated because of the interplay with autoconnect, and the lack of wifi cb's. |
need to connect two differnet wifi networks in node mcu. For Example, Im entering in my house with my mobile data ON and as if when i enter into the home i need to connect automatically to my WiFi1(Home WiFi)......... |
Please see #1010 |
I'm aware of
wifi.sta.eventMonReg()
. I'm thinking about writing several different functions in one program. Each will connect wifi at the start and disconnect at the end. They will do different things (obviously) andwifi.sta.eventMonReg()
can only hold one function. So I would have to register/unregistereventMonReg
each time and it wouldn't be quite deterministic due to asynchronicity:...what if wifi manages to connect before event monitor gets registered? I realize it's unlikely, but who knows - mega-fast WiFi router with DHCP already aware of ESP's MAC, some random delay in ESP to register event monitor and voila,
eventMonReg
's callback won't fire. I think this would look better, be more EDD(Event-Driven Development)-like and deterministic:The text was updated successfully, but these errors were encountered: