Avatar for Gordon

Gordon

Member since Sep 2013 • Last active Sep 2020

Most recent activity

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

    It's an odd one - It's the first I heard of that.

    I know there are issues with iOS if a Bluetooth device changes its services, but Nordic side-steps that by adding one (or removing one?) from the device MAC address when entering DFU.

  • in General
    Avatar for Gordon

    Hi,

    It's as @fanoush says - the advertising messages are sent all the time regardless. There's no two-way communications unless you actively connect to the Puck, so to ensure delivery it just sends the advertising all the time (usually a few times a second).

    The power consumption of sending the data is very minimal so it's nothing to worry about, and the Puck is only executing JS when you press the button.

    EspruinoHub is seeing the advertising messages and does a few things:

    • Reports RSSI for every message - which is why you see a lot of them
    • Notices if a message hasn't changed, and only sends "/ble/advertise/e9:1d:0b:37:51:d3/180f" if it has or if a minute has passed (the code for that is here)

    Nodered has a rbe - report by exception - block that you can drag in to filter out the extra advertising messages, and only report when something has changed: http://www.espruino.com/BLE+Node-RED#det­ecting-button-presses

    Hope that helps!

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

    I think it's possible that some code actually expects the name DfuTarg so it could be a problematic one to change. Internally the code I use for flashing definitely does.

    Which application are you using to do the flashing on iOS?

    I know it's frustrating but on Android you wouldn't have the issue. £50 on an Android tablet would fix it for you.

    Also it is possible to use https://github.com/thegecko/web-bluetoot­h-dfu which is a Node.js application to flash from a PC (Mac or Linux - Raspberry Pi works too) - so you could set up something like a Raspberry Pi to do the whole flashing process automatically whenever a device named DfuTarg is found

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

    Great, thanks for checking it out! I'm just gutted I didn't actually properly commit the fix I did a month ago!

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

    Ok, that was dumb - I did the fix originally but didn't commit it to the master branch so it didn't end up in cutting edge builds.

    If you try it now it should all be sorted.

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

    Thanks - I'll look into this. Just did a quick check and:

    function onTimer() {
      analogWrite(LED1,0.01,{freq:50})
    }
    
    var i;
    setInterval(function() {
      if (i) {
        clearInterval(i);
        i = undefined;
      } else i = setInterval(onTimer,10);
    }, 1000);
    

    You'd expect the LED to stay the same brightness. If you don't specify a frequency then it's fine so I assume that it's resetting the frequency even when there's no need.

    Is there any other way with more low level control to update PWM's values?

    Yes, there is - you could actually look at the nRF52832 reference manual and then poke values directly into the timer peripheral after it is set up.

    Hopefully I'll be able to get this fixed pretty quickly though.

  • in Bangle.js
    Avatar for Gordon

    Thanks! Lets hope the water ingress hasn't caused any other issues - if so I'll send you a new back panel just to be sure.

  • in General
    Avatar for Gordon

    It'd be possible to extend the compiler service to include JsvIterator which would make iteration over JsVars a lot easier... However in this case for sorting it's not such a huge help as it's a nightmare having to sort via iterators.

  • in JavaScript
    Avatar for Gordon

    Thanks! As @AkosLukacs and @allObjects mentioned, MDN is an amazing JavaScript reference - it describes the APIs really clearly, but also gives examples of use and also of some of the slight quirks.

    It looks like it's got some tutorials in there too which look good as long as you're happy to gloss over the bits where they access the webpage from JS (which obviously don't apply to Espruino).

    You had a mention in last issue of Hackspace magazine

    That's really cool. I had no idea - Issue 35? https://hackspace.raspberrypi.org/issues­/35

  • in Bangle.js
    Avatar for Gordon

    Sorry to hear that - It might be objecting to the image due to file size? You could always email to gw@pur3.co.uk

    The metal rear of the case should have some white or clear epoxy around the heart rate sensor window and charge port already. If that's missing it'd definitely be the issue!

    If so I'll get a new one in the post to you - I'm sorry about that, I have no idea how that passed their QA process.

Actions