Closed stromnet closed 3 years ago
Looks like a useful addition, thanks.
Thanks!
@stromnet Johan, thanks doe this contribution. I use OW in some of my systems -- and with up to a dozen DS18B20s on each. This has been rock solid for four years now, and I am keen that these timing adjustments haven't broken OW for me. I am abroad and away from my systems for the next 3 weeks. I will review these changes and test this out, then raise an issue if needed.
@joysfera Petr, you might be interested in this as well. I know from #1995 that you were still working on OW + DS18B20s a year ago.
@joysfera Petr, you might be interested in this as well. I know from #1995 that you were still working on OW + DS18B20s a year ago.
@TerryE thank you for the heads up but it's been two years since I rewrote my whole project (2600 LOC) from Lua to C. The final straw that forced me to give farewell to Lua after five years was the Lua source level incompatibility between ESP8266 and ESP32. In C (Arduino core) it is 100% "portable" and I can develop and run single source on both ESP (now possibily on four - including S2 and C3). My OneWire issues got resolved along that way as well.
Always good with more testers, but I'm quite confident you will not notice any issues. The defaults are the same values as before, so the only potential impact I foresee would be the additional cycles to fetch the values from RAM instead of using constants. But when we're talking busylooping several (or even tens of) microseconds, that microscopic difference is most likely not an issue. Not sure about how many cycles a typical instruction is on the ESP8266, but my guess is that we're talking nanoseconds.
I have tested it with DS18B20's as well, although only a few on the same bus.
dev
branch rather than for therelease
branch.docs/*
.This PR has two features:
While working with a AVR based 1-wire slave device (based on the https://github.com/stromnet/moat-owslave project), I had some timeouts & CRC issues when communicating with it from the NodeMCU, that I never had when using a PC-based LinkUSB interface with owfs. After some debugging it was revealed that the LinkUSB had much longer delays between each bit (or if it was byte? Don't remember now). Since my custom slave was a bit too slow to react in some cases, this caused issues. By adding
ow.timings
method, it is now possible to adjust these timings a bit, if necessary.Note: I have tested these commits on top of 3.0-release_20201107 and not really dev, since I did not have time to verify the changes in newer releases at the moment. But nothing have happened in this module since that release, so should work equally fine on dev.