Here i am back with what @Gordon did suggest. First I did deletie the installed Web IDE from Google Chrome (). Then after downloading the Web IDE from GitHub using the ZIP file, I did unpack and install it. Now i have Version 0.32.0 installed.
After launching the new Web IDE I did send my code as listed above to the Espruino board and my console contains the following. Seems to be correct to me in the console, but unfortunately the Espruino console still shows the same errors as in my previous posts :-/
>>> Connecting espruino_status.js:40
Set Slow Write = true espruino_serial.js:170
Object
bitrate: 9600
bufferSize: 4096
connectionId: 2
ctsFlowControl: false
dataBits: "eight"
name: ""
parityBit: "no"
paused: false
persistent: false
receiveTimeout: 0
sendTimeout: 0
stopBits: "one"
__proto__: Object
espruino_serial.js:62
Device found (connectionId=2) terminal.js:41
>>> Sending... espruino_status.js:40
Sending "\u0003echo(0);\nconsole.log(\"<<\"+\"<<<\"+JSON.stringify(process.env)+\">>>\"+\">>\");\n" espruino_serial.js:115
>>> Sent espruino_status.js:40
Got "echo(0);\r\n<<<<<{\"VERSION\":\"1v48\",\"BUILD_DATE\":\"Jan 30 2014\",\"BUILD_TIME\":\"13:32:24\",\"BOARD\":\"ESPRUINOBOARD\",\"CHIP\":\"STM32F103RCT6\",\"CHIP_FAMILY\":\"STM32F1\",\"FLASH\":262144,\"RAM\":49152}>>>>>\r\n" espruino_process.js:47
>>> Connected espruino_status.js:40
FIRMWARE: Current 1v48, Available 1v48 espruino_flasher.js:363
Firmware >1.43 supports faster writes espruino_flasher.js:367
Set Slow Write = false espruino_serial.js:170
watt nu 42 USART 0
Array[2]
espruino_board.js:328
watt nu 43 USART 0
Array[2]
espruino_board.js:328
watt nu 44 USART 0
Array[2]
espruino_board.js:328
watt nu 50 USART 0
Array[2]
espruino_board.js:328
Config.set(code, SPI1.setup({sck:A5, miso:A6, mosi:A7});
var nrf = require("NRF24L01P").connect(SPI1, B0, B1);
function onInit() {
print(nrf);
if (typeof nrf != "undefined") {
nrf.init([0,0,0,0,1], [0,0,0,0,2]);
print("NRF Library loaded!");
} else {
print("Error! NRF Library not loaded!");
}
}
onInit();
setInterval(function() {
nrf.slaveHandler();
}, 50);) espruino_config.js:61
loadModule(NRF24L01P) espruino_modules.js:75
- NRF24L01P requires [] espruino_modules.js:94
Sending... Modules.removeAllCached();Modules.addCached("NRF24L01P","function NRF(a,b,c,d){this.CSN=b;this.CE=c;this.PAYLOAD=d?d:16;this.BASE_CONFIG=8;this.cmd=\"\";this.spi=a;this.callbacks=[]}NRF.prototype.C={CONFIG:0,STATUS:7,CD:9,RX_ADDR_P0:10,RX_ADDR_P1:11,TX_ADDR:16,RX_PW_P0:17,RX_PW_P1:18,R_REGISTER:0,W_REGISTER:32,R_RX_PAYLOAD:97,W_TX_PAYLOAD:160,FLUSH_TX:225,FLUSH_RX:226};\nNRF.prototype.init=function(a,b){digitalWrite(this.CE,0);digitalWrite(this.CSN,1);this.setRXAddr(a);this.setTXAddr(b);this.setReg(this.C.RX_PW_P0,this.PAYLOAD);this.setReg(this.C.RX_PW_P1,this.PAYLOAD);this.setReg(this.C.CONFIG,this.BASE_CONFIG|3);digitalWrite(this.CE,1)};NRF.prototype.setReg=function(a,b){this.spi.send([this.C.W_REGISTER|a,b],this.CSN)};NRF.prototype.setAddr=function(a,b){b=b.clone();b.splice(0,0,this.C.W_REGISTER|a);this.spi.send(b,this.CSN)};\nNRF.prototype.setRXAddr=function(a){this.setAddr(this.C.RX_ADDR_P1,a)};NRF.prototype.setTXAddr=function(a){this.setAddr(this.C.RX_ADDR_P0,a);this.setAddr(this.C.TX_ADDR,a)};NRF.prototype.getReg=function(a){return this.spi.send([this.C.R_REGISTER|a,0],this.CSN)[1]};NRF.prototype.getAddr=function(a){a=this.spi.send([this.C.R_REGISTER|a,0,0,0,0,0],this.CSN);a.splice(0,1);return a};NRF.prototype.getStatus=function(a){return this.getReg(this.C.STATUS)};\nNRF.prototype.dataReady=function(){return 14!=(this.getReg(this.C.STATUS)&14)};NRF.prototype.getData=function(){for(var a=[this.C.R_RX_PAYLOAD],b=0;b<this.PAYLOAD;b++)a.push(0);a=this.spi.send(a,this.CSN);a.splice(0,1);this.setReg(this.C.STATUS,64);return a};\nNRF.prototype.send=function(a){this.setReg(this.C.STATUS,48);digitalWrite(this.CE,0);this.setReg(this.C.CONFIG,this.BASE_CONFIG|2);this.spi.send(this.C.FLUSH_TX,this.CSN);a=a.clone();a.splice(0,0,this.C.W_TX_PAYLOAD);this.spi.send(a,this.CSN);digitalWrite(this.CE,1);for(a=1E3;a--&&!(this.getReg(this.C.STATUS)&48););0>=a&&print(\"TX timeout\");a=!0;this.getReg(this.C.STATUS)&16&&(print(\"TX not received \"+this.getReg(this.C.STATUS)),a=!1);digitalWrite(this.CE,0);this.setReg(this.C.CONFIG,this.BASE_CONFIG|\n3);digitalWrite(this.CE,1);this.setReg(this.C.STATUS,48);return a};NRF.prototype.slaveHandler=function(){for(;this.dataReady();){var a=this.getData(),b;for(b in a){var c=a[b];0===c&&\"\"!==this.cmd?(c=this.cmd,this.cmd=\"\",print(\"...>\"+c),c=\"\"+eval(c),print(\"...=\"+c),this.sendStringTimeout(c,500)):0!==c&&(this.cmd+=String.fromCharCode(c))}}};\nNRF.prototype.masterHandler=function(){for(;this.dataReady();){var a=this.getData(),b;for(b in a){var c=a[b];if(0===c&&\"\"!==this.cmd){c=this.cmd;this.cmd=\"\";var d=this.callbacks.splice(0,1)[0];void 0!==d&&d(c)}else 0!==c&&(this.cmd+=String.fromCharCode(c))}}};NRF.prototype.sendString=function(a){for(var b=0;b<=a.length;b+=this.PAYLOAD){for(var c=[],d=0;d<this.PAYLOAD;d++)c[d]=Integer.valueOf(a[b+d]);for(d=3;0<d--&&!this.send(c););}};NRF.prototype.sendCommand=function(a,b){this.callbacks.push(b);this.sendString(a)};\nNRF.prototype.sendStringTimeout=function(a,b){var c=this;setTimeout(function(){c.sendString(a)},b)};exports.connect=function(a,b,c,d){return new NRF(a,b,c,d)};\n");
SPI1.setup({sck:A5, miso:A6, mosi:A7});
var nrf = require("NRF24L01P").connect(SPI1, B0, B1);
function onInit() {
print(nrf);
if (typeof nrf != "undefined") {
nrf.init([0,0,0,0,1], [0,0,0,0,2]);
print("NRF Library loaded!");
} else {
print("Error! NRF Library not loaded!");
}
}
onInit();
setInterval(function() {
nrf.slaveHandler();
}, 50); espruino_codewriter.js:42
>>> Sending... espruino_status.js:40
Sending "echo(0);\nModules.removeAllCached();Modules.addCached(\"NRF24L01P\",\"function NRF(a,b,c,d){this.CSN=b;this.CE=c;this.PAYLOAD=d?d:16;this.BASE_CONFIG=8;this.cmd=\\\"\\\";this.spi=a;this.callbacks=[]}NRF.prototype.C={CONFIG:0,STATUS:7,CD:9,RX_ADDR_P0:10,RX_ADDR_P1:11,TX_ADDR:16,RX_PW_P0:17,RX_PW_P1:18,R_REGISTER:0,W_REGISTER:32,R_RX_PAYLOAD:97,W_TX_PAYLOAD:160,FLUSH_TX:225,FLUSH_RX:226};\\nNRF.prototype.init=function(a,b){digitalWrite(this.CE,0);digitalWrite(this.CSN,1);this.setRXAddr(a);this.setTXAddr(b);this.setReg(this.C.RX_PW_P0,this.PAYLOAD);this.setReg(this.C.RX_PW_P1,this.PAYLOAD);this.setReg(this.C.CONFIG,this.BASE_CONFIG|3);digitalWrite(this.CE,1)};NRF.prototype.setReg=function(a,b){this.spi.send([this.C.W_REGISTER|a,b],this.CSN)};NRF.prototype.setAddr=function(a,b){b=b.clone();b.splice(0,0,this.C.W_REGISTER|a);this.spi.send(b,this.CSN)};\\nNRF.prototype.setRXAddr=function(a){this.setAddr(this.C.RX_ADDR_P1,a)};NRF.prototype.setTXAddr=function(a){this.setAddr(this.C.RX_ADDR_P0,a);this.setAddr(this.C.TX_ADDR,a)};NRF.prototype.getReg=function(a){return this.spi.send([this.C.R_REGISTER|a,0],this.CSN)[1]};NRF.prototype.getAddr=function(a){a=this.spi.send([this.C.R_REGISTER|a,0,0,0,0,0],this.CSN);a.splice(0,1);return a};NRF.prototype.getStatus=function(a){return this.getReg(this.C.STATUS)};\\nNRF.prototype.dataReady=function(){return 14!=(this.getReg(this.C.STATUS)&14)};NRF.prototype.getData=function(){for(var a=[this.C.R_RX_PAYLOAD],b=0;b<this.PAYLOAD;b++)a.push(0);a=this.spi.send(a,this.CSN);a.splice(0,1);this.setReg(this.C.STATUS,64);return a};\\nNRF.prototype.send=function(a){this.setReg(this.C.STATUS,48);digitalWrite(this.CE,0);this.setReg(this.C.CONFIG,this.BASE_CONFIG|2);this.spi.send(this.C.FLUSH_TX,this.CSN);a=a.clone();a.splice(0,0,this.C.W_TX_PAYLOAD);this.spi.send(a,this.CSN);digitalWrite(this.CE,1);for(a=1E3;a--&&!(this.getReg(this.C.STATUS)&48););0>=a&&print(\\\"TX timeout\\\");a=!0;this.getReg(this.C.STATUS)&16&&(print(\\\"TX not received \\\"+this.getReg(this.C.STATUS)),a=!1);digitalWrite(this.CE,0);this.setReg(this.C.CONFIG,this.BASE_CONFIG|\\n3);digitalWrite(this.CE,1);this.setReg(this.C.STATUS,48);return a};NRF.prototype.slaveHandler=function(){for(;this.dataReady();){var a=this.getData(),b;for(b in a){var c=a[b];0===c&&\\\"\\\"!==this.cmd?(c=this.cmd,this.cmd=\\\"\\\",print(\\\"...>\\\"+c),c=\\\"\\\"+eval(c),print(\\\"...=\\\"+c),this.sendStringTimeout(c,500)):0!==c&&(this.cmd+=String.fromCharCode(c))}}};\\nNRF.prototype.masterHandler=function(){for(;this.dataReady();){var a=this.getData(),b;for(b in a){var c=a[b];if(0===c&&\\\"\\\"!==this.cmd){c=this.cmd;this.cmd=\\\"\\\";var d=this.callbacks.splice(0,1)[0];void 0!==d&&d(c)}else 0!==c&&(this.cmd+=String.fromCharCode(c))}}};NRF.prototype.sendString=function(a){for(var b=0;b<=a.length;b+=this.PAYLOAD){for(var c=[],d=0;d<this.PAYLOAD;d++)c[d]=Integer.valueOf(a[b+d]);for(d=3;0<d--&&!this.send(c););}};NRF.prototype.sendCommand=function(a,b){this.callbacks.push(b);this.sendString(a)};\\nNRF.prototype.sendStringTimeout=function(a,b){var c=this;setTimeout(function(){c.sendString(a)},b)};exports.connect=function(a,b,c,d){return new NRF(a,b,c,d)};\\n\");\n\nSPI1.setup({sck:A5, miso:A6, mosi:A7});\nvar nrf = require(\"NRF24L01P\").connect(SPI1, B0, B1);\nfunction onInit() {\n print(nrf);\n if (typeof nrf != \"undefined\") {\n nrf.init([0,0,0,0,1], [0,0,0,0,2]);\n print(\"NRF Library loaded!\");\n } else {\n print(\"Error! NRF Library not loaded!\");\n }\n}\nonInit();\nsetInterval(function() {\n nrf.slaveHandler();\n}, 50);\necho(1);\n" espruino_serial.js:115
>>> Sent espruino_status.js:40
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.
Here i am back with what @Gordon did suggest. First I did deletie the installed Web IDE from Google Chrome (). Then after downloading the Web IDE from GitHub using the ZIP file, I did unpack and install it. Now i have Version 0.32.0 installed.
After launching the new Web IDE I did send my code as listed above to the Espruino board and my console contains the following. Seems to be correct to me in the console, but unfortunately the Espruino console still shows the same errors as in my previous posts :-/