-
-
Sorry for my late response. I tried your advice to remove the naming, but the output is identical.
Config loaded MQTT Connected <HTTPProxy> Bleno State poweredOn <HTTPProxy> Bleno.startAdvertising Success <HTTPProxy> Bleno.setServices Success Scanning started... MQTT>/ble/write/c9:88:f0:97:da:57/nus/nus_tx => "LED1.set();\\n" Service 6e400001b5a3f393e0a9e50e24dcca9e Characteristic 6e400002b5a3f393e0a9e50e24dcca9e <Connect> Error Connecting Tue Dec 13 2016 19:30:16 GMT+0100 (CET) 5a:8b:0c:72:57:56 - ? (RSSI -66) 68:d9:3c:8e:46:b3 - ? (RSSI -43) c9:88:f0:97:da:57 - Puck.js da57 (RSSI -84) 1809 => {"temp":102}
-
Note:
I wonder how to "control" the puck in some way. I tried your advice at https://www.espruino.com/Puck.js+Node-RED.So I published
{"payload": "LED1.set();\n"}
(and alsoLED1.set();\n
) to/ble/write/puck1/nus/nus_tx
But all I get is:MQTT>/ble/write/puck1/nus/nus_tx => "{\"payload\": \"LED1.set();\\n\"}" Service 6e400001b5a3f393e0a9e50e24dcca9e Characteristic 6e400002b5a3f393e0a9e50e24dcca9e <Connect> Error Connecting
Am I missing some advertising?
-
-
Hi,
these days I received my puck and I wonder how you connect your pucks to some REST/mqtt services.
For example: I have a openhab automated "smart home" and I want to push some data from the puck to the REST API of openhab (btn click, temp, light, mag etc).
First I tried to use the fantastic EspruinoHub project, but BLE4 HTTP Proxy seems a bit limited with only 20bytes payload (and yes uri's are payload too :D). I hacked a bit the sources and get it working by "encoding" some requests, for example the requestrequire("ble_http").httpRequest(device, "myItem/state", function(d) {})
will be made to
http://openhab:8080/rest/items/myItem/state
. This can be a direction to go, but it needs some work.Another way would be the MQTT feature of EspruinoHub, but I didnt get it working (especially with custom data).
What are you guys using for connecting your pucks to the world?
Btw:
Whats the proper way to ask for temperature via mqtt?
Tried/ble/read/puck1/1809/2A1C
so far -
Hi,
I setup the Espruino Hub on my raspberry pi (2) and all seems to work very well. I can successfully run
NRF.requestDevice({ filters: [{ services: ['1823'] }] }).then(function(device) { console.log(device) })
and get the hubs bluetooth dongle as result. But if I run the full example from https://www.espruino.com/Puck.js+HTTP+Proxy I just get
WARNING: Module "ble_http" not found
.I updated my puck to 1.89, what Im missing? :)
Thanks!
-
Hi,
after my post I re-read the docs to verify that the LSM9DS0 is capable of block reading. Yes it is, but I overlooked something. The MSB of the register to read must be 1 for auto incrementing the address. I will give this a try later and add another post. :)
Thank you.
Edit: hehe you were faster :D
-
Hi everyone,
Im currently writing a module for Sparkfuns LSM9DS0 9DOF IMU. The IMU is properly wired and works as expected. After some configuration I try to read 6 Bytes from register OUT_X_L_A (0x28). My code looks like the following:
I2C2.writeTo(ADDR, OUT_X_L_A); var result = I2C2.readFrom(ADDR, 6);
result is an Int8Array of size 6, but it contains 6 equal values. More specific: its the value from OUT_X_L_A and all other registers (OUT_X_L_A+1, OUT_X_L_A+n) won't be read. Something like [ 13, 13, 13, 13, 13, 13 ] instead of [ 13, 28, 90, 54, 77, 1 ].
I have seen many modules for other I2C devices that work this way, but if I do:I2C2.writeTo(ADDR, OUT_X_L_A); var byte1 = I2C2.readFrom(ADDR, 1); I2C2.writeTo(ADDR, OUT_X_L_A+1); var byte2 = I2C2.readFrom(ADDR, 1); ...
it works...Does anyone have an advice for me?
Best regards
otbeEDIT: Im using a espruino pico with 1v80 firmware. The LSM9DS0 should be capable to send multiple bytes.
Sorry no chance to get this working :/
The other way works great. I'm able to advertise arbitrary data via BLE and get messages back :)