1-wire temperature sensor on Omega Cloud
-
Dont know if anyone else has tried, but it took me a bit of tweaking to use the onion cloud to read the 1-wire temperature sensor I wired up on the onion cloud.
-
First thing is to wire up the 1-wire temperature sensor. I did this by following this: https://wiki.onion.io/Tutorials/Reading-1Wire-Sensor-Data
-
next thing is to setup your onion on the http://cloud.onion.io
-
get an API key and Device ID and turn to postman or your REST tool of choice.
Set the Method to POST and use the following endpoint
https://api.onion.io/v1/devices/{Your DeviceID}/file/exec
Replacing {Your DeviceID} with your actual device ID. so, if your Device ID was 1234567, the endpoint would look like this:
https://api.onion.io/v1/devices/1234567/file/execYou would also create a custom header called X-API-KEY and set the value to the API key you generated.
then in the body, set it to "Raw" and the type = "application/json)"
The JSON that I set in my body is below. NOTE: this is for Fahrenheit. you would only need to have $2/1000 if you wanted Celsius. You would also change the 28-000004fd92f7 with the id of your Dallas temperature sensor that you setup in #1
{
"command": "awk",
"params":[
"-F=",
"/t=/ {printf "%.03f", (($2/1000)*1.8)+32;}",
"/sys/devices/w1_bus_master1/28-000004fd92f7/w1_slave"
],
"env": ""
}This is what I ended up with. Works nicely and no programming needed!
-
-
Oops. originally posted this with another account that I had. this is my real account. so, hatemail can goto this account
-
This post is deleted!
-
@David-Rugh the dates will give you a clue.
-
We've actually had our co-op do some work on temperature sensors and the Onion Cloud! Check out temperature.onion.io, you can even add your own device to the dashboard!
The full project is available on Github: https://github.com/OnionIoT/Onion-Sensor-Server
Can be quickly changed and extended for other data types, we'll be putting together a more detailed write-up soon!
-
Hey @Lazar-Demin I'm kind of newbbie with omega and stuff but I would love to have my Onion Omega 2 posting the temperature to this temperature.onion.io . I have the DS18B20 already wired to my omega but I am having lots of doubts about all using all of these files that you have on the "full project github". By any chance do you have any sort of tutorial about it? Otherwise, What are the next steps after wiring the sensor to the board? Thank you!
-
@Jonas-Belink You can check out the steps in the GitHub repo's readme file to see how to setup the server code on a dedicated server somewhere (AWS, DigitalOcean, etc).
If you just want to add your device to our existing temperature.onion.io server, see https://github.com/OnionIoT/Onion-Sensor-Server#adding-your-device