Avatar for HaraldK

HaraldK

Member since Sep 2015 • Last active Feb 2020
  • 6 conversations
  • 21 comments

Most recent activity

    • 4 comments
    • 168 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for HaraldK

    Thanks! I'll heed Gordon's suggestion and use BLE instead then. Especially since Conor didn't work on ANT either.
    Works for me. Thanks to both of you for the very quick reply!

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

    Hi,

    I got 2 Puck's and a Garmin smartwatch. Both can use BLE as well as ANT. There are unfortunately no examples for ANT or ANT+.

    Does Espruino support ANT or ANT+ in any way?

    If not, I'll have to go the BLE route it seems.

    Harald

  • in ESP8266
    Avatar for HaraldK

    Nothing else running on it. I had more, but to debug this problem I removed anything else (not that much was running since it's very much space constrained).
    Since the point is to display whatever is sent (up to 6 bytes, since it's a 6 character display), not much chopping up possible.
    For power: It's using a USB power adapter. Never had problems with it.
    Two different ESP8266 modules. Both with ESP12E: Wemos D1mini and a random NodeMCU module.

  • in ESP8266
    Avatar for HaraldK

    Maybe i should simple not use those ESP8266 anymore...

    ESP32 tested and works 100% as expected.

    BTW in both cases I use v2.0x (x=0 for ESP32, x=1 for ESP8266).

  • in ESP8266
    Avatar for HaraldK

    Hi,

    I have a small ESP8266 module which is supposed to receive simple data via simple TCP. The net module should do that and it works mostly:

    var server = net.createServer(function(socket) {
      socket.on('data', function(data) {
        try {
          let a=JSON.parse(data);
          console.log(">"+JSON.stringify(a));
        } catch(e) {
          console.log("ERROR: ", e);
        }
      });
      socket.end();
    });
    
    server.listen(1234);
    

    On the sender side I do a simple test via netcat:

    for i in {0..4} ; do echo "{'toggle':$i}" | nc 192.168.21.105 1234 ; done
    

    But what I get on the Espruino side is:

    {"toggle":0}
    {"toggle":2}
    {"toggle":3}
    {"toggle":4}
    {"toggle":0}
    {"toggle":1}
    {"toggle":3}
    {"toggle":4}
    {"toggle":0}
    {"toggle":1}
    {"toggle":3}
    {"toggle":4}
    {"toggle":0}
    {"toggle":1}
    {"toggle":1}
    {"toggle":2}
    {"toggle":3}
    {"toggle":4}

    which is not what I'd expect from TCP. I should see 0, 1, 2, 3, 4.
    Even if I send one string at a time (and not 5 in a loop), it gets lost in about 20% of the cases.

    Am I doing something wrong? Is the net module on ESP8266 not working reliably?

  • in ESP32
    Avatar for HaraldK

    Digging a bit around, this works and it's reliably working: Use espruino -o x.js MYPROGRAM.js and then upload the temporary output, which resolves all require() modules via wifi (nc ESP32IP 23 < x.js)

    That proves at least that whatever the espruino command does, seems to work. The problem might be an intermittent reset caused by the serial port.

  • in ESP32
    Avatar for HaraldK

    Hi,

    I got a neat ESP32 board and tested Espruino (1.92) on it. Works like a charm when using the Web IDE. Uploading via NPM espruino module works. About once in 10 times. It sends data (-v switch is very useful here), and it usually does something, but often it seems to forget everything immediately, like if there is a reset() after upload.

    E.g. I have a small program uploaded which:

    1. Sets up I2C1
    2. Loads SSD1306 library and initializes the OLED (connected via I2C)
    3. Prints text on the OLED. This works 100%. The OLED is initialized and text appears.
    4. Supposed to print more every second (via setInterval()). That does work once in about 10 times.

    In the cases where it does not work, the serial console is usually no longer working until I reset the board. In the few cases where the console is accessible, I can connect via minicom, and I see nothing being remembered of my program. Looks like a reset happened. Namely the variable g I use for the OLED is not defined anymore. No wonder it cannot write anything to the display.

    The Web IDE works. Always.

    Any idea what's causing the NPM espruino to not work as well as the Web IDE?

    Harald

Actions