Closed DavidMKyle closed 8 months ago
I've grabbed a couple of Feather ESP32-S2 boards and they too appear to fail with the ds18b20 sensors on the onewire bus in the same way as the Feather ESP32-V2. I've not yet looked closely at the timings on these boards using a logic analyzer or scope.
Related to #5865, probably.
CircuitPython version
Code/REPL
The ESP32-V2 reset/presence waveform seems to show a healthy sensor on the bus with the following approximate timings:
DS18X20 Presence Pulse: 112us While a bit stretched, this all seems to be 'acceptable' per the DS18B20 spec
The RP2040 reset/presence waveform shows a healthy sensor on the bus with the following approximate timings:
print("="*20) print("Scanning bus...", end="") try:
Scan for sensors and grab the first one found.
except Exception as e: print("*** Error: No DS18x20 sensor found! Errorcode: ", e) pass
print("Devices:",devices) # for ESP32-V2 nothing found from scan @ line 73, see attached waveforms, need logic analyzer... for d in devices: print("ROM={}\tFamily=0x{:02x}".format(d.rom, d.family_code)) print(" - delaying 10s ...") time.sleep(10) # delay for clarity of captured waveforms
print("="20) ds18 = DS18X20(ow_bus, devices[0]) # get first sensor found (only one sensor was attached at a time to either board*)
Main loop to print the temperature every 3 seconds.
while True: print("Temperature: {0:0.3f}C".format(ds18.temperature)) time.sleep(3.0)
==================== <OneWireBus object at 0x3f80bc40>
Resetting bus...OK.
delaying 10s ...
Scanning bus...Devices: []
delaying 10s ...
Traceback (most recent call last): File "main.py", line 99, in
IndexError: index out of range
Code done running.