Avatar for AkosLukacs

AkosLukacs

Member since Dec 2015 • Last active Mar 2021
  • 19 conversations
  • 477 comments

Most recent activity

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

    Interesting, IIRC Espruino interpreter does "wake up" periodically, some timer runs out, it's documented somewhere. So short spikes in power consumption is expected.
    Tested with an MDBT42Q breakout @ v.2v08.189, but my baseline is around 5~7uA (measured by an INA226 and Espruino) .

    When did you buy the Espruino and the Raytac module? Long shot, but maybe Raytac changed something in the module, and doesn't go as low power as earlier modules did? Got mine with the Bangle kickstarter. Or maybe you uploaded something earlier to the modules that changed fuse bits?

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

    Somewhere you mentioned you already have some prototypes, but would adding a Feather footprint be possible?

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

    Have you connected anything to serial pin (D0 on MDBT40Q)? That would turn on the high speed oscillator and increase power draw.
    Also, are you connected via BLE (or any phone or computer that may connect automatically)? You have to disconnect to actually shut off radio.

  • in Interfacing
    Avatar for AkosLukacs

    Much better, file length matches the buffer-s length. First couple of bytes match. I think all I need is read back on the computer.

    Thank you!

  • in Interfacing
    Avatar for AkosLukacs

    I'm trying to write 16bit integers to a file, but didn't got the result I was expecting. For example:

    >var d = new Uint16Array([255, 1111, 42])
    =new Uint16Array([255, 1111, 42])
    >d[0]
    =255
    >d[1]
    =1111
    >d[2]
    =42
    >fs.appendFile("log0.txt", d)
    =true
    >var dr = fs.readFile("log0.txt")
    ="\xFFW*"
    >dr.charCodeAt(0)
    =255
    >dr.charCodeAt(1)
    =87
    >dr.charCodeAt(2)
    =42
    

    \xFF is 255, ok for one byte.
    1111 is 0100 0101 0111 in binary, and W is 87 character code, 0101 0111 binary. Looks like the lower byte of the 16 bit integer is saved.
    * is 42, ok.

    My question is: Looks like saving typed arrays directly is not supported. Will it be, or what would be the best way to save this data as fast and efficient as possible?

    Board is a Pixl running 2v08.188 (and of course shouldn't call a binary file .txt)

  • in Bangle.js
    Avatar for AkosLukacs

    Bluetooth Long Range / coded phy is not available on the nRF52832. Maybe you confused it with the nRF52833 (three at the end).
    Or 52811, 52820, 52840, 5340, couple of chips were announced since the 52832 :)

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

    Is there any way to get OneWire and BLE reliably work together?
    Using a Pixl with 2v08.188, have three DS18B20 attached to A0. If Bluetooth is connected, mostly only 0 or 1 sensor are detected, and there are a bunch of null values returned when reading temperature.
    Tested with Pixl on serial, and with an Espruino Wifi, and all sensors are detected, and almost no null values returned.

    If I'm right, OneWire is done in software, and I assume BLE communication is interfering with that, right? Is there anything that could improve? Do the coding, and disconnect & disable BLE to run the code?

    And other question: Assuming I'm not using BLE while running the code, what are my chances of reading multiple DS18B20 and reading accelerometer and writing to SD card together? Ok, let's just try it :D

    Code is below:

    var ow = new OneWire(A0);
    //R: VCC, G: Gnd, Y: Data
    var sensors = [];
    function scan(){ sensors = ow.search().map(function (device) {  return require("DS18B20").connect(ow, device);}); }
    setInterval(function() {
      sensors.forEach(function (sensor, index) {
        sensor.getTemp(function (temp) {
          console.log(index, sensor.sCode, ": " + temp + "°C");
        });
      });
    }, 1000);
    
    setTimeout(scan, 1234);
    
Actions