Closed rnestler closed 3 years ago
When initialization of the DS18B20 fails, the code still panics slightly_smiling_face The sensor instances in the resources should probably be inside options.
Hmm. Do we want to support this use case? I mean we won't have any temperature data at all when this happens. The other changes are when there is a random glitch at runtime, no?
Hmm. Do we want to support this use case? I mean we won't have any temperature data at all when this happens.
You still have the voltage and the SHT temperature... If we still get measurement messages, but without water temperature, we know exactly where the problem is (sensor disconnected or broken). If we don't get any message at all, it's hard to diagnose...
You still have the voltage and the SHT temperature... If we still get measurement messages, but without water temperature, we know exactly where the problem is (sensor disconnected or broken). If we don't get any message at all, it's hard to diagnose...
True. Also I already implemented it.
I don't think we should make the SHT optional as well, but I can replace the sht.wakeup(&mut delay).expect()
call with just logging the error, which should give additional panic resistance.
Cool, works great now!
The only thing I'm missing is a line in the serial log indicating that the DS18B20 couldn't be initialized. Should be very simple to add, right?
The only thing I'm missing is a line in the serial log indicating that the DS18B20 couldn't be initialized. Should be very simple to add, right?
Yes. Fixed. Maybe I should have actually tested with hardware, could have saved some iterations on this PR :see_no_evil:
Fixes #68