I bit stuck and was hoping for some help
I have DS18B20 probe with 1 m cable…when I connect it to a PI that has just 1-wire interface enabled on pin4 (default), it talks and recognises it as normal. The moment I specify additional pins on 1-wire interface, it is gone. I cannot see it and the addresses in /sys/bus/w1/devices just keep on changing with no probe displaying…same wiring, same connection. If I am doing something wrong (i.e. enabling other 1-wire overlay) how do I get multiple 1-wire device connected.
It seems that I might have resolved the issue so I am posting a reply in case someone else runs into it. As it seems there were two issues going on, being:
Non 1-Wire sensors on 1-Wire pin
It seems that DHT11 sensor is actually not 1-wire sensor…so if you enable multiple 1wire pins, it can get confused with it (mine did). Therefore, place DHT11 sensors on a GPIO pin that does not have 1-wire enabled and call it form the code. It seems to work.
Definition of the 1-Wire Pins
In the same time if you are modifying /boot/config.txt file with more than one GPIO pins as follows:
dtoverlay=w1-gpio,gpiopin=X, you cannot add more than one gpiopin=X parameters on a single master like this:
dtoverlay=w1-gpio,gpiopin=X,gpiopin=Y,gpiopin=Z
For each pin you need to specify its own overlay as the last gpiopin=Z change persist and it ignores previous ones. So the correct way isto create multiple masters as follows:
Great question and that was my understanding as well. However, when it comes to defininig these in scripts, everything I found and tried indicates that the last GPIOPIN value overwrites the previous one for the same bus. Would love if someone has a better solution fir this.
You’re exactly right, 1-Wire can handle multiple devices, I’m not sure how you’d have to modify the script in order to suit this, but one of the most difficult parts of using multiple devices on the same line is ensuring that your pull-up resistor is at an appropriate value. I found an interesting discussion on it on a forum I’ve linked below.