Terminal to rrdtool- for a float

view full story

http://forums.fedoraforum.org – 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 approaches (HowTos)