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.
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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.
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:
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 likeE.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.