Go Down

Topic: 1-Wire, DS18B20... How do I search the bus? (Read 22 times) previous topic - next topic

omnitronic

I've been banging my head over this problem for two days now.  I finally wised up and decided to check the forums. :o

My problem manifested itself only when I recompiled the OneWire.cpp source code.  I finally figured out that if I linked to the supplied object file, everything worked fine.  I guess the problem must have gotten fixed at some point, and the OneWire.o file updated in the library, but not the source.

How can we get the source code updated in the library so others won't experience this?  I sure would like to have those two days back!

crunch

Has there been a long term fix for this issue at this time?    

I have a bus of 10 DS18S20s   and the arduino still gets confused and goes into a loop in the same way mentioned my the original poster.

When I put 4 on the same bus it seems to work okay, when I put 6 on the same bus it works for a bit then goes into a loop,   when I put 10 on a bus the whole thing just goes into the loop.

I changed the OneWire.CPP file as advised above and made sure the object file was removed and recompiled.  

I cant split the bus up into 2 by 5 sensor buses because at least one of the sensor loops has  already been installed during construction and its got more than 10 sensors on it already in difficult to re-wire locations.

Waffle

crunch, I've re-coded the search function from the ground-up. Hopefully this fixes the bug once and for all. You can download this new version of the library here: http://waffle.netlogistics.com.au/arduino/OneWire8.zip

Let me know how it goes. If it works I'll update the playground article.

crunch

Waffle,

This works better, but not perfectly.    Now I can have 6 sensors on the bus  if I swap a new one in it will be detected.  
Code: [Select]

No more addresses.
Unique ID=2C:EF:4:1:8:0:

Unique ID=52:F9:39:1:8:0:

Unique ID=41:7F:39:1:8:0:

Unique ID=5D:F9:39:1:8:0:

Unique ID=CB:B:5:1:8:0:

Unique ID=FB:E8:38:1:8:0:

No more addresses.



If I insert a 7th sensor  

Code: [Select]
No more addresses.
Unique ID=2C:EF:4:1:8:0:

Unique ID=52:F9:39:1:8:0:

Unique ID=41:7F:39:1:8:0:

Unique ID=5D:F9:39:1:8:0:

Unique ID=CB:B:5:1:8:0:

Unique ID=1B:0:0:0:0:2:   <--- Point I put the new sensor onto the bus

Unique ID=1B:0:0:0:0:2:

Unique ID=1B:0:0:0:0:2:

Unique ID=1B:0:0:0:0:2:


The above will just continue in an infinite loop.

Is there any more information I can provide for you to help?

Waffle

#19
Jun 27, 2009, 08:58 am Last Edit: Jun 27, 2009, 09:00 am by Waffle Reason: 1
Can you give me the seven addresses (all eight bytes of each) of the devices when placed together that cause the loop problem? Then I'll be able to test the search algorithm on that combination of addresses to work out where the problem is.

Go Up