You are reading a single comment by @#kai and its replies. Click here to read the full conversation.
  • 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\",\"BOA­RD\":\"ESPRUINOBOARD\",\"CHIP\":\"STM32F­103RCT6\",\"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.addCac­hed("NRF24L01P","function NRF(a,b,c,d){this.CSN=b;this.CE=c;this.P­AYLOAD=d?d:16;this.BASE_CONFIG=8;this.cm­d=\"\";this.spi=a;this.callbacks=[]}NRF.­prototype.C={CONFIG:0,STATUS:7,CD:9,RX_A­DDR_P0:10,RX_ADDR_P1:11,TX_ADDR:16,RX_PW­_P0:17,RX_PW_P1:18,R_REGISTER:0,W_REGIST­ER:32,R_RX_PAYLOAD:97,W_TX_PAYLOAD:160,F­LUSH_TX:225,FLUSH_RX:226};\nNRF.prototyp­e.init=function(a,b){digitalWrite(this.C­E,0);digitalWrite(this.CSN,1);this.setRX­Addr(a);this.setTXAddr(b);this.setReg(th­is.C.RX_PW_P0,this.PAYLOAD);this.setReg(­this.C.RX_PW_P1,this.PAYLOAD);this.setRe­g(this.C.CONFIG,this.BASE_CONFIG|3);digi­talWrite(this.CE,1)};NRF.prototype.setRe­g=function(a,b){this.spi.send([this.C.W_­REGISTER|a,b],this.CSN)};NRF.prototype.s­etAddr=function(a,b){b=b.clone();b.splic­e(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);thi­s.setAddr(this.C.TX_ADDR,a)};NRF.prototy­pe.getReg=function(a){return this.spi.send([this.C.R_REGISTER|a,0],th­is.CSN)[1]};NRF.prototype.getAddr=functi­on(a){a=this.spi.send([this.C.R_REGISTER­|a,0,0,0,0,0],this.CSN);a.splice(0,1);re­turn a};NRF.prototype.getStatus=function(a){r­eturn this.getReg(this.C.STATUS)};\nNRF.protot­ype.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.PAYLO­AD;b++)a.push(0);a=this.spi.send(a,this.­CSN);a.splice(0,1);this.setReg(this.C.ST­ATUS,64);return a};\nNRF.prototype.send=function(a){this­.setReg(this.C.STATUS,48);digitalWrite(t­his.CE,0);this.setReg(this.C.CONFIG,this­.BASE_CONFIG|2);this.spi.send(this.C.FLU­SH_TX,this.CSN);a=a.clone();a.splice(0,0­,this.C.W_TX_PAYLOAD);this.spi.send(a,th­is.CSN);digitalWrite(this.CE,1);for(a=1E­3;a--&&!(this.getReg(this.C.STATUS)&48);­);0>=a&&print(\"TX timeout\");a=!0;this.getReg(this.C.STATU­S)&16&&(print(\"TX not received \"+this.getReg(this.C.STATUS)),a=!1);dig­italWrite(this.CE,0);this.setReg(this.C.­CONFIG,this.BASE_CONFIG|\n3);digitalWrit­e(this.CE,1);this.setReg(this.C.STATUS,4­8);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.cm­d,this.cmd=\"\",print(\"...>\"+c),c=\"\"­+eval(c),print(\"...=\"+c),this.sendStri­ngTimeout(c,500)):0!==c&&(this.cmd+=Stri­ng.fromCharCode(c))}}};\nNRF.prototype.m­asterHandler=function(){for(;this.dataRe­ady();){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.se­nd(c););}};NRF.prototype.sendCommand=fun­ction(a,b){this.callbacks.push(b);this.s­endString(a)};\nNRF.prototype.sendString­Timeout=function(a,b){var c=this;setTimeout(function(){c.sendStrin­g(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();Mod­ules.addCached(\"NRF24L01P\",\"function NRF(a,b,c,d){this.CSN=b;this.CE=c;this.P­AYLOAD=d?d:16;this.BASE_CONFIG=8;this.cm­d=\\\"\\\";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,R­X_PW_P0:17,RX_PW_P1:18,R_REGISTER:0,W_RE­GISTER:32,R_RX_PAYLOAD:97,W_TX_PAYLOAD:1­60,FLUSH_TX:225,FLUSH_RX:226};\\nNRF.pro­totype.init=function(a,b){digitalWrite(t­his.CE,0);digitalWrite(this.CSN,1);this.­setRXAddr(a);this.setTXAddr(b);this.setR­eg(this.C.RX_PW_P0,this.PAYLOAD);this.se­tReg(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.protot­ype.setAddr=function(a,b){b=b.clone();b.­splice(0,0,this.C.W_REGISTER|a);this.spi­.send(b,this.CSN)};\\nNRF.prototype.setR­XAddr=function(a){this.setAddr(this.C.RX­_ADDR_P1,a)};NRF.prototype.setTXAddr=fun­ction(a){this.setAddr(this.C.RX_ADDR_P0,­a);this.setAddr(this.C.TX_ADDR,a)};NRF.p­rototype.getReg=function(a){return this.spi.send([this.C.R_REGISTER|a,0],th­is.CSN)[1]};NRF.prototype.getAddr=functi­on(a){a=this.spi.send([this.C.R_REGISTER­|a,0,0,0,0,0],this.CSN);a.splice(0,1);re­turn a};NRF.prototype.getStatus=function(a){r­eturn this.getReg(this.C.STATUS)};\\nNRF.proto­type.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.PAYLO­AD;b++)a.push(0);a=this.spi.send(a,this.­CSN);a.splice(0,1);this.setReg(this.C.ST­ATUS,64);return a};\\nNRF.prototype.send=function(a){thi­s.setReg(this.C.STATUS,48);digitalWrite(­this.CE,0);this.setReg(this.C.CONFIG,thi­s.BASE_CONFIG|2);this.spi.send(this.C.FL­USH_TX,this.CSN);a=a.clone();a.splice(0,­0,this.C.W_TX_PAYLOAD);this.spi.send(a,t­his.CSN);digitalWrite(this.CE,1);for(a=1­E3;a--&&!(this.getReg(this.C.STATUS)&48)­;);0>=a&&print(\\\"TX timeout\\\");a=!0;this.getReg(this.C.STA­TUS)&16&&(print(\\\"TX not received \\\"+this.getReg(this.C.STATUS)),a=!1);d­igitalWrite(this.CE,0);this.setReg(this.­C.CONFIG,this.BASE_CONFIG|\\n3);digitalW­rite(this.CE,1);this.setReg(this.C.STATU­S,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=thi­s.cmd,this.cmd=\\\"\\\",print(\\\"...>\\­\"+c),c=\\\"\\\"+eval(c),print(\\\"...=\­\\"+c),this.sendStringTimeout(c,500)):0!­==c&&(this.cmd+=String.fromCharCode(c))}­}};\\nNRF.prototype.masterHandler=functi­on(){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.se­nd(c););}};NRF.prototype.sendCommand=fun­ction(a,b){this.callbacks.push(b);this.s­endString(a)};\\nNRF.prototype.sendStrin­gTimeout=function(a,b){var c=this;setTimeout(function(){c.sendStrin­g(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
    
About

Avatar for #kai @#kai started