• Thanks for trying all that! That is a bit of a shame. It looks like the data is just coming in too fast.

    I just tried it here with your code and a Pixl running 2.18 with one of the receivers shown in http://www.espruino.com/433Mhz and I can get it to work...

    It does show FIFO_FULL, and it doesn't always pick up the button presses - but if I press the button on the transmitter a few times it does tend to pick it up eventually.

    What I did was used your code, but removed jit from the second function which only gets called once (it probably doesn't matter):

    var n="";
    function sig(e) {
      "jit"
      // The data we have received so far
      // The handler that gets called when the signal changes state
      // start listening for a change
      var d = 10000*(e.time-e.lastTime);
      if (d<2 || d>10) {
        if (n.length>20) console.log(n);
        n="";
      } else if (!e.state) n+=0|d>5;
    }
    function startListening(pin) {
      setWatch(sig, pin, {repeat:true, edge:"both"});
    }
    startListening(A0);
    

    You can also try NRF.setConnectionInterval(100) which will slow down Bluetooth which gives the CPU more of a chance to handle the inputs coming in.

    Not having jit at all it still works occasionally, but is even less reliable. Interestingly some buttons seem to be more reliable than others in the remote too - I'm not sure why that happens!

    It's also interesting to see that the console gets pretty slow/unreliable - the data coming in is just too fast for it.

    Checking on a scope I see pulses coming it at around 1kHz - so it'll be calling sig at 2kHz. It's a shame we can't get it handling signals just a bit faster.

    ... and interestingly using the 433 module doesn't work at all for me :( I'll see if I can add 'jit' in it

  • Interestingly some buttons seem to be more reliable than others in the remote too

    Oh, I haven't actually tried all of the buttons :D (all I'm interested in were the first two since those were bound to the socket's on and off switch).

    I'll try and see later if at least some of the buttons do work.

    I'll also try the connection interval setting. Maybe even fanoush's suggestion of moving serial to a usb adapter might help.

About

Avatar for parasquid @parasquid started