Renogy DCC50S Display

I have to integrate this to my display. my other RS485 device is a epever and it run at 115200, I do not know if I can mix two connections with different speed on the same wires???
 
t6jay
i'm not a professional programmer, could you refine my code?
I'm flattered to be asked, but I'm learning C/C++ and arduino myself. I can write functional code, but it's far from optimised or refined. I think you would be better asking on the arduino forums for this kind of thing.

My professional programming is mostly done with Structured Text in a Codesys or similar environment it's very different to C.

Having said that, If you want to send me what you've done, I have a look, if I can suggest any improvements I will.
 
Last edited:
I have to integrate this to my display. my other RS485 device is a epever and it run at 115200, I do not know if I can mix two connections with different speed on the same wires???
I have never seen a system that uses two different baud rates on one bus. But I can't see why it shouldn't work, you will need to stop and restart the serial every time you want to flip devices.

Are you not better buying another RS485MAX (they're only £2!) and having a second channel? What arduino are you using?
 
Arduino mega all serial port are use.
Rs485 epever mppt, co2 module, display him. I can made more with soft serial.
 
if anyone is interested, here is my first python code to interact with the renogy smart battery
Python:
class RenogySmartBattery(minimalmodbus.Instrument):
    def __init__(self, portname="/dev/ttyUSB0", slaveaddress=48, baudrate=9600, timeout=0.5):
        minimalmodbus.Instrument.__init__(self, portname, slaveaddress)
        self.serial.baudrate = baudrate
        self.serial.timeout = timeout

    def amps(self):
        r = self.read_register(5042)
        return r / 100.0 if r < 61440 else (r - 65535) / 100.0

    def volts(self):
        return self.read_register(5043) / 10.0

    def capacity(self):
        r = self.read_registers(5044, 2)
        return ( r[0] << 15 | (r[1] >> 1) ) * 0.002

    def max_capacity(self):
        r = self.read_registers(5046, 2)
        return ( r[0] << 15 | (r[1] >> 1) ) * 0.002

    def percentage(self):
        return self.capacity() / self.max_capacity() * 100

    def state(self):
        a = self.amps()
        if a < 0: return "DISCHARGING"
        elif a > 0: return "CHARGING"
        return "IDLE"

btw, I was able to connect my renogy dc-2-dc to the renogy smart battery "LINK" port, and then connect the renogy USB cable to the battery UP port. I can then talk to both devices without using the renogy hub
 
Cheers thanks @busbus and @chris roy for the register mappings!
capture between the batt and btoo, at 9600 n81

my battery node is 48 0x30

13:14:06.752 -> test2
13:14:10.080 -> 30, 3, 13, 88, 0, 11, 5, 49, 30, 3, 22, 0, 4, 0, 24, 0, 24, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13:14:10.455 -> 0, 0, 0, 0, C1, E4, 30, 3, 13, 99, 0, 5, 55, 43, 30, 3, A, 0, 3, 0, E6, 0, E6, 0, E6, 0, E6, 9D, 52, 30, 3, 13, B2, 0, 6, 65, 4A, 30, 3, C, 0,
13:14:10.877 -> 0, 0, 91, 0, 1, 86, 38, 0, 1, 86, 50, 5E, CD, 30, 3, 13, F0, 0, 4, 44, 9F, 30, 3, 8, 0, 0, 0, 0, 0, E, 0, A, 8F, EF, 30, 3, 14, A, 0, 2, E5,
13:14:11.298 -> D8, 30, 3, 4, 30, 30, 31, 34, C1, B8,
30, 3, 13, 88, 0, 11, 5, 49, 30, 3, 22, 0, 4, 0, 24, 0, 24, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13:14:19.313 -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C1, E4, 30, 3, 13, 99, 0, 5, 55, 43, 30, 3, A, 0, 3, 0, E6, 0, E6, 0, E6, 0, E6, 9D, 52, 30, 3,
13:14:19.735 -> 13, B2, 0, 6, 65, 4A, 30, 3, C, 0, 0, 0, 91, 0, 1, 86, 38, 0, 1, 86, 50, 5E, CD, 30, 3, 13, F0, 0, 4, 44, 9F, 30, 3, 8, 0, 0, 0, 0, 0, E, 0,
13:14:20.110 -> A, 8F, EF, 30, 3, 14, A, 0, 2, E5, D8, 30, 3, 4, 30, 30, 31, 34, C1, B8,
Interesting, my battery node seems to be responding at node 0xf7... I have 2 LFPs connected in parallel with UP to LINK, and UP to RS485 tty (Also DCC50S in the remaining LINK port @ node 1). Don't seem able to assign a node / unit id in order to differentiate the batteries. Will have another go tomorrow and scan the address range again.

I'm using the same 9600 n81 configuration, and DCC50S is responging fine, and I'm getting a response from 0xf7, but it seems to be garbled (sometimes an extra 0xff byte tagged on or the unit id becomes 0xff, all sorts...). I've tried removing the nest of LINK/UP to be a direct connection, but to no avail.

Cheers, awesome to see some progress on the battery mappings!
 
Don't seem able to assign a node / unit id in order to differentiate the batteries.
One thing I noticed is that my IDs changed after I used the BT-2 bluetooth adapter with the new android app. After that my dcdc50 id changed so I suspect the app assigned reassigned individual ids. I had to scan, too, in order to find the remapped ids (I only have one battery though).

So if you have the hardware, connect both batteries and the dcdc50 to the bluetooth hub + bt2 and use the app once.
 
One thing I noticed is that my IDs changed after I used the BT-2 bluetooth adapter with the new android app. After that my dcdc50 id changed so I suspect the app assigned reassigned individual ids. I had to scan, too, in order to find the remapped ids (I only have one battery though).

So if you have the hardware, connect both batteries and the dcdc50 to the bluetooth hub + bt2 and use the app once.
Sadly I have no bluetooth hardware to snoop on. For the moment I have just attached one battery to the modbus network, and just using the SOC from there (Should be automatically balanced from the batteries BMS no?)

My build thus far:SKgbyjd.jpg

More here:
Thanks so much guys, saved me so much monitor head butting for those mappings. Cheers
 
previous script gives a error when amps is high.

float batt_amps() {
uint16_t result;
float x;
Serial3.begin(9600, SERIAL_8N2);
node.begin(node_batt1, Serial3);
result = node.readHoldingRegisters(0x13B2, 0x1);
if (result == node.ku8MBSuccess)
{
if (node.getResponseBuffer(0x00) < 32768) { // 1000 0000 0000 0000
x = (node.getResponseBuffer(0x00)) / 100.00f;
}
else {
x = (node.getResponseBuffer(0x00) - 65535) / 100.00f; // 1111 1111 1111 1111
}
}
return x;
}
 
Integrating my renogy batteries into my monitoring system is my next milestone. What are you using for an RS485 cable? I have a generic one and used a modbus scanner but didn't find anything.
 
Integrating my renogy batteries into my monitoring system is my next milestone. What are you using for an RS485 cable? I have a generic one and used a modbus scanner but didn't find anything.
What do you mean by a scanner?

There will be no comms traffic on the bus until 'you' request it, by sending a valid Modbus Read or Write frame, then the battery should send a response of some kind.
 
This is what I was using:


Watching it work it looks like it iterates through each slave address and looks for a response. Is there a better way to go about it?
Surely that's like throwing darts in the dark.

You need the comms specification (9600,8,N,1 or whatever) a node address, and a valid address to read. One of the other contributors on here will have these for a battery I'm sure. (I only have DCC50S which is Node 1 9600,8,n,2)
 
Surely that's like throwing darts in the dark.

You need the comms specification (9600,8,N,1 or whatever) a node address, and a valid address to read. One of the other contributors on here will have these for a battery I'm sure. (I only have DCC50S which is Node 1 9600,8,n,2)

Yeah - I specified baudrate but when I tested nodes 1-10 with @busbus code I got absolutely nothing. Then I tested it with the scanner (which took an hour) and got nothing. Which is leading me to suspect that the cable I have doesn't work with Renogy's system (do they have a specific pinout?)

I'm going to test it with the Renogy Firmware update tool this afternoon. If that doesn't work I'll know it is the cable!

I also have a DCC50S so I could test that with node 1 and see if it works.
 
I figured it out. If you have the battery in the pylon_debug mode it won't respond to the modbus requests. I have a program I'm working on but I've found a lot of resources for anyone else.


 
I just got one of the newer Bluetooth smart batteries ($1100 for 200Ah was hard to turn down), and am pleased that the protocol seems the same! It seems like those have a BLE to RS485 module in them, so you send the command to the "RX" characteristic and get a reply from the "TX" characteristic. I've got Arduino code working now that displays all the battery info on a little OLED, and will post it once I clean it up a bit more. I assume it would work the same if you had one of the BT-2 devices plugged into a non-bluetooth battery but obviously haven't tested that.

Before stumbling upon this thread I tried email Renogy support about getting the register mapping and was told not that it was a safety issue but "the information of modbus address assignment table of smart battery belongs to the intellectual property and R&D encrypted file of each company. It is not available to the public, so please understand."
 
Back
Top