console.log will be ok if you're just powered from USB, although it tends to lock up if it is actually connected to USB but no terminal app is used (because Espruino doesn't want to throw away the data you're telling it to write, but the Mac/PC is not reading any data from it).
So I think your issue is that you're not initialising the CC3000 on startup. When you type save(), Espruino will resume from where it was when you saved it - but the CC3000 won't remember what it was doing :)
It uses the special function onInit which is called when Espruino starts up.
Looking at it, I think there may still be a problem with that example though. Instead, copy the example apart from the line onInit(); right at the end. Now, type save() and Espruino's state will be saved, and immediately after, it'll restart and onInit() will be called.
Now if you connect to a USB power supply it should be fine.
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.
Hi Sven,
console.log
will be ok if you're just powered from USB, although it tends to lock up if it is actually connected to USB but no terminal app is used (because Espruino doesn't want to throw away the data you're telling it to write, but the Mac/PC is not reading any data from it).So I think your issue is that you're not initialising the CC3000 on startup. When you type
save()
, Espruino will resume from where it was when you saved it - but the CC3000 won't remember what it was doing :)There's a better example of creating a server that can work at power-on here: http://www.espruino.com/WiFi+Enabled+Thermometer
It uses the special function
onInit
which is called when Espruino starts up.Looking at it, I think there may still be a problem with that example though. Instead, copy the example apart from the line
onInit();
right at the end. Now, typesave()
and Espruino's state will be saved, and immediately after, it'll restart andonInit()
will be called.Now if you connect to a USB power supply it should be fine.