ascii image


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

Wednesday, 5 January 2011

1-wire, long runs and owfs

My 1-wire MicroLAN has a long run using BT cable (the stuff that comes into your house from the pole outside) it's not the most capable and CAT5 is better if you can use it, but mine runs through my flowerbeds into my greehouse, so it needed to be semi-amoured.

Long runs need slightly different 1-wire slew rates or you get lots of errors and devices drop off your LAN :(




Maxim Application Note 148 states:



Testing with long and short bus lines has shown that the optimum timings for all networks are as follows:

Pulldown Slew Rate: 1.37V/μs
Write One Low Time: 11μs
Data Sample Offset/Recovery: 10μs


So with owfs how do you do that with your Maxim USB dongle...?



Well the documentation isn't as extensive as you would like for things like this and the forums are quite cryptic. So i looked in the code on sourceforge link and found the code which changes the values.


So where you would start owfs with -u or --usb, try this;



--usb --altUSB --usb_flextime



This will give you a;

Pulldown Slew Rate: 1.37V/μs
Write One Low Time: 10μs
Data Sample Offset/Recovery: 8μs

 somewhat better than the default the dongle starts up with;

Pulldown Slew Rate: 0.83V/μs
Write One Low Time: 12μs
Data Sample Offset/Recovery: 7μs


 You can check your settings by doing;

# grep "" /var/1wire/bus.0/interface/settings/usb/*
/var/1wire/bus.0/interface/settings/usb/datasampleoffset:           8
/var/1wire/bus.0/interface/settings/usb/pulldownslewrate:           3
/var/1wire/bus.0/interface/settings/usb/writeonelowtime:          10


and check your errors by;

# grep -v " 0" /var/1wire/bus.0/interface/statistics/*err*
/var/1wire/bus.0/interface/statistics/errors:         515
/var/1wire/bus.0/interface/statistics/reset_errors:           1
/var/1wire/bus.0/interface/statistics/select_errors:         566


I  might graph mine in rrdtool to keep an eye on them.

No comments:

Post a comment