So instead, I am now using a GPIO pin (3.3V) as the source of power for the four sensors. When my application detects the sensors have vanished I switch OFF the GPIO pin to power down the sensors for 20 seconds and then switch the GPIO pin back on. The sensors re-appear.
I am having the same problem, since a bit more than one year,, and after a long search, this is a great solution, or at least a great workaround! (I needed a solution that can be performed remotely.) Thanks a lot!
In my case, the problem arises irregularly, about once every 2 or 3 weeks. I found that whenever it occurred, a power consumer (ice box) hanging close in the same power circuit had turned off very shortly before (e.g., 1 second). Sudo reboot does not (or very rarely) help, but shutdown with repowering the Pi helps. Plugging off the sensors (plug with all three wires) from the Pi and replugging them after a while also seems to help (tried only once so far).
Logfiles tell that "the maximum number of 64 sensors has been reached", and after that, a series of wrong sensor addresses appears in the log, one after the other every few seconds.
To advance this issue, which seems pretty common and barely understood, I would like to ask these questions:
- Where does the error come from? It looks as if quick power fluctuations can provoke it (though not reliably, of course). Does it come via power supply (then a power filter might help), or is it radiation from the power grid into the 1-wire-cable? (Then changing cables might help)
- Where is the error stored, once it hase arisen? If a reboot does not help, but repowering does, then which structures loose their memory only with power off but not with rebooting? Is the error stored in the Pi, or in the sensors?
- In this workaround, interrupting 3.3V supply for the sensors helps. But how should this reset the bus master? I rather guess that some memory within the sensors is (helpfully) lost, which solves the problem.
- I think, if actually the bus master would be reset by powering off the sensors, then plugging off (or grounding) the datapin should have the same effect.
I would so much like to understand what is going on, not just work around it.