Closed robert-hh closed 2 years ago
For everyone reading this, @robert-hh just added the improvements to the pure-Python variant to a separate repository [1].
Apart from that, we have been able to unlock the native 1-Wire/DS18X20 variant coming from Genuine MicroPython through [2] and are also able to confirm this works on real hardware [3] using the respective native drivers [4].
[1] https://github.com/robert-hh/Onewire_DS18X20 [2] https://github.com/pycom/pycom-micropython-sigfox/pull/356 [3] https://community.hiveeyes.org/t/testing-the-custom-dragonfly-builds-on-pycom-devices/2746/6 [4] https://github.com/micropython/micropython/tree/master/drivers/onewire
The reason for a change was the observation, that with about 1 in 300 measurements were wrong, some of them obviously. So I made a few changes:
With change 1, readings with wrong crc are more rare now, about 1 in 15000, and enabling the crc check allows to detect them.
The crc8 implementation is a Python port of the code published here: http://lentz.com.au/blog/tag/crc-table-generator