Just wanted to report that this is much better now, but still not 100% .. I am running this code ..
E.enableWatchdog(10);
function onPageRequest(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<html><body>');
res.write('<p>Button is '+(BTN.read()?'on':'off')+'</p>');
res.write('<p>Turn LED1 <a href="/on1">on</a> or <a href="/off1">off</a></p>');
res.write('<p>Turn LED3 <a href="/on2">on</a> or <a href="/off2">off</a></p>');
res.end('</body></html>');
if (req.url=="/on1") digitalWrite(LED1, 1);
if (req.url=="/off1") digitalWrite(LED1, 0);
if (req.url=="/on2") digitalWrite(LED3, 1);
if (req.url=="/off2") digitalWrite(LED3, 0);
}
var wlan = require("CC3000").connect();
wlan.connect( "mbed", "Syzygy1313!", function (s) {
if (s=="dhcp") {
console.log("My IP is "+wlan.getIP().ip);
require("http").createServer(onPageRequest).listen(80);
}
});
Which will run for several days without trouble. I no longer see the 16384 or other errors. But I do now see (eventually) ..
I'm afraid my JavaScript is not up to really understanding how the whole script works, but I assume at some point, wlan.connect got executed again, s was dhcp but all was not well ?
There has been one other change, in that I swapped out the actual Espruino board. The previous board had the HC05 bluetooth module soldered on. I experienced some really mysterious goings on which may or may not be related, but ...
From time to time, All of my 2.4GHz wifi (5Ghz Ok) and All of my bluetooth devices (mice, headsets) etc would stop working in my study/workroom. None could connect to relevant APs or hosts. Elsewhere in house, all Ok. I eventually traced this to the Espruino board .. unplugging it from power, would bring everything back to life. First few times, I thought it was just an oddity. But left long enough, that Espruino board would eventually cause the problem. I have absolutely no way of knowing whether it was the CC3000 or HC05 or something else ??
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just wanted to report that this is much better now, but still not 100% .. I am running this code ..
Which will run for several days without trouble. I no longer see the 16384 or other errors. But I do now see (eventually) ..
I'm afraid my JavaScript is not up to really understanding how the whole script works, but I assume at some point, wlan.connect got executed again, s was dhcp but all was not well ?
There has been one other change, in that I swapped out the actual Espruino board. The previous board had the HC05 bluetooth module soldered on. I experienced some really mysterious goings on which may or may not be related, but ...
From time to time, All of my 2.4GHz wifi (5Ghz Ok) and All of my bluetooth devices (mice, headsets) etc would stop working in my study/workroom. None could connect to relevant APs or hosts. Elsewhere in house, all Ok. I eventually traced this to the Espruino board .. unplugging it from power, would bring everything back to life. First few times, I thought it was just an oddity. But left long enough, that Espruino board would eventually cause the problem. I have absolutely no way of knowing whether it was the CC3000 or HC05 or something else ??
Beat that !
Pat