I am using an NSLU2 (Unslung 6.8), I currently use a simple bash script to 
gather 8 off 1wire variables and do some calc's before storing the data in 
trend files.  I have it scheduled in crontab to run every 1 minute.  What 
happens is that about ~3 times a month the NSLU2 grinds to a halt.  It seems 
that my script somehow screws up and I just fill up the slug with scripts never 
finishing.  I think its because it cannot access the 1wire file system to read 
the data...

Is this the best way to handle scheduling of scripts, using a 1 minute crontab 
entry ?
I was thinking to just use a loop in a single script and just sleep for 60 
seconds...that way if it does screw up at least the NSLU2 will continue to run. 
 I could have another script testing a "PID entry" to make sure its still 
running and if not just restart it automatically.

I know its slightly off topic however was keen to see if other NSLU2 -1wire 
users have implemented the same type of continuous monitoring and what their 
maximum uptime was.  The SLUG is lightly loaded and dedicated for data 
monitoring with owfs, NTP, thhtpd, and rrdtool....I want to move onto relay 
output control  thus trying to sort this problem out for reliability before I 
move into closed loop control.

owfs version as seen from #ipkg list_installed
owfs - 2.6p1-3 - 1-Wire filesystem (http://owfs.sf.net)
owlib - 2.6p1-3 - 1-wire library
fuse-utils - 2.6.0-pre2-3 - Fuse


################################################################
#!/bin/bash
###  Force Simultaneous 1wire conversion ###
echo 1 >/tmp/1wire/simultaneous/voltage
echo 1 >/tmp/1wire/simultaneous/temperature

### Read 1wire data and convert into engineering units ##
PH=$(/opt/bin/awk '{printf "%4.2f\n",((($0-1)/1.6)+5.5)}' 
/tmp/1wire/20.B71F05000000/volt.A)
US=$(/opt/bin/awk '{printf "%5.1f\n",($0*100)}' 
/tmp/1wire/20.B71F05000000/volt.B)
TempAqua=$(/opt/bin/awk '{printf "%3.1f\n",((($0-1)*5)+20)}' 
/tmp/1wire/20.B71F05000000/volt.C)
LITRES=$(/opt/bin/awk '{printf "%3.1f\n",(($0-2.900)*60)}' 
/tmp/1wire/20.952A05000000/volt.D)
TempOut=$(/opt/bin/awk '{printf "%3.1f\n",($0)}' 
/tmp/1wire/28.11BF97000000/temperature)
TempAmb=$(/opt/bin/awk '{printf "%3.1f\n",($0)}' 
/tmp/1wire/28.D70598000000/temperature)
TempRes=$(/opt/bin/awk '{printf "%3.1f\n",($0)}' 
/tmp/1wire/28.A6EE97000000/temperature)
Accum_flow=$(/opt/bin/awk '{printf "%d\n",($0/4100)}' 
/tmp/1wire/uncached/1D.EBEF0900000034/counters.A)

### Calculations based upon Data ###
C12=$(/opt/bin/awk -v PH="$PH" '{printf "%3.1f\n",((3*$0)*(10^(7-PH)))}' 
/public/kh_value)
Todayflow=$(/opt/bin/awk -v AF="$Accum_flow" '{printf "%d\n",(AF-$0)}' 
/public/lastflow.txt)
Weekflow=$(/opt/bin/awk -v AF="$Accum_flow" '{printf "%d\n",(AF-$0)}' 
/public/weekflow.txt)

#################################################################

cheers rob -Australia
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to