EspruinoWifi: builtin wifi module calling callback twice? #1162
Replies: 3 comments
-
Posted at 2018-03-13 by @gfwilliams That's odd. I'll check it out when i get back at the end of the week. However you might have some success trying to create the server from inside the callback of getIP. Since everything is async you're trying to do both at the same time. I thought it was fixed, but I've had very similar problems to that in the past - not that it explains the two LEDs lighting. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-03-13 by @gfwilliams ... also i believe you're not using getIP correctly - the first argument is the callback is the error or null, second is the ip - as functions tend to be done in node.js ... so even if it did work, you would never see the IP in addr. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-03-16 by @gfwilliams Ok, I just tried this and it would appear to be fine - apart from the IP thing. Here's the code I used:
I haven't seen a double callback at any point. If you're getting two callbacks it might be that You could also try typing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-03-13 by Steffen
The Wifi module builtin since 1.96 (many thanks, Gordon) connects as expected.
However, it seems to do an extra callback when it connects.
The code below is supposed to pulse the green LED on success and the red one on wifi timeout.
On connect both LEDs go on, at the same time.
While the connection definitely succeeds (ping replies are sent), the value of the variable addr is 'Timeout'. And the telnet server doesn't get startet.
What's going on here?
Beta Was this translation helpful? Give feedback.
All reactions