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

Question - Is it possible to specify the modbus address? #6

Open SP410 opened 2 years ago

SP410 commented 2 years ago

I found out that my controller lives at address 17; not 1 which is typical for renogy controllers.

kamkelsey commented 1 year ago

did you ever get anywhere with this? i have a renogy wanderer with address 255

sophienyaa commented 1 year ago

adding modbusClient.setId(17) before the read might resolve this. If you're able to test and let me know I can add this as an enhancement.

whuang0705 commented 1 year ago

where, which file, should this modbusClient.setId(17) be added?

sophienyaa commented 1 year ago

Between lines 159 and 160 of renogy.js. I've not tested this so you may need to make additional changes.

oBorks commented 4 months ago

I have the same issue of needing to change the address to 16 for our Wanderer. I tried adding the line to renogy.js, but when I tried to run it I got an error that modbusClient.setId is not a function.

CzarDestructo commented 2 months ago

I was able to get my Rover 40A controller working on address 16 by adding the following between lines 187 and 188:

        try {
            modbusClient.setTimeout(500);
            modbusClient.setID(16); 
            await modbusClient.connectRTUBuffered(args.serialport, { baudRate: args.baudrate });
            logger.info('Connected to controller!');
        }

Very happy to have my controller working, thanks for all your hard work on this repo :)

ColbyBurkett commented 2 months ago

I've been using this with my Rover 60A & RS232 for a few months now... works perfectly. Much appreciated. I also have a Rover 40 Li w/RS232 that I'll be spinning up... I expect no issues.

Now, I am purchasing a Renogy 12V 30A DC to DC Charger w/RS485 port. I am grateful to those blazing the trail on the RS485 side.... hope it won't be too painful.