-
• #2
I flashed the Espruino board down from 1v52r3 to 1v51r3. Downgrading the firmware I think fixed the >ERROR: Invalid baud rate specified I do not receive that error after submitting save(). However, I am still not able to get the code to execute upon the boards initial power-up.
-
• #3
Define function onInit(), and put the code that needs to run on startup into that.
-
• #4
DrAzzy, I added the function as you suggested. I then unplugged the board from the USB port and plugged the board back into the USB port, but the code does not seem to execute upon startup. My new code is:
var phValue=""; Serial4.setup(38400); //Serial1.setup(9600/*baud*/); Serial4.onData(function (e) { phValue+=e.data; if (e.data == "\r") { print(phValue); phValue=""; } }); function getPhValue() { on = !on; digitalWrite(LED1, on); Serial4.print("r\r"); } function onInit() { var interval = setInterval(getPhValue, 1500); }
-
• #5
Probably you need to call the onInit() function. Now it is defined but not called.
Just add:
onInit()
at the end of the program.I guess there is no concept of "autoexec.bat" (in this case onInit) so it needs to be explicitely called.
-
• #6
Of course it does not explain why the save command fails, and why your original program does not work.
-
• #7
As simple as JavaScript can be, I guess there still is a little bit of a learning curve :-)
I called onInit() at the bottom of my script and it now works as expected :-)
-
• #9
@BogdanG I've been away over the weekend :)
I'll check into this. The baud rate issue is a strange one (although I guess the code you've written at the start should also have
Serial4.setup(38400);
in it?Also I notice that setInterval is reported wrong in
dump
, although I think I know what the bug is there... -
• #10
Ok, found and fixed some issues. This will be fixed in 1v53, or in the build from http://www.espruino.com/binaries/git in an hour or so
-
• #11
I read through the troubleshoot section of the Espruino Website and found the answer to my locking up issues. I switch back to 1.52 of the firmware. Even though I still get the error mentioned in my original post, the code still executes as expected.
Thanks Gordon for taking the time to fix that bug. I'm looking forward to the next updated firmware.
When I type save() I receive:
I am curious as to what ERROR: Invalid baud rate specified
refers too.
I disconnect then close the Espruino WebIDE window. Next, I open the WebIDE, connect and type dump(). dump returns:
My JS code seems to have saved correctly, but the code will not execute upon a save() or when I unplug and plug the Espruino board into the same USB port to obtain power. I also tried pressing the reset button, but that does not seem to reset the board. The only change I see when pressing the RESET button is, the WebIDE locks up causing me to have to unplug the Espruino board from the USB port, then plug the board into a different USB port in-order for the WebIDE to recognize the Espruino board again.
Pressing the Send to Espruino button works as expected; however, as I stated above, submitting save() does not work as expected. What should I do to get the saved code to work?