EspruinoWifi.js getIP() #5434
Replies: 1 comment
-
Posted at 2016-09-25 by ClearMemory041063 This might help. The syntax is different on different implementations for some reason. Posted at 2016-09-26 by @gfwilliams Yes, that could be it. Or what's the erroir? Basically because the Wifi is separate on the Espruino WiFi it can take time for it to respond - so pretty much every function has to be async. It should behave like a Pico + ESP8266, but I changed the API a little to try and bring everything into line a little more (currently every implementation of the network API is slightly different) Posted at 2016-09-26 by Ollie Thanks Gordon.
But this returns null:
Posted at 2016-09-26 by Ollie Thanks for this i shall look through this also Posted at 2016-09-26 by Ollie Thanks @ClearMemory041063, I can see now, the callback has some additional params. I should have picked that up from the module it is in the comments. This will also apply to Posted at 2016-09-26 by Ollie It does mean that there's some portability issues back to ESP8266 (assuming the code can fit), since the callback seems to just include the a single argument 'data' there.. Posted at 2016-09-26 by @gfwilliams I know. I wonder whether we should change the ESP8266 version - I wonder whether very many people use the callback form anyway. The Pico + ESP8266 code behaves the same way as the Espruino WiFi code, as do pretty much all the other functions (like this]. It seems it'd be more confusing to have just one or two functions that didn't (especially when that seemed to be the general form of callbacks for a lot of Node.js libraries as well). Posted at 2016-09-26 by Ollie On the ESP8226, personally, I don't, I just access the returned object property. But I appreciate this can't be the case with Espriuno + ESP8266. I think a common Wifi API (however the methods must be implemented to make things work), is a good idea though. Save on the confusion and allow script portability where possible. Even when using ESP8266 I've found also running code on the core boards extremely useful to check if an issue is me or a limitation of Espruino on ESP8266. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-09-25 by Ollie
Is
require("EspruinoWifi").getIP()
implemented? I can see the method in the module but it errors for me. Alsowifi.scan()
seems not to return anything. I know the Espruino Wifi is very new, so just wondered what to expect in terms of this module at the moment?Beta Was this translation helpful? Give feedback.
All reactions