Sorted it out. But I am not happy with the solution.
The problem was Serial1. The sim900 board was sending some bytes while the interpreter was executing some code. Unfortunately the bytes haven't been sent just to USB. It has been sent to the interpreter as well, which was confusing the code execution.
This code piece in onInit() did it:
setInterval(function() {
if (process.env.CONSOLE=="Serial1") setConsole(LoopbackA);
}, 1000);
As well after some time this code piece produces the following warning:
WARNING: Unable to create string as not enough memory
Unfortunately I soldered the wires for connecting the sim900 to the Serial1 pins. Is there a way to set Serial2 to be the default fallback serial port when USB is not connected (maybe in some build parameters for the firmware)? I would be happy with disabling this feature totally as well.
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.
Sorted it out. But I am not happy with the solution.
The problem was Serial1. The sim900 board was sending some bytes while the interpreter was executing some code. Unfortunately the bytes haven't been sent just to USB. It has been sent to the interpreter as well, which was confusing the code execution.
This code piece in onInit() did it:
As well after some time this code piece produces the following warning:
Unfortunately I soldered the wires for connecting the sim900 to the Serial1 pins. Is there a way to set Serial2 to be the default fallback serial port when USB is not connected (maybe in some build parameters for the firmware)? I would be happy with disabling this feature totally as well.
Best,
Tobias