Im following https://www.espruino.com/Smart+Meter
How do you access data in an ArrayBuffer that is sent over a BLE advert to node-red.
And my end-goal is to get data from my Electricity Meter, to the Puck.js to Raspberry pi, to Firebase DB.
I've got the data to the puck.
I've got the data to the raspberry pi via the bluetooth advertising and node-red/EspruinoHub.
Now im trying to figure out the advertising data, how to read it, and then once I have that, I can focus on the connection to Firebase.
My current issue is that the data over MQTT is coming out as the current count from the Puck.js, seems all ok, but then it changes from a number (00000001) to something else (000004f9) which looks binary or bytes or something else.
I need help figuring out how the ArrayBuffer plays with the DataView and everything else.
I kind of get that you dont access data directly in the ArrayBuffer, you use the DataView for read and write, but in this case, its writing to it, and then it goes across the Bluetooth highway, into node-red as the unreadable string, and then.... well thats where im stuck.
How do I make sense of:
7/27/2020, 6:23:10 PMnode: 85a205c2.26d3f8
/ble/advertise/mac:address/manufacturer/0590 : msg.payload : string
And get it into something like Firebase (I'm thinking RealTime db seems best, normal db would go crazy if it was updated every 600ms / out of free credits). Im not tied to Firebase, just seemed like a good option.
© Espruino, powered by microcosm.
Report a problem