Thanks for your help on this one Matthias,

ERROR TRAP

if [ -z "$TEMPtest" -o "$TEMPtest" -gt 50 -o "$TEMPtest" -lt 5 ]; then

I did a couple of tests and it seems that -gt and -lt will still complain 
and not execute the "if" on the basis there is not an integer to compare 
against even though the first -z maybe true.   What is the easiest way to 
break up the -z test and the gt/lt ?.  I suppose I need two if lines however 
this mutliplied by the 8 parameters I am reading from the A/D's makes my 
script long and messy.

A better solution maybe to somehow use the ruturn value of the owread to 
somehow set the value to "u".  As when it does have a read error it sends 
"Data error on 20.B71F05000000/volt.C" to the stdout...which I assume in my 
case is the log nohup.out

TempAqua=$(/opt/bin/owread $OWSERVER 20.B71F05000000/volt.C | /opt/bin/awk 
'{printf "%3.1f\n",((($0-1)*5)+20)}')


SOLENOIDS
You are correct the diode only helps when the power is turned off.  I have 
placed a large ferrite core around the leads going to the solenoid.  I may 
try and fit a 1000 uf capacitor close the solenoids.  I only energise the 
solenoids a couple of times a week and I think it depends on which value is 
being scanned at that exact moment where the error gets induced.


----- Original Message ----- 
From: "Matthias Urlichs" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, June 23, 2007 5:55 PM
Subject: Re: [Owfs-developers] Trying to trap 1wire read errors abash 
script-NSLU2


> Hi,
>
> Rob Conway:
>> if [ $TEMPtest -gt 50 ] || [ $TEMPtest -lt 5 ]; then
>
> You forgot quoting. If there's an error which results in nothing beibng
> reported, you need to explicitly catch that, otherwise the thing will
> complain.
>
> Correct:
>
>> if [ -z "$TEMPtest" -o "$TEMPtest" -gt 50 -o "$TEMPtest" -lt 5 ]; then
>
> NB: Instead of fixed limits, I would read twice and check whether the
> values are close to each other.
>
>> Does anybody have any other idea's on how to trap a read error within
>> my bash script.  The values are fed into a trend package and I average
>> three readings every 5 minutes and store to an rrd database.  When I
>> get a read error it produces a spike in my trend.
>>
> You can configure RRD to ignore that.
>
> As for the solenoids, I'd run their power supply through an inductor
> coil that blocks the spikes, and/or put a capacitor in front of them to
> buffer the initial power surge. That surge is a sharp decrease of
> voltage, so a diode cannot help you.
>
> -- 
> Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   | 
> [EMAIL PROTECTED]
> Disclaimer: The quote was selected randomly. Really. | 
> http://smurf.noris.de
> - -
> Be both a speaker of words and a doer of deeds.
> -- Homer
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to