Closed raintonr closed 3 years ago
Well this is embarrassing...
After much more investigation discovered my Pro Mini was rebooting due to bad voltage supply. Despite what the specs say, looks like the Loxone 1-Wire extension does not supply enough juice to keep an Arduino Mini Pro running in a stable state. Enough to boot and run for a while, but not enough to stop it seemingly randomly rebooting after a while.
The other emulated modules on the bus are working fine because they are fed from a separate supply due to having MQ135 sensors connected that I knew would need more current that the 1-Wire extension could supply, and hence didn't see any such issues.
Sorry for the bad report.
At least we can leave this here as a cautionary tale for those who follow ;)
EDIT: I thought this was due to trying to emulate multiple slaves in the same µC but after changing the code to emulate just a single DS18B20 the problem persists so it must be something fundamental in that code.
Loxone 1-Wire extension as master. Polling every 30 seconds. There are 6 real DS2438 sensors and 2 Arduino DS2438 slaves on this bus and they all work just fine.
Slave code (below) running on Pro Mini 328P 5V 16Mhz constantly crashes after just a few minutes.
I wanted to use an I2C SHT31 sensor presended as 4 DS18B20 devices: 1 temp, 1 humidity, 2 for delta values (want to report delta change in either value over a set period in the future).
After creating a load of code to sample the SHT31, calculate deltas and such it kept crashing. So I threw it all away and just tried the dummy code below with a single DS18B20 device. Super simple but this still crashes after just a few minutes.
Watching readings come in the delta value gets to only -41 or so before going back to -50. Crash and restart of the Pro Mini is the only way that could happen.
This code is fundamentally no different from the
DS18B20_asInterface.ino
example so can't see what's wrong.Any ideas what's why this wouldn't work?