1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.56k stars 785 forks source link

DS18B20 not working properly #1118

Closed benoit-cty closed 2 years ago

benoit-cty commented 2 years ago

Before submitting a problem please check the troubleshooting section https://docs.openmqttgateway.com/upload/troubleshoot.html

Describe the bug The discovery of the sensor work fine, but value are never send. The default value DS1820_INTERVAL_SEC 60 don't work, even after 3 minutes, changing to DS1820_INTERVAL_SEC 30 make it work. 32 work, 33 not. So we are at the 32.7 seconds limit because of a 16 bit int. More info on the error here : https://forum.arduino.cc/t/unsigned-long-multiplication/108567

When it worked, I saw that the temp are not in the right field:

{
    "tempc": 63.14,
    "tempf": 17.3,
    "type": "DS18B20",
    "res": "10bit\n",
    "addr": "0x283d057997020371"
}

To Reproduce Steps to reproduce the behavior:

  1. Fresh install with #define ZsensorDS1820 "DS1820" uncommented

Expected behavior The sensor value are send on the bus, with Celsius in tempc .

Environment (please complete the following information):

benoit-cty commented 2 years ago

PR : https://github.com/1technophile/OpenMQTTGateway/pull/1121