Paul,
After thinking about this more....I believe it is more likely to screw up if
(at the same time) my script is running and another script / command is trying
to access 1wire data.
Observations
a/ I have noticed missing data in my trend files if I have logged into the
slug and have been reading data via the command prompt. ie When I check
calibrations of my devices I generally do a few manual "cat" commands. The
next day or so I see my trend files are missing some data around the same time
as I did my calibrations. The missing data is NOT the same device as I am
calibrating. My cat command could of been requested at the same time my script
is running.
b/ The last time it stopped, i was away on business and I think it could of
been the time I logged in via my web page and executed a cgi script. My web
front end shows trends however I also have a CGI file that just does a read of
the 1wire uncached data and reports "instantaneous data". (I ahve included cgi
file below)
So I am thinking that when the 1wire file systems get hit with two read
requests it is more likely to stop responding.
See the following CGI script output
http://img.photobucket.com/albums/v319/rjconway/web1.jpg
CGI FILE #####################################################################
#!/bin/bash
etime=$(/bin/date)
### Read 1wire data and convert into engineering units #ph was 2.6667##
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)
set -f
echo Content-type: text/plain
echo
echo " DEMAND REPORT"
echo -------------------------------------------
echo Report Date $etime
echo
echo
echo Aquaium Data
echo " pH =" $PH
echo " Conductivity =" $US uS
echo " Aquarium = "$TempAqua " DegC"
echo " Reservoir Temperature = "$TempRes DegC
echo " Litres Available = "$LITRES L
echo
echo Weather Data
echo " Outside Temperature =" $TempOut DegC
echo " House Temperature =" $TempAmb DegC
echo
echo --------------------------------------------
echo " Page 1/1"
###############################################################
----- Original Message -----
From: Paul Alfille
To: [email protected]
Sent: Monday, March 12, 2007 10:06 PM
Subject: Re: [Owfs-developers] Reading 1 wire data every minute with anNSLU2
(SLUG)
I use an "inittab" script -- it gets automatically restarted. (And a delay
loop).
Are you running your script against owserver using owshell? Can you tell what
the point of failure is? Is owserver still working after the "crash" -- can you
access from another machine. It would be nice to find the underlying problem.
Paul Alfille
On 3/12/07, Rob Conway <[EMAIL PROTECTED]> wrote:
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
------------------------------------------------------------------------------
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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