I get an error when trying to verify the firmware version. Running this;
var serial = Serial2;
var pins = { rx: D0, tx : D1 };
function test(baud) {
serial.removeAllListeners();
var l="";
serial.on('data', function(d) {l+=d;});
serial.setup(baud, pins);
serial.write("AT+GMR\r\n");
setTimeout(function(){console.log(JSON.stringify(l));},800);
}
//digitalWrite(B9,1); // enable on Pico Shim V2
setTimeout(function() { test(9600); }, 2000);
setTimeout(function() { test(115200); }, 3000);
setTimeout(function() { test(57600); }, 4000);
setTimeout(function() { console.log("Done!"); }, 5000);
Gives me this response;
>Uncaught ReferenceError: "Serial2" is not defined
at line 1 col 14
var serial = Serial2;
^
Uncaught Error: Cannot read property 'removeAllListeners' of undefined
at line 4 col 7
serial.removeAllListeners();
^
in function "test" called from line 12 col 10
test(9600);
^
in function called from system
Uncaught Error: Cannot read property 'removeAllListeners' of undefined
at line 4 col 7
serial.removeAllListeners();
^
in function "test" called from line 13 col 12
test(115200);
^
in function called from system
Uncaught Error: Cannot read property 'removeAllListeners' of undefined
at line 4 col 7
serial.removeAllListeners();
^
in function "test" called from line 14 col 11
test(57600);
^
in function called from system
Done!
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.
I get an error when trying to verify the firmware version. Running this;
Gives me this response;