Thread: Terminal to rrdtool- for a float
-
November 30th, 2009, 05:46 AM #1Junior Member
- Join Date
- Nov 2009
- Posts
- 4
Terminal to rrdtool- for a float
Im recording a float which arrives on /dev/ttyUSB0 and looks like this
Code:
-9.87,-10.00,-10.12,-10.25,-10.50,-10.50,-10.62,-10.75,-10.75,
-10.75,-10.87,-10.87,-10.87,-11.00,-11.12,-11.12,-11.25,-11.25,
-11.25,-11.37,-11.37,-11.37,-11.37,-11.50,-11.50,-11.50,-11.62,
-11.62,-11.62,-11.62,-11.62,-11.75,-11.75,-11.75,-11.75,-11.87,
I am trying to set the tty and trf the value to a round robin database with the following script.
Code:
#!/bin/bash
cat </dev/ttyUSB1 >> fromarduino &
temp1= tail -c7 fromarduino
rrdupdate freezer.rrd N:`${temp1%%,}`
echo `${temp1%%,}`
date > arduinolastdate
stty -F /dev/ttyUSB1 cs6 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -clocal sane
# run this with the command " nohup bash myscript < /dev/null > sh.err 2>&1 "
#Experimental
for (( c=1; c<=60; c++ ))
do
value=`cat fromarduino|cut -d ',' -f $c`
let $value=$value
let total=$total+$value
let average=$total/60
done
rrdtool update number.rrd -t number N:$average
#rrdtool create number.rrd -s 60 DS:number:GAUGE:120:0:1000 RRA:AVERAGE:0.5:1:44640 # This is the command to create the database, 44640 = number of minutes in a month of 31 days
I can obtain the variable "temp1" OK but it seems I cannot get it into the rrd database .
Can anybody help? The top 7 lines are what I'm using and the last 10 or so lines are just me trying other approac
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Free A&W Root Beer Float today
By mad1 in forum IMO CommunityReplies: 12Last Post: June 19th, 2009, 07:04 PM -
Float: Center (JS Fix)
By new_guy217 in forum Webmastering and ProgrammingReplies: 1Last Post: February 25th, 2008, 09:21 AM -
Abortion float freaks out
By Terminal23 in forum IMO CommunityReplies: 91Last Post: August 26th, 2005, 07:34 PM -
Terminal Services
By Jack Hannibal in forum Applications and Operating SystemsReplies: 5Last Post: May 1st, 2005, 12:14 AM -
terminal
By carlene in forum Technical SupportReplies: 5Last Post: April 7th, 2003, 10:07 PM



LinkBack URL
About LinkBacks



Reply With Quote

lulz. ^_^ Today is 5/22. Two year anniversary of the Joplin tornado. :( In better news, Daft Punk's album is out and my LP is in the mail. :cool:
Is It Just Me? v233893843