CRC err DS18B20 OneWire ESP32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
SirN Check
Posts: 10
Joined: Fri Dec 15, 2017 11:11 am

CRC err DS18B20 OneWire ESP32

Post by SirN Check » Thu Oct 24, 2019 12:12 pm

Anyone else getting CRC errors using latest version: esp32spiram-20191023-v1.11-497-gf301170c7.bin ?
Versions <= 'v1.11-481-' works fine!

#I always use protection during transfer:
state = machine.disable_irq()
# talk onewire
machine.enable_irq(state)

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: CRC err DS18B20 OneWire ESP32

Post by kevinkk525 » Thu Oct 24, 2019 1:33 pm

I reported this problem a while ago: https://github.com/micropython/micropython/issues/4647
Basically it seems that not every build suffers from it and that it may be due to where certain code is located on the device..

For now it looks like we have to check every version if onewire library works correctly and if not, choose a different daily build. Haven't tested what happens if I build it myself as I'm only working with esp8266 at the moment.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: CRC err DS18B20 OneWire ESP32

Post by jimmo » Sat Oct 26, 2019 10:32 am

I wonder if the RMT hardware can be used to improve the onewire implementation? I did a quick search and there seems to be some people using it successfully for onewire.

From https://github.com/DavidAntliff/esp32-owb
"The original implementation used CPU delays to construct the 1-Wire read/write timeslots however this proved to be too unreliable. A second method, using the ESP32's RMT peripheral, results in very accurate read/write timeslots and more reliable operation."

See https://github.com/micropython/micropython/pull/5184 for the (output-only for now) start of the RMT implementation for ESP32.

Post Reply