Hi
There is now 75 hours my script is running. I've got:
-0 owread errors :-)
-4 out of range errors
Since today I've had a 8th device, a temp. sensor DS18S20 (the one that was 
disappearing some time ago)
in 75 hours it approx 23000x7readings (8 readings since today) and all 
succeed! 
So it's not bad at all. Anyway I have to continue because the problem can 
happen after several days.
Here are the out of range errors:

Tue Jun 7 16:44:43 CEST 2016 26.FFD8F1000000 NOT IN RANGE     135.398  
Counter =539
Wed Jun 8 04:34:07 CEST 2016 10.B6FAE5010800 NOT IN RANGE          85  
Counter =2791
Wed Jun 8 10:10:09 CEST 2016 26.FFD8F1000000 NOT IN RANGE     114.061  
Counter =4804
Wed Jun 8 18:14:00 CEST 2016 10.C825FA010800/temperature NOT IN RANGE          
85  Counter =1277 

Counter is meaningless, because the script have been restarted
26.FFD8F1000000 is humidity sensor (hobby-board)
10.B6FAE5010800 is the temp sensor inside the humidity sensor case
10.C825FA010800 is the outside temp sensor (added today)
link for hobby-board humidity sensor schematic
http://gcolin.hd.free.fr/SystemDescriptionGujan/docTech/Hobby%20board%20Humi
dity%20Temp%20Schematic.png

So I got the 85degree error and some impossible humidity values. I guess I 
can deal with that by software filtering if I have so few.
But again, caution, wait and see...
Here is a better version of my script

#!/bin/bash
# 8 Juin 2016 -- Script to check if any device disappear from 1wire bus

function CheckOneDevice1wire {
  # Function must be called with following parameters in that order
  # 1WireDeviceROM/ParameterToRead TemporaryFile LogFile Minimum Maximum 
Counter
  owread /uncached/$1 >$2 2>&1
  if [ $? -ne 0 ]; then
    echo -n `date` >> $3
    echo -n " $1 " >> $3
    echo -n "  Counter =$6 " >> $3
    cat $2  >> $3
  else
    VALUE=`cat $2`
    if [ `echo " $VALUE > $4 " | bc -l` -ne 1 ] || [ `echo " $VALUE < $5 " | 
bc -l` -ne 1 ]; then
      echo -n `date` >> $3
      echo -n " $1 NOT IN RANGE" >> $3
      cat $2  >> $3
      echo "  Counter =$6 " >> $3
    fi
  fi
}

COUNTER=0
while :
do
  ((COUNTER++))
  sleep 5  # check every 5 seconds
  # This part here under takes almost 5sec (due to access to 1wire bus on 7 
devices)
  CheckOneDevice1wire 10.B6FAE5010800/temperature /tmp/FileTmp1 
/tmp/LogCheck1wire 10 40 $COUNTER
  CheckOneDevice1wire 10.9702E6010800/temperature /tmp/FileTmp2 
/tmp/LogCheck1wire 10 40 $COUNTER
  CheckOneDevice1wire 3A.546302000000/sensed.BYTE /tmp/FileTmp3 
/tmp/LogCheck1wire -1 4 $COUNTER
  CheckOneDevice1wire 29.1C9E09000000/sensed.BYTE /tmp/FileTmp4 
/tmp/LogCheck1wire -1 256 $COUNTER
  CheckOneDevice1wire 28.4E3066020000/temperature /tmp/FileTmp5 
/tmp/LogCheck1wire 10 40 $COUNTER
  CheckOneDevice1wire 3A.B36002000000/sensed.BYTE /tmp/FileTmp6 
/tmp/LogCheck1wire -1 4 $COUNTER
  CheckOneDevice1wire 26.FFD8F1000000/humidity /tmp/FileTmp7 
/tmp/LogCheck1wire 20 99 $COUNTER
  CheckOneDevice1wire 10.C825FA010800/temperature /tmp/FileTmp8 
/tmp/LogCheck1wire 10 40 $COUNTER
  cat /tmp/FileTmp*
  echo " Counter =$COUNTER "
done


All the best
--
Guy



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to