temperature readings with ds18b20 1 wire sensor

Hi guys,

I am trying to read a sensor temp from the gpio of raspberry pi...

I don't know how to send data to emoncms :S

I don't understand correctly the work flow from imput->feed->dashboard, maybe to easy, and i don't understand it, i don't know.

Is there any documentation about protocol formats or something...it seems easy from the cms, but I don't know what I need.

Firstly i will do it with bash, for testing, after with c language, I don't know maybe its easy and I don't get the point :S

I can Already see the temps from the ds18b20 sensor, using bash...but i don't know how to log them to emoncms...

I created a input called room_temp, and a feed for it...afther that I assigned the feed to the graphs in dashboard...but i think I need some programing to send data to emoncms right?

Can any one help me with the workflow of this?

 

Thanks in advance

tuxd3v's picture

Re: temperature readings with ds18b20 1 wire sensor

Hi,

I created a input for server temp...

Node: name Description Process list

1 1 server_temp log

after that a feed have benn created:

Id Name Tag Datatype Public Updated Value

5 server_temp REALTIM "private" inactive 0.00

using jason api helper... I am doing this...

 

#!/bin/bash

while :

do

info_temp0=$(/opt/vc/bin/vcgencmd measure_temp)

temp0=${info_temp0:5:4}

echo $temp0

curl "http://localhost/emoncms/input/post.json?json={server_temp:$temp0}"

sleep 5

done

 

but the feed appears inactive :S?!

Nothing happens... In dash I associated a gauge...but I don't get feedback from emoncms!

What i need to do?

 

thanks in advance

regards tux

Mattia Rossi's picture

Re: temperature readings with ds18b20 1 wire sensor

You need to add the api write key for the user you are logging data for to the url as detailed in /emoncms/input/api

Regards

tuxd3v's picture

Re: temperature readings with ds18b20 1 wire sensor

Ok...

I got it :S

its to much easy... kudos for you guys...the inputs are created automatically with APIKey.

I have a problem now with the returning Ok string...

I am redirecting the output "ok" to /dev/null...but curl will show some statistic data...

To solve that we can use -s(to suppress this statistic data when redirecting or when a error ocurrs)
 

I readed some where that apikey puts some more processing on the server side...maybe because of validation key?is that processing power very high?

 

EDIT: in the smoothie graph visualization...what the parameter Ufac means??

thanks in advance

regards

tux

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.