-
• #2
Hmm. Is that always repeatable? I've filed a bug here: https://github.com/espruino/Espruino/issues/224
I had the timeout error once or twice but was never able to reliably reproduce it, which makes it hard to track down.
-
• #3
On my board, this happens always after disconnect/reconnect.
May be I should mention, that I've also connected the display on SPI2 and a DS18B20.
Looks like reading process.env is broken after connecting.
If I disconnect it runs without this problem, at least the 6 hours in my test. -
• #4
I've just tested and the issue is the Ctrl+C that gets sent on connect. It breaks out of the CC3000's SPI transmit and then causes all kinds of pain.
You can just remove the
\x03
from espruino_process.js and it'll fix this. I guess I need to implement some way of clearing the current line without Ctrl-C. Any ideas for key combinations that aren't as brutal as Ctrl-C, but that you'd still expect to clear the line? -
• #5
In linux,
CTRL+u
clears left,CTRL+k
clears right.CTRL+l
(small L) clears the screen (akaclear
). Hope this helps. -
• #6
removed the \x03 and it works.
thanks -
• #7
@rardunel, thanks! That's perfect. I'll implement u and k, and then the Web IDE can send both of those in order to make sure the line is clear before it sends its command...
I don't suppose you know if there are Ctrl+ shortcuts for echo on/echo off? That'd be really handy too :)
-
• #9
Later addition (edit does not work): the
command > /dev/null
only suppresses thestdout
, but thestderr
messages will still be printed. -
• #10
In windows command prompt you have
echo off
which is what Espruino does withecho(0)
. The issue is that just writingecho off
echoes characters, so in Windows you prefix a line with@
if you don't want it to echo anything.I'm after something like that for the Espruino command prompt - so piping stuff to /dev/null doesn't really help ;)
-
• #11
I am just trying to make my plant/soil/light sensor setup more reliable. I pretty much use the CC3000 example code from the code reference page, e.g. I connect every 60 sec, wait to be connected, get some data, then send it to Xively (thx @Gordon).
The problem is I seem to be getting this from time to time:
Complete, disconnecting... ERROR: Timeout in CC3000 driver (1) at line 73 col 6 }); ^ in function called from system Execution Interrupted during event processing - clearing all timers and watches. >
The problem is not the error itself, it is that all timers and watches get cleared. That means the espruino stands still. I can live well with that code failing from time to time.
I think we had that discussion before - is there a way to keep the system running somehow?
-
• #12
I'll look at this today... To be honest I should make it clear only the timer that caused the problem when there is an error - as you say it causes huge problems if all timers are removed.
It looks like the error occurs during the call to
connect
- I hadn't come across that one before... I guess it could still attempt to power cycle the CC3000 in that case. -
• #13
Yes, I just realize the console log I posted might cause a misunderstanding. I am logging the disconnecting.... and then it would start connecting again 60 secs later and throws the error. So it might really be an issue in connect().
Thx for looking into this.
-
• #14
I posted up somewhere else, but that should be fixed now.
connect
still throws an error if it fails, but it'll only cancel the one interval - so you can easily work around it. -
• #15
When an interval gets forcibly cleared like that, how can one detect that and react appropriately?
-
• #16
When an interval gets forcibly cleared like that, how can one detect that and react appropriately?
Good point. There's not an easy way right now until exceptions get implemented - however the best bet at the moment is something like:
setInterval(function() { ... wifiSuccess = false; setTimeout(function() { // initialise WLAN wifiSuccess = true; }, 10); setTimeout(function() { if (!wifiSuccess) { ... } }, 1000); , 60000);
If there's an error in wlan.connect, the error flag will be set and execution will stop - so wifiSuccess will never get set to true.
During testing CC3000 and some other requires, sometimes the board stopped working and I had unplug to get it back to work.
After some testing, this workflow breaks Espruino
connect to Espruino Board
Some secondes later I get the timeout error (4101).
Next another error comes up, "got '<' expected EOF at line 1 col 2...."
Version 1v50 and this source