Avatar for David1234321

David1234321

Member since Apr 2020 • Last active Oct 2020
  • 11 conversations
  • 54 comments

First time user of this - seem very cool

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    wellll
    it's seem that I had some problem in the computer that block me some websites......

    I have try with another computer - and everything start to work

    what a waste of a day!

    so now its working and read the data every 10 seconds

    Thank you for the help!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    the computer is connected all the time to the internet

    1. where it load the module , maybe something happand to the server?
    2. if there was a problem , how could I upload the code before? what have change?

    Thanks ,

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    I don't know what to say:

    I have try to upload the code you posted(I'm write it so you will see no errors)

    var mcp;
    function onInit() {
      clearInterval();
      I2C1.setup({scl:D25,sda:D26, bitrate: 60000});
      mcp = require("MCP9808").connect(I2C1, 0b000);
      console.log("I2C Setup Finsih");
      ReadTemp();
    }
    function ReadTemp() {   
      setInterval (function() {
        digitalWrite(LED1,0);
        var temperature = mcp.getTemperature();
        var TimeStemp = new Date().toString();
        console.log(TimeStemp + "  :  " + "Temperature: " + temperature + " C");
        setTimeout(function(){
          digitalWrite(LED1,1);
        },5000);
      } , 10000);
    }
    
    onInit();
    

    this is what I get :

    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v07 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >
    Running onInit()...
    Uncaught Error: Module MCP9808 not found
     at line 3 col 26
      mcp = require("MCP9808").connect(I2C1, 0b000);
                             ^
    in function called from system
    

    both on RAM\Flash uplaod

    what is wrong now?

    update*
    I get the same error when I try to uplaod my own code that works before

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    2 questions:

    1. to uplaod the new code on FLASH , right?
    2. run "require("Storage").eraseAll()"
      anyway before uplaod the code?

    *** update
    when I run the erase I get this

    require("Storage").eraseAll()
    =undefined
    

    Thanks ,

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    so what to do now?
    I have change it to "Flash" but it say "Sent"
    but still it stuck (can't do nothing on the console )
    I have disconnect , and now I can't reconnect

    I have reboot the device ,recoonet it
    nothing is running now (no output on the console)
    but I can "talk" with the device:

    >new Date().toString()
    ="Thu Jan 1 1970 00:01:34 GMT+0000"
    

    have try to run upload to FLASH
    and this is what I get :

    ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v07 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >Uncaught Error: File already written with different data
     at line 1 col 1077
    ....REG_TEMPERATURE);r",0,3939);
                                  ^
    Uncaught Error: Unable to find or create file
     at line 2 col 1082
    ...FIG,d&65522|a&13)};a.",1024);
                                  ^
    Uncaught Error: Unable to find or create file
     at line 3 col 1070
    ...otype.write8=function",2048);
                                  ^
    Uncaught Error: Unable to find or create file
     at line 4 col 943
    ...\n\nReadTemp();\n\n\n",3072);
                                  ^
    >
    

    so what to do now?

    ** I have uplaod it now to RAM - and it's working (if it's help you to understand and help me)

    Thanks ,

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    the address is OK
    I have check in some i2c scanner

    I think something is wrong with the flash memory
    because I have upload the code using the esperino IDE in chrome this time , selected RAM
    and it's working , it print me the data

    this is the code:

    I2C1.setup({scl:D25,sda:D26, bitrate: 60000});
    var mcp = require("MCP9808").connect(I2C1, 0b000);
    console.log("I2C Setup Finsih");
    
    
    function ReadTemp() { 
      
    setInterval (function()
                 {
      digitalWrite(LED1,0);
      var temperature = mcp.getTemperature();
      var TimeStemp = new Date().toString();
      console.log(TimeStemp + "  :  " + "Temperature: " + temperature + " C");
      setTimeout(function(){
      digitalWrite(LED1,1);
      },5000);} , 10000);}
    
    ReadTemp();
    

    I have used upload to RAM
    and it's working

    Mon Oct 12 2020 10:53:35 GMT+0300 : Temperature: 21.625 C Mon Oct 12
    2020 10:53:45 GMT+0300 : Temperature: 21.5625 C Mon Oct 12 2020
    10:53:55 GMT+0300 : Temperature: 21.5 C Mon Oct 12 2020 10:54:05
    GMT+0300 : Temperature: 21.5625 C Mon Oct 12 2020 10:54:15 GMT+0300
    : Temperature: 21.5625 C Mon Oct 12 2020 10:54:25 GMT+0300 :
    Temperature: 21.5625 C

    now I have enter save() , in order to make it work after reboor\power off - everything
    got stuck:
    can't write nothing in the console
    get no replay
    the led is off

    this is what I have in the console after "save()"

    >save()
    =undefined
    Compacting Flash...
    Calculating Size...
    Writing..
    Compressed 40000 bytes to 6792
    

    what to do now ? something went wrong ?

    Thanks ,

    • 3 comments
    • 178 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    after I wated all day connectiong the device using USB-serial
    I have try to use the bluetooth option in the chrome ide - https://www.espruino.com/ide/#

    I can see the device
    I can connect to it
    but I get this error

    CONNECTED TO WEB BLUETOOTH, MDBT42Q 2E7E (NO RESPONSE FROM BOARD)

    how could it be?
    what can I do now?

    I have try with another board
    I get this error

    CONNECTION FAILED.

    I have only conneced 3.3V and gnd to the devices

    what is wrong?

    Thanks ,

  • in Puck.js, Pixl.js and MDBT42
    Avatar for David1234321

    another problem

    I have try to upload this code

    I2C1.setup({scl:D25,sda:D26, bitrate: 60000});
    var mcp = require("MCP9808").connect(I2C1, 0b000); // 0b000 means A2 = A2 = A1 = GND 
    var temperature = mcp.getTemperature();
    console.log("Temperature: " + temperature + " C");
    
    function ReadTemp() { 
    setInterval (function()
                 {
      var temperature = mcp.getTemperature();
      console.log("Temperature: " + temperature + " C");
      digitalWrite(LED1,1);
      }
      ,1000);}
    
    digitalWrite(LED1,0);
    ReadTemp();
    

    I get no error while uploading ,
    just see the bar running , then "SENT"
    see the

    ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v07 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    

    then nothing - the device is not replay
    nothing on the console , can't write nothing on it

    I don't get any error - but it doesn't uplaod the code
    after reboot from power - It run the old code (the one on the first post)
    how could it be ?

    Thanks ,

Actions