Modules uploaded as functions on Esp8266 #5672
Replies: 1 comment
-
Posted at 2017-07-12 by @gfwilliams Can you give me a really simple example of something that doesn't work? Are you using up to date firmware? There shouldn't really be a reason for it not to work... Posted at 2017-07-12 by hungryforcodes For me, its always the same Gordon. It doesn't matter which board I try (ESP-01, WeMos D1 Mini (ESP-12F), today the ESP Witty (ESP-12F), it always produces the the same error: "Uncaught InternalError: Not connected to the internet" So I'm on a Chromebook and using the Web IDE. And just now I plugged in an ESP Witty (basically just a 12F module), and uploaded the following code:
What I got back was:
etc etc. I have no idea if anyone else experiences it. I thought to go through the Espruino source, but I'm a bit wrapped up with projects right now, and don't have time to learn how to debug at that level, yet. Posted at 2017-07-12 by hungryforcodes Interestingly if I press the reset button the board I get the following:
and can play around with the command prompt as normal. But if I do a reset () / load () the error comes back as follows:
Interestingly, if I use E.setBootCode to erase the flash the problem doesn't go away:
So not sure. Posted at 2017-07-13 by LeoWang I just tested it on latest version 1v93. still got "Uncaught InternalError: Not connected to the internet" error. Posted at 2017-07-13 by @gfwilliams I wonder if this is something to do with Telnet or something like that? It may not be related to modules at all. Any ideas @wilberforce? Posted at 2017-07-13 by Wilberforce I think this could be related to the address of functions getting called from an earlier version of the firmware. If flash and blank out the code area, and then upload your code again, it might all go away... Sorry, can't recall the address to flash too. Posted at 2017-07-13 by hungryforcodes @wilberforce This wouldn't apply to virgin modules (stock Espressif firmware), which you then erased and flashed with Espruino, would it? This is what I've been using mostly. Anyways as I mentioned, E.setBootCode("") doesn't fix the problem.... Posted at 2017-07-13 by Wilberforce @hungryforcodes - ok - get your point after a flash erase. This is a bit odd - searching the sources for that error message - no ESP8266 sources come up: https://github.com/espruino/Espruino/search?utf8=%E2%9C%93&q=Not+connected+to+the+internet&type= So if the "Modules uploaded as functions" is left off - everything works as usual? Posted at 2017-07-13 by hungryforcodes @wilberforce Maybe we're getting warmer. So to summarize: 1/ If I do not use "Save On Send" -- IE: disable the feature in question, all is normal. There are absolutely no problems. 2/ If I DO enable "Save On Send", then AFTER all the code has been uploaded (looking at the green bar in the lower right in the Web IDE), and AFTER the message (suggesting the code has been saved to flash successfully):
the ESP8266 gives us an endless stream of "Not connected to the internet". 3/ If I unplug the ESP module and plug it back in, none of my code executes, however I have the normal Espruino prompt. At this point if I do "dump()" I get the message:
so then if I type "load()". I get the following:
So it definitely seems to be something about the initialization and loading of the code. 4/ If I save the code normally (IE: without the feature in question enabled), I can easily always reset() and load() code without any problems (and do so frequently for debugging purposes etc). So this suggests to me there is something about either Save on Send, or something about E.setBootCode() which is implicated in this. Again, not sure. Posted at 2017-07-13 by Wilberforce @hungryforcodes Posted at 2017-07-13 by Wilberforce I'm getting the same thing on the ESP32. It looks like if this option is enabled, then on restart the code gets executed before the network stack is initialised. Posted at 2017-07-14 by @gfwilliams
Yep, that's what you'd expect I guess. It's executed just before Of course if your code didn't do anything with the network, that'd be a bit odd? Posted at 2017-07-14 by hungryforcodes @wilberforce @gfwilliams As I said before I uploaded just:
And this was from a virgin ESP that I flashed with a recent version of Espruino (you can look above). As far as I know that shouldn't do anything. So are there default modules.js that are loaded before my code? Something else? -hfc Posted at 2017-07-18 by @gfwilliams Hmm - there's nothing built in that should be accessing the internet, except Telnet on the ESP8266... Can you try: Posted at 2017-07-19 by LeoWang Hi Gordon, I tried your script. It looks like "TelnetServer" lib is not available.
Posted at 2017-07-19 by @gfwilliams Sorry, not sure what to suggest - it looks from the code like it should be in there. Posted at 2017-07-19 by LeoWang Maybe I try your script in wrong way? I typed
in the left-hande side terminal of Web IDE.
Is any other way to test it in web IDE or other tools? Posted at 2017-07-21 by LeoWang Hi guys, Someone helped and committed a fix for the "Uncaught InternalError: Not connected to the internet" error. Here is the commit in his pull request. Posted at 2017-07-21 by @MaBecker Yep, it works - big thanks to iotong Posted at 2017-07-23 by Wilberforce Cheers - fix also folding into ESP32 branch: Posted at 2017-08-16 by hungryforcodes Yay! ;) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-07-12 by LeoWang
Hi guys,
There seems to be something wrong with "Modules uploaded as functions" feature on ESP8266 board. The problem was spotted for a while referring to comments in following post.
http://forum.espruino.com/conversations/296431/#comment13636908
I just move this issue into ESP8266 section.
Beta Was this translation helpful? Give feedback.
All reactions