ascii image


0010101000011111101001101010000010011000
1110101110110101011011111010010010001011
0001011100011101111001010011010010111110
0000010111101001100000110011101100001000
0011000000111010001111111000100110000001
1010110110000000000001011001000110001010
0101100010101100000100000010100100010101
0001011001011101100011000101110111101110
0110010100110100111101110100110011111101
0010111100110011010010110010101111011011
0100000000001001001011000010110100101001
1101000111100000110111011100110111000010
1111110001111111101101001010000111101100
0010110000100000111011000000101100010110
0101111000011100111010000000011111101111
0010010011110010011101001000110101000101
0000000001000100001111111100111010001111

Thursday 6 January 2011

owfs errors : BUS_select_subbranch

I've been getting errors on owfs for some time now, but after reading the doco and discovering the error stats, i thought i would look into it more.

$ grep -v " 0" /var/1wire/bus.0/interface/statistics/*error*
/var/1wire/bus.0/interface/statistics/errors:         359
/var/1wire/bus.0/interface/statistics/select_errors:         359

turning on debug on owfs with "--error_print 1 --error_level 5"

Then you get to see things like this:

Jan  6 14:00:37 ubuntu OWFS[32423]:   DEBUG: ow_select.c:BUS_select_subbranch(178) Selecting subbranch 1F 8F 67 05 00 00 00 B6
Jan  6 14:00:37 ubuntu OWFS[32423]:   DEBUG: ow_bus_data.c:BUS_send_data(38) Response doesn't match data sent

but this doesnt tell me what branch is at fault main/aux

So i edited the following file in the source code and recompiled


owfs-2.8p4/module/owlib/src/c/ow_select.c

on line 178 change this to:

LEVEL_DEBUG("Selecting subbranch %d on " SNformat,  bp->branch, SNvar(bp->sn));

Then you can get better debugging like this

# awk '/Selecting subbranch/{A=$0;getline;if(/Response doesn/){print A; print $0}}' /var/log/syslog
Jan  6 15:18:58 ubuntu OWFS[8357]:   DEBUG: ow_select.c:BUS_select_subbranch(178) Selecting subbranch 0 on 1F 8F 67 05 00 00 00 B6
Jan  6 15:18:58 ubuntu OWFS[8357]:   DEBUG: ow_bus_data.c:BUS_send_data(38) Response doesn't match data sent

0 = main

1 = aux

of which i get 10s if not 100s of lines

To tidy this up i used a nice awk one-liner

$ awk '/Selecting subbranch [01] on/{A=$0;getline;if(/Response doesn/){print substr(A,82)}}' /var/log/syslog | sort | uniq
 Selecting subbranch 0 on 1F 8F 67 05 00 00 00 B6
 Selecting subbranch 0 on 1F D6 65 05 00 00 00 8D
 Selecting subbranch 1 on 1F 8F 67 05 00 00 00 B6
 Selecting subbranch 1 on 1F D6 65 05 00 00 00 8D

So know i know which two couplers are playing up but unfortunately its both main and aux.

Now to sort that out...

No comments:

Post a Comment