• Yes - pushing via HTTP is more difficult. I think EspruinoHub currently ignores the headers and body characteristics when sending, but if it used it could give you a bit more space.

    Whats the proper way to ask for temperature via mqtt?

    You'd have to first expose it using NRF.setServices/.updateServices, then you can use /ble/read as you were doing.

    However I've just been doing:

    setInterval(function() {
      NRF.setAdvertising({
        0x1809 : [Math.round(E.getTemperature())]
      });
    }, 30000);
    

    Then EspruinoHub picks up the advertising automatically and creates MQTT events. You can use a 16 bit temperature too if you want to.

    I guess another option is to add a /ble/uart endpoint that connects, sends data via the UART, and then sends another packet back with the response in. That way you could just send something like E.getTemperature() and then listen for the response.

    ... of course eventually I'll be adding IPv6 to the Puck itself, so that'll make everything a bit easier.

About

Avatar for Gordon @Gordon started