sophienyaa / NodeRenogy

Utility to retrieve data from Renogy solar controllers and publish it to MQTT, written in NodeJS
MIT License
60 stars 13 forks source link

Are you getting correct temperature readings? #7

Closed wrybread closed 1 year ago

wrybread commented 1 year ago

I'm trying to make a version of this for ESP32/Arduino, and I'm not able to get correct temperature readings. It's probably an error in the way I'm processing the register, but I'm wondering if anyone can confirm that they do indeed return the correct temperature?

I have the external temp sensor now.

My code is here if anyone happens to be interested in helping me port the section of this code to C:

https://raw.githubusercontent.com/wrybread/ESP32ArduinoRenogy/main/renology_rs232.ino

The way it's handled here in NodeRenogy is:

//Register 0x103 - Battery/Controller Temperature - 3 //0x103 returns two bytes, one for battery and one for controller temp in c const buf = Buffer.alloc(2) buf.writeInt16BE(rawData[3]); this.battT = buf[0]; this.controlT = buf[1];

nstufflebeam commented 1 year ago

I get the temperatures but they are reversed. Looking at the modbus documentation for Renogy Rover the controller temp is in the first half of the byte

sophienyaa commented 1 year ago

This issue should've been resolved be this PR: https://github.com/sophienyaa/NodeRenogy/pull/9, which has now been merged.