I have a problem with my EmonTX3, (HW3.45). I connected a ds18b20, but it can’t find it. Temp enabled via serial port (t0 1), and can read the address of the ds18b20 (0x10, 0x1B, 0x2A, 0x88, 0x00, 0x08, 0x00, 0xAE) with an adruino, and this ino can see too: emontx2/emontx_lowpower_temperature.ino at master · openenergymonitor/emontx2 · GitHub
That first byte in the UID (0x10) tells you it’s a DS18S20 rather than a DS18B20 (I fixed the title of this thread for you). A DS18B20 has 0x28 in that byte.
Anything built on the standard Arduino Dallas temp sensors stuff supports a bunch of similar sensors:
Stuff using EmonLibCM requires it to be precisely a DS18B20 (i.e. 0x28):
If you’re handy with C programming and the tools, I don’t think it would be too difficult to add in support for both.
Hello @Zippair would you happy to try making a modification to the code to see if you can get it to work? It may just be a matter of removing the line @dBC highlighted above? But you would also need to compile and upload the code. The device type was likely hard coded here for DS18B20SIG to avoid other potential incompatibilities… It might be more hassle than it’s worth for you to explore this so feel free if you prefer to switch the sensors for DS18B20’s.
I dont know enough about the different type of one wire sensor variants and implications of expanding the available list to comment at this point so it would need to a bit of investigation and testing to see if this is something that could be expanded.
Hello @TrystanLea. If i have to remove this line: if (deviceAddress[0] == DS18B20SIG) from EmonLibCM, probably i can do it. Compiling and uploading will work, i hope.
Is it needed to modify the Dallas temperature.cpp?
I removed the line from EmonLibCM, and it works! I need to calibrate it, because is shows 2,9C when the temp is about 22C, but i can calibrate it in emonHub config.
Many thanks the quick support, gentlemans!
My two-penn’orth is the DS18B20 is the only one stocked by Megni, the OEM Shop, and it’s the only one available for me to test. If someone wants to send me a few samples of each that they want to see the library made to work with, I’m sure @TrystanLea will forward them. Until then, the library documentation makes it quite clear that ONLY the DS18B20 is catered for.
And due to various pressures and commitments, I won’t be able to do anything any time soon.
@Robert.Wall no expectation to incorporate this soon, just interested to see if @Zippair can get this working satisfactorily for his requirements locally on his system. If we know it works and what the modifications are then we can consider longer term it’s inclusion as an option or just forward people to this thread if this requirement crops up again
We know @Zippair 's sensor works with sketches using the Arduino Dallas library so that’s probably a good place to turn. It appears they’ve done a thorough job of highlighting all the differences (just grep for DS18S20MODEL to find all the places they’ve needed to treat it differently).