Sanity check for Wifi and http modules please getIP getAPIP #6253
Replies: 1 comment
-
Posted at 2020-04-26 by @allObjects @robin, both of these modules are buit-in - part of the firmeware - therefore, to no surprise - the browser er shows 404 when going after these modules... ;\ Something else is going on on your board... don't know what... Do you have a special build that would not include these items? What is the board you are trying to run this code on? Posted at 2020-04-26 by Robin Sun 2020.04.26 Well Good Morning @allObjects haven't seen you here in a while. ;-)
No. Need to stay with stock board in order to support forum responses.
Doesn't the process.env show that? I suppose attempting to load a specific build on a different board should be confirmed, but this is a stock Espruino WiFi.
I don't see how. Haven't mod'd but wondered if there is some kind of build minification that isn't occuring with the now built in modules.
But why? If the syntax is correct as the docs show, and the modules are now built in, then the error shouldn't be there in the first place. Having someone new to Espruino see that will open up a can of worms. Posted at 2020-04-26 by Robin Just did a
and get a unique new error for the second require:
So something in the Wifi module. > EDIT: Just loaded up the native .exe app and get identical results. Dump() of the two lines above:
L17 CIFSR - Uncaught Error: Cannot read property 'cmd' of undefined Posted at 2020-04-26 by Robin and, . . . to rule out a second request of the module, one line of code:
and immediate dump after upload:
Posted at 2020-04-26 by Robin Using the docs: and line note L414
'An object representing the station IP information, if available immediately (ONLY on ESP8266/ESP32)' As I read that, the ONLY reference is for ESP's IF 'available immediately' as a comma separates the detail, delineating the return object. If this is specific to ESP's, then the note is in the wrong place as it should stand out for the entire function, but then why have IP detail NOT be available for Espruino WiFi devices then as the build includes that function. Doesn't make sense. As the module WiFi is for Espruino WiFi devices: Heading 'Connect to an AP' then that return value should be there for those also. > EDIT: Attempt as an AP
Posted at 2020-04-27 by @gfwilliams Best to look at the actual board reference: https://www.espruino.com/WiFi#using-wifi
So:
I feel like this is reasonably clear. Or at least given it not working you could try using the other method of calling it.
Posted at 2020-04-27 by @allObjects ...reason for it is that - like on Espruino Wifi - there has some async communication (over serial() to go on between Epruino wifi object and the espressif ESP8266 ESP-12X to get the data. It is async in order to not hog the Espruino side. On ESP32 and ESP8266 (standalone, Espruino runs on ESP8266EX chip), it is just direct register / memory / synchronous API access. Posted at 2020-04-28 by Robin Tue 2020.04.28
> http://www.espruino.com/Reference#Wifi > Parameters callback - An optional callback(err, ipinfo) function to be called back with the IP information. Is anyone able to confirm that the online WebIDE is capable of copying more than twenty lines at a time to the clipboard, using the Chrome browser on a Windows10 PC. An article I found claims the limit is 4Meg and I'm sure I'm not near that. native WebIDE .exe online IDE I'm currently stuck. With a combination of dump() and trace() I filled the console with way more than several hundred lines I want to now save. Should I chose to disconnect, and attempt this task with the .exe app, then I lose whatever is currently in the device memory, not allowing further analysis. As soon as I attempt to move the mouse above the console window to enable scrolling, the highlighting disappears, thus capturing just what is seen. Should I chose to reboot to see if this is a browser issue, I also lose the data, and may not be any further ahead. Short of copy-n-paste, then stitch each ~20 line block, I'm out of ideas. I need to compare what appears to be a different behavior using the same sequence of operation between the native app and the online IDE. I'm attempting to grab the content from the online right now. If this multiple line scroll feature is not available for the online version, it should be, and knowing whether it is possible will confirm I need to continue with copy-n-paste, as painful as that currently is. Thank you in advance. Posted at 2020-04-29 by Robin Tue 2020.04.28 While mulling around, I remembered I had seen a link for the emulator: I've answered my own curiosity. So, now the question becomes what caused the online IDE to start dismissing the highlit area when the mouse moves to the chrome window boundry trim? Posted at 2020-04-29 by @allObjects @robin, the wifi object has a life cycle... and .getIP() can only be executed when it is (had) a connection. That's the reason why you get The life cycle and the communication between the application stack and the wifi stack together with your application of them explains the error you get. Most of the time requiring a module is only making the code object available to the application with no (or minimal) setup. The typical Posted at 2020-05-02 by Robin Sat 2020.05.02 Continuation of #10 post I'm believe I'm experiencing a Captain Obvious ID-10-T situation and haven't found the secret here. I need to edit/debug an existing online module using the online WebIDE. When using the native .exe WebIDE, it is possible to ?map? to the local file system where deploying the module is then accessible through the require() statement. When using the online WebIDE however, we are now presented with a new unique challenge. In order to debug a file using the Chrome Developer Tools F12 option, the sources tab doesn't reveal the code file to debug, nor the ability to access files on the local drive, although we are able to use console.log() statements to write to the console. Short of creating a stand alone module using the steps in the link above, what/how is the recommended process to debug both uploaded code and that of an existing online .js module? Posted at 2020-05-04 by @gfwilliams
Do you mean debugging part of the Web IDE, or a module running on Espruino? Given the rest of this post I'd assume you mean a module running on Espruino. You can't 'map' a local file at the moment, nor can you use 'Chrome Developer tools' (those are for Chrome). The easiest way to do it is to add:
to the front of the source file you upload. You can then view/modify the code pretty quickly. On the online IDE you can also upload directly to a storage file called |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-04-26 by Robin
Sun 2020.04.26
While trying out the online IDE
and loading working code (it was working Feb 2017) I notice that orange 'Module Wifi not found' errors pop up.
The call detail appears to remain the same:
Snippet is pretty basic
Console output
Which when loading in the browser also confirms a 404
Surprisingly I get the 'Hello World' text back, but when I attempt to view any of the connection details, such as the IP or AP:
I can see the wifi variable is populated,
Is it possible this last 2V05 is the culprit?
I'll try some reflashing in the mean time. But that wont work if the modules aren't there, correct? (yes)
Minification and Esprima are both set to No Minification and offline
Beta Was this translation helpful? Give feedback.
All reactions