Project to use Puck.js as a Remote Temp Sensor (Eg To monitor fridge/ freezer) #3395
Replies: 21 comments
-
Posted at 2016-12-18 by @MaBecker Sample that uses NRF.setServices and NRF.updateServices on Puck.js to publish temperature
check https://www.bluetooth.com/specifications/gatt for further details on GATT Characteristics, Declarations, Descriptors, Services |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by @MaBecker or a shorter one
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by stevie4711 @MaBecker, thanks for the code, looks interesting! However it does not work for me, I tried for example the nRFToolbox on an iPhone. That does not display the data. Can you tell which application you used to read the data? Also, my understanding is that to read that data you would have to connect. I am probably misunderstanding this but as a beacon I would use setAdvertise. Something like this:
(directly from the tutorial). Then I can see the data directly in nRF Connect without even connecting. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by @MaBecker @stevie4711 I am using Bluefruit to connect and read the raw data Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by stevie4711 Okay, thanks, that works for me as well. At least on one Puck, on the other it does not work at all. But it seems that Puck is damaged, somehow... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by JamesS @MaBecker, many thanks for those examples. Really helpful. Worked second time of asking. Weirdly copy / pasting into nano and uploading via CLI on Raspberry resulted in the error below which seen before but luckily the example was easy to retype. I don't have access to bluefruit but was then able to test the code using the bluez command gatttool to query the characteristic 0x2A6E which responded with '31 39 2e 32 35' which is 19.25 in ascii. The puck was in the warm so it is a sensible result. (This puck stopped working after it got to a temperature of -32 degrees in my freezer but has now recovered) This is gatttool in action:
Here is the error encounted after cut/pasting the code.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-19 by @gfwilliams Strange error - can you post an issue on https://github.com/espruino/EspruinoTools with the exact contents of the file that wouldn't upload? But I'd say the And most likely it'll be the battery that won't take freezing temperatures, rather than the Puck - you might be able to find a special CR2032 meant for low temperatures I guess |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-19 by JamesS Tnx. Will create an issue for that error when I get home. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-19 by Mark Hello! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-19 by @MaBecker |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-20 by @allObjects I'm not sure if Puck is freezer safe / savy... for sure the battery will not enjoy much life in −18 °C, respective 0 °F (temperature assumed in food safety / expiration date definition). Having a remote sensor (inside) or a remote battery (outside) could help here... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-20 by @gfwilliams @mark thanks - it's all updated now! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-21 by Wilberforce I would use the ds18s20 - 3.3v, gnd and one data pin on the puck: Unique 1-Wire® Interface Requires Only One Port Pin for Communication. Maximize System Accuracy in Broad Range of Thermal Management Applications. Measures Temperatures from -55°C to +125°C (-67°F to +257°F) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-21 by JamesS I am reading temps using gatttool but because I have to connect to do this I suspect a purist would point out that this is not Low Energy yet. For that I plan to explore use of Node Red over the holiday but in the meantime, has anyone got broadcasts working? If so, what mobile app or tools are you using to view the advertising? Are you able to post a screenshot? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-22 by dklinkman I have tried broadcasting ('advertising') using example code from this thread and it works great.
on the monitoring end the EspruinoHub software works well on the RPi. The temperature in this case gets published by the hub to the local mosquitto MQTT broker where it can be subscribed to by any MQTT client. For example the client on the RPi (change the MAC address to yours)
or
Note that the hub only publishes when the temp value has changed, or every 60 seconds. This is what the EspruinoHub displays while it is running in the foreground and while the Puck is advertising the temperature
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-22 by @allObjects Great example! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-23 by MarcEvan Anyone know of any useful Android or OSX apps/utilities that could be used to receive/view the puck notifications? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-30 by dklinkman If you mean notifications via MQTT on Android I use MyMQTT. For iOS there's and app called MQTT Tester that I haven't tried. If you mean notification directly from the puck via BLE there's nRF Connect for Android that works. For iOS it's called nRF Toolbox but I haven't tried it. My iPad is too old. For OSX I have no idea. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-07 by user91203 Did anyone ever find out how well the CR2032 works in the freezer? I was hoping to do a similar thing to the original poster. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by @gfwilliams I think it might be more or less ok - the Energizer CR2032 datasheet mentions they work down to -30 degrees C: https://data.energizer.com/pdfs/cr2032.pdf A cheaper one mentions -20 (http://www.farnell.com/datasheets/1496885.pdf) but I'd have thought it'd be ok. I guess if you do hit issues you might need to find a better battery but it definitely seems to be within sensible temperatures for a freezer. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by user91203 Thanks. I think I saw that datasheet for the -20 one, but not the Energizer one. I'll give it a go with the ones I've got and see what happens. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-18 by JamesS
I want to monitor the temperature one of my pucks. It is now installed in my freezer.
Initially I wanted to do this monitoring from a RaspberryPi v3 running Jessie which is about 4m behind the freezer through a wall but I would prefer the temp to be broadcast via BLE so that this sensor is readable by tools such as gatttool on the RaspberryPi and other devices that support BLE eg my Android phone.
So far I can (1) connect to it from my Raspberrypi using CLI....
and (2) read the temperature using the built in function E.getTemperature()
Now that I know the radio transmission path is OK and the sensor is working the next challenge is to get this puck broadcasting the temp. To maximise battery life I don't want to connect to the puck each time I want a temperature reading; instead I would like to receive data over BLE like a beacon.
Has anyone cracked sensor readings from the puck using the BLE broadcast features?
TIA
Beta Was this translation helpful? Give feedback.
All reactions