Watts=`cat arduino_bits|cut -d ' ' -f5|cut -d '.' -f1` Let gas=$ # 111 wh per gas meter turn = 11.1 kWh per cubic metre Prevgas=`cat /root/arduino_gas|cut -d ' ' -f 25`Įcho $lastgasturn > /root/gasprevioustime Lastgasturn=`cat /root/arduino_gas|cut -d ' ' -f 26` Prevturn=`cat /root/arduino_lec|cut -d ' ' -f 24`Įcho $lastarduinotime $lastminute > /root/arduinodebug Lastturn=`cat /root/arduino_lec|cut -d ' ' -f 25` Lastarduinotime=`cat arduino_bits|cut -d ' ' -f1` #cat /root/arduino|grep 'WF'|tail -n1 > /root/arduino_wf #cat /dev/ttyUSB5|head -n 2|tail -n 1 > /root/arduino2Ĭat /dev/ttyUSB0|head -n 6|tail -n 3 > /root/arduino # not active for setting upĬat /root/arduino|grep 'LEC'|tail -n1 > /root/arduino_lecĬat /root/arduino|grep 'BITS'|tail -n1 > /root/arduino_bitsĬat /root/arduino|grep 'GAS'|tail -n1 > /root/arduino_gas #stty -F /dev/ttyUSB00 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -clocal Stty -F /dev/ttyUSB00 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -clocal The bit that deals with the arduino in full : #!/bin/bash What I posted before was just the meat of one of my scripts. If its running from cron, its a effectively a background process. Since Linux is a full multitasking environment, it can do that whilst its doing something else. I use bash scripts running from cron every minute and that then processes stuff to produce these graphs :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |