Hi all,
probably I've found a funny bug in the owserver in relation to USB
Bus-Master and longer cables. This was mentioned before in 
http://old.nabble.com/Re%3A-How-to-enable-statistics--p33202282.html this 
posting very fuzzy, but now I was able to reproduce it in my lab:

1. Install OWFS 2.8p13 or p14 on an ARM9 400MHz 
2. Connect one DS9490R USB Bus-Master
3. To provoke the error to appear fast, use an extra long cable of about
200m
   (28nF, e.g. SFTP, see simulation tool below) 
4. Connect one DS18B20 to the cable, with Vcc powered to +5V
5. Start owserver with "-uall"
6. Start a client polling for the temp 2 times a second, eg owread or an
owcapi application

This works fine for about 2 to 20 minutes. If cable is shorter, 2.8p14 is
used or other quirks are done (see remarks below) it can last for days and
weeks.
But suddenly it don't return the temp and don't show an error, even the
device is not shown in owdir anymore

One workaround:
Restart the owserver, than it works again for 2 - 20 minutes until it
suddenly don't return any temp.

Another workaround by keeping the owserver-process alive:
Truncate the cable to about 170m (25nF), than it works again for about 2 to
20 minutes.
But suddenly it return an errno=22, the device disappears again in owdir.
Truncate the cable again to 50m (8nF), this now works forever, I've checked
at least for several month :-)

Some remarks:
- To simulate the long cables and the different length I made a
capacity-cascade of 8 parallel
  capacities (0.1nF, 0.22nF, 0.47nF, 0.82nF, 1.5nF, 3.3nF, 6.8nF, 15nF and
an 8-pol DIP switch
  between pins OWDATA and OWRETURN) this allows simulating cable length of
1m to 200m.
- Beside the simulation, exactly the same behavior appears every week, at a
real installation
  with a real cable of about 100m.
- It have nothing to do with star- or other bad network topology, even 
  a single cable with a single device at the end is enough to reproduce it
- Disconnecting the cable and wait for minutes, or shorting the device don't
solve the problem,
  only restarting the owserver or truncate the cable.
- This is not dependent from dedicated pieces of hardware, it is
reproducible with several DS9490R,
  several DS18B20, several ARMs and several types of cable.
- In case several devices are connected to the bus, they all get the problem
exactly at the same time, 
  or came back when reducing the capacity/restart owserver together
- I've tested also networks via I2C DS2482-100, this works fine since month,
no problem here. 
  I've not tested serial bus masters
- It looks like the communication capabilities of the USB bus-master is
reduced in stages:
  0. After owserver restart it is able to drive 28nF at extreme.
      The statistics counter grow slowly, except the 3 search_errors which
stay at 0
  1. Error stage:  Now it can only drive up to 25nF, but the change is not
smooth, it is an abrupt state
      change. This is stable for a while, no drifting, I've tested this with
my cascade, reproducible for 
      meanwhile dozens of tests: NOK >= 25.2nF, OK <= 25nF.
      Now the statistics counter stays at the last value, they don't grow
further, even if the
      capacity is above 25nF. 
  2. Error stage: Now it can only drive 8nF, again no smooth transition, it
is an abrupt state change.
      This seems to be stable forever, NOK >= 8.2nF, OK <= 8nF.
      Now the statistics counter stays, except the 3 search_errors they grow
fast if the capacity 
      is above 8nF.
- The steps to reproduce, mentioned above, are aimed to see the error as
fast as possible. There a 
  several methods to delay the problem appearance, which is helpful when
needing the OW-network,
  but none of them really solve it:
  - Use shorter cables from beginning onwards, start with 100m cable will
cause the problem to
    appear after 3 to 14 days. Maybe below an dedicated length the problem
completely disappear, 
    but I need this length
  - Using 100 Ohm serial resistors after the bus-master, before the cable
will shift the problem
    further by about 50%
  - Use parasitic power of the DS18B20 with Vcc to GND and remove the +5V
from the cable. 
    This will reduce the capacity and therefore allows longer cable or
delays the error appearance. 
  - Daily restart the owserver via cron-job  :-(
-- 
View this message in context: 
http://old.nabble.com/Problems-in-owserver-with-USB-and-longer-cables-tp33213551p33213551.html
Sent from the OWFS - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to