orders ds18b20 probe

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
wipity
Posts: 10
Joined: Sat Sep 09, 2017 4:35 pm

orders ds18b20 probe

Post by wipity » Wed Aug 01, 2018 11:24 am

Hi,
could someone, if possible, let me understand how micropython orders the probes when there are more than one?
with the scan() I can see the address of the probes and I can print the single probe read with a sort of list, but if I reboot the esp8266 or if I change one probe, for example the probe[2] still remain the probe[2] or can change position? I must read the address and assign the address to example 'probe2 = probe[2]' ? I hope I'm clear...:)

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

OneWire scan() list ordering

Post by pythoncoder » Thu Aug 02, 2018 7:59 am

I hope I'm understanding this query: my reading is that it's about the order of the list returned by the OneWire scan() command.

I have little knowledge of OneWire but I'd work on the assumption that the list order is arbitrary, especially if devices are changed. It's up to you to determine the correspondence between the 64 bit device ID and its physical location: you might use a dictionary indexed by location. If you change a temperature probe at a given location you'd then need to update that dict entry.
Peter Hinch
Index to my micropython libraries.

Post Reply