leodesigner / powmr_comm

PowMr Inverter serial communication protocol reverse engineering
MIT License
50 stars 6 forks source link

Problem with parallel model #7

Open damihighlander opened 9 months ago

damihighlander commented 9 months ago

Greetings, a big thumbs up for this project. I have an issue with inverter model POW-HVM5.5K-48V-LIP (with parallel) - according to powmr website it also supports rs232 wifi dongle however for some reason i cannot get any response from modbus protocol, i checked the rs232 connections with an multimeter - it seems to have good connection - baudrate is set to 2400 n 8 1bit, Modbus ID Setting (setting 25) is default set to 001, i used ModScan32 for protocol testing (address 0001, id 1 lenght 100) - still nothing. Could you guide me in reading registers from this device? I have some experience in reading data and sending commands via mqtt to VMIII and MAX II hybrid inverters (if someone needs help with these particular models) powmr seems to be diffrent atleast in rs232 modbus. Regards

leodesigner commented 9 months ago

Do you have the original wifi plug? It would be much easier to sniff communication between wifi plug and your inverter. This way you will find out protocol and Modbus id as well. At least I used this approach for my inverter.

You might want to explore this documentation for different protocols here: https://github.com/jblance/mpp-solar/tree/master/docs/protocols

damihighlander commented 9 months ago

Hello - thank you for the answer, no ufortunately i dont have original wifi adapter, however in the mean time i managed to get some data from the inverter. It looks like my model works on modbus ID: 1, 9600 Baudrate - i found a working list of registers from a diffrent model -> https://github.com/syssi/esphome-pipsolar/files/9657007/Protocolo_SMG.II.5KPRS232.V1.0.pdf, it seems most of these values are correct, i didnt check them all yet but having my experience with EASUN models im pretty sure POWMR engineers keep the protocol standards aswell. For now im trying to remotely set working mode (SBU,SUB,SOL). I have a question - did you manage to change inverter working mode via modbus on your device?

leodesigner commented 9 months ago

Yes, changing modes works as well. But keep in mind that you need to receive a valid confirmation via modbus (error codes) in order to make sure that command passed correctly into inverter.

The rs232 communication is quite unreliable due inverter RF noise. Especially during battery charging.

damihighlander commented 9 months ago

Changing output priority worked for me, thank you for the information about the error codes, it's gonna be useful - my goal is to setup a daily "task" for a pc to switch from night battery mode (SBU) to either SUB or SOL. I'm not sure what is the difference between these two, it looks like SUB only pushes pv power into charging and nothing into ac output, while i want it to work in hybrid mode

leodesigner commented 8 months ago

SUB/SBU mode switch sometimes works only when you first charge battery to predefined value (see inverter instruction). I also change inverter modes on specific predefined time.

damihighlander commented 8 months ago

Im using nodered dashboard to visualize everything + the scheduler works pretty good right now - only few errors so far. Im stuck on changing battery charging current parameter, it looks like either modbus register for this particular parameter is diffrent than in the manual i linked above or maybe my input string value is not correct, i know this may be a broad question but maybe you could help me find an error - when changing work mode i simply connect to modbus and send a simple string (0,1,2,3) on address 301 - this works fine, however for some reason changing "Maximum charging current" wont work

Modbus specs from pdf file: Maximum charging current, Unit: 0.1A, Data format: Uint, Initial Address: 332, Number of registers: 1, Read: R/W

and this is my error from debug node: msg : error "Error: Quantity should be less or equal to register payload array length: 2 Addr: 332 Q: 1" what should an "inject payload" should look like here?

leodesigner commented 8 months ago

Make sure that you have a correct byte ordering for two bytes integer value (big endian, little endian) https://en.wikipedia.org/wiki/Endianness

You need to look closer what is the Node-Red function expects. Also some inverters accept only predefined values like 10a, 20a etc.

Try to read this modbus register first and figure out what you get in response.