Renogy DCC50S Display

Hi, T6Jay,

I am struggling with response timeouts.


I think wiring is ok. worked long on it.
Can measure the 5V (7.5V) on the cable


Code:
Modbus_Resulst:ModbusMaster response timed out 0xE2

changed the cable.

maybe you did have similar issues?
 
Hi, T6Jay,

I am struggling with response timeouts.


I think wiring is ok. worked long on it.
Can measure the 5V (7.5V) on the cable


Code:
Modbus_Resulst:ModbusMaster response timed out 0xE2

changed the cable.

maybe you did have similar issues?
Where are you measuring 5V? Which cable? and why put (7.5V) in brackets? The Renogy cable should have 3 connections, A,B and 0V, did you forget the 0V?
I think you have to be more specific, and detailed in your questions if I stand a chance of helping. Can you post a complete detailed wiring diagram?

I have a USB/RS485 converter, and with this its possible to set up the laptop in place of the Renogy, and 'see' the modbus frame coming from the Arduino, and also to 'simulate' a reply, to check the arduino receives it. This setup answers the important questions;
1) is the Max485 sending out a message frame?
2) is the renogy sending any reply?
For me, the answer to question 1 was 'yes' but the PC let me see that the frame was missing a CRC byte, this led me to a bug in the modbus library. It's invaluable to be able to 'see' these messages when diagnosing a problem. I recommend you get a USB/RS484 converter, maybe someone here can advise which one. (Mine is a professional one and costs around £85)
 
Where are you measuring 5V? Which cable? and why put (7.5V) in brackets? The Renogy cable should have 3 connections, A,B and 0V, did you forget the 0V?
I think you have to be more specific, and detailed in your questions if I stand a chance of helping. Can you post a complete detailed wiring diagram?

I have a USB/RS485 converter, and with this its possible to set up the laptop in place of the Renogy, and 'see' the modbus frame coming from the Arduino, and also to 'simulate' a reply, to check the arduino receives it. This setup answers the important questions;
1) is the Max485 sending out a message frame?
2) is the renogy sending any reply?
For me, the answer to question 1 was 'yes' but the PC let me see that the frame was missing a CRC byte, this led me to a bug in the modbus library. It's invaluable to be able to 'see' these messages when diagnosing a problem. I recommend you get a USB/RS484 converter, maybe someone here can advise which one. (Mine is a professional one and costs around £85)


1) is the Max485 sending out a message frame? -> RX is blinking
LED on RTLRS485 is on, looks initialized to me
2) is the renogy sending any reply? That is unclear to me. No way of monitoring/debugging it at the moment and the modbus is new to me. so working on it.

Connection:
I am measuring the 5V - supposed to be output from Renogy. In fact there are 7.5V
On the input side I connect A and B as from Renogy diagram.
GND (0V) from Arduino. (you wrote: The Renogy cable should have 3 connections, A,B and 0V, did you forget the 0V?
will try with the 0V from Renogy
5V not connected

from Mega:

Max485​
Mega-Gpio​
DI​
1​
DE​
d2​
RE​
d2
RO​
3​


1612379625420.png
 
I think connection from Mega to Max485 is wrong, and should be;

DI - D1 (correct)
DE - D2 (this is usually mega D2, but could be any pin which must be defined in the code)
RE - D2 (see above)
RO - D0 (your table above says '3' I can't see how this is correct)

Also, if your renogy pin 1 is putting out 7.5V, this may be too much for the Mega, the RS485Max, and the A/B lines back to the renogy itself. I have mentioned it twice before, but I did NOT use the renogy 5V pin at all. For the purposes of getting things working, you can just use the Mega USB power for everything, later, you may want to get a buck converter to drop 12V to 5V.

On the 0V connection (renogy pin 4), I found the comms would not work at all without this connected to arduino 0V
 
Hi

ah I did miss this.

grounding renogy GND and Mega together.

On the 0V connection (renogy pin 4), I found the comms would not work at all without this connected to arduino 0V

will test

concerning:
RO - D0 (your table above says '3' I can't see how this is correct) :
you are right. I am using Hardware serial 1 on the Mega. Wiring was ok. proved by the led on the MAX485 I think.
on the Mega pins are for Serial1 actually 18 and 19.

I also tried with an ESP8266 tasmota. (Smart Meter interface) but sending is not working there with DE/RE. (have to get another Adapter) So I did stick to the Mega.

...just tested with GND from Mega and Renogy connected, still:
Modbus_Resulst:ModbusMaster response timed out 0xE2
 
Hi Jason,
rainy weekend ahead.
I am now starting with the basics ( still new to me)

- is the communication full - or half duplex on Renogy?
- my understanding is: Renogy will not send without beeing asked
- checking my mega leds when running, I only the RX led blinking, have to verify the sending function

Thanks for confirming

Thomas
 
1. The DCC50S comms is 2 wire half-duplex. As far as I know, 2-wire is half, 4 wire is full.
2. Correct, the DCC50S is a modbus Slave, it is silent unless it receives a command.
3. I can't understand why only the RX would blink, I would have thought a Message leaving the Mega would blink TX, and if a reply was recieved at the Mega, RX would then blink

If you have a USB/RS485 converter, why don't you download Modbus Slave Simulator and link your PC up to the mega, have a look what messages appear in ModbusSlave. If you can get this working, but don't understand the message frames, post it here and I can help.

EDIT: I note you may be using pin 18/19 (Serial1?) on the mega. Why not switch to pin 0/1 (Serial), and modify the code to suit. That way you will have the TX/RX lights on the Mega board to help you see what's happening.

EDIT2: I think on the Mega, the TX/RX leds are configurable, meaning they will not do anything until your code defines what they should do, sorry I don't have time to investigate this, google will help you.....
 
Last edited:
Thanks a lot


If you have a USB/RS485 converter, why don't you download Modbus Slave Simulator and link your PC up to the mega, have a look what messages appear in ModbusSlave. If you can get this working, but don't understand the message frames, post it here and I can help.
Hardware is on order, waiting...
 
If you have a USB/RS485 converter, why don't you download Modbus Slave Simulator and link your PC up to the mega, have a look what messages appear in ModbusSlave. If you can get this working, but don't understand the message frames, post it here and I can help.
Hi Jason,

HW arrived.
I wonder if you have a register test file for the slave test tool with registers populated? *.mbs

I am struggling with the registers, coils, etc.

Starting now with System info only

just using this code part to read the SI registers

Code:
  result = node.readHoldingRegisters(0x000, 16);

but looks like my knowledge is not good enough to debug and analyze it.

000CH
~ 0013H​
16​
R​
Product Model​
data format ASCII:RBC50D1S-G1​
-​
0014H​
4​
R​
software version​
00 01 03 00​
V1.3.0​
-​
an example:might be different for updated version​
0015H​
0016H​
4​
R​
hardware version​
00 01 03 00​
V1.3.0​
-​
high 8 bit 00 reserve is an example:might be different for updated version​
0017H​
0018H​
4​
R​
product's serial number​
13 04 00 01​
190400001​
-​
an example:might be different for updated version​
0019H​




Strangwise do not see any comms
 
You are wasting your time with modbusslave until you KNOW the mega is transmitting something (anything). Does your USB/485 dongle have a TX/RX led? does it flash? if no LED, can you connect one? As I said above;

I think on the Mega, the TX/RX leds are configurable, meaning they will not do anything until your code defines what they should do, sorry I don't have time to investigate this, google will help you...

EDIT: I found this on a forum, suggesting that if you use Serial0 for the comms, the TX/RX leds will work;
In the Mega, RX and TX LEDs are tied to the primary UART, Serial0. If you don't actually have anything dumping data to the TX0 (pin 0) or RX0 (pin 1) ports, it shouldn't have any lights. If you do, then something is seriously wrong.


Once you KNOW the mega is transmitting;

In ModbusSlave;
Go to Connection-Connect, somehow in here you set up the COM port to 9600 8N2 (8bit, NoParity, 2 stop bits) I can't try this myself as my free trial has expired
Go to Setup-Slave Definition, make sure the Slave ID is 1
Go to Display-Communication - this displays a window where any incoming messages will appear
Try to send a read request from the mega
Something should appear in the window, post it here, I will try to check it.
 
Last edited:
Hi

now some progress:

can see communication

an error.
Code:
18:55:07.469 -> Modbus_Result:>Modbus protocol illegal data address 0x2<


and some logs from SlaveSimulator
Code:
Tx:000027-01 83 01 80 F0
Tx:000029-01 83 01 80 F0
Rx:000030-01 03 01 00 00 23 05 EF
Rx:000032-01 03 01 00 00 23 05 EF
Rx:000034-01 03 01 00 00 23 05 EF
Rx:000036-01 03 01 00 00 23 05 EF
Tx:000039-01 83 02 C0 F1
Tx:000041-01 83 02 C0 F1
Rx:000042-01 03 01 00 00 23 05 EF
Tx:000045-01 83 02 C0 F1
Tx:000047-01 83 02 C0 F1
Tx:000049-01 83 02 C0 F1
Tx:000053-01 83 02 C0 F1
Tx:000059-01 83 02 C0 F1


could you confirm which addresses to be set in slave simulator to get a result for ?
000CH ~ 0013H 16 R Product model. Data format ASCII. - Product SKU.

Unclear to me..



I understood those are holdingRegisters ( looks like all in Renogy are holdingRegisters)

looking for SystemInfo I got this communication on the simulator:
Code:
Rx:000000-01 03 00 00 00 10 44 06
Tx:000001-01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A
Rx:000002-01 03 00 00 00 10 44 06
Tx:000003-01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A
Rx:000004-01 03 00 00 00 10 44 06



Thanks a lot for you help.

Owe you some beers already.

freezing outside here at the moment.

Cheers T
 
Code:
Rx:000002-01 03 00 00 00 10 44 06
Tx:000003-01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A
Well this is working right?
line 1: Your Mega Tx arrives as an Rx at node 01, fn code 03 (read HR), starting at 0000h, read 0010h registers, 2 byte CRC
line 2: MBslave replies Tx, repeating node 01, fn code 03, data length 20h bytes, then 32 bytes of data follow, then the 2 byte CRC

If you put some none zero data in MBSlave registers 0 to 15, it should appear in the Tx line.

So if you have set up the 9600, 8N1 correctly in the Mega, it should work with the DCC50s now.

For the system data, I poll 16 Holding Registers with (node.HoldingRegisters(0x0000, 16)
For the charging data, I poll 35 Holding Registers with (node.HoldingRegisters(0x0100, 35)

But you can see this in my code, so I'm not sure where your confusion lies?
 
Hi Jason,

thanks looks like getting closer. Will check further,....my hex and byte language skills are limitid.


just to check, you said,
So if you have set up the 9600, 8N1 correctly in the Mega, it should work with the DCC50s now
.

I thought it is 8N2?
 
Hi, just an idea I had. Tried with a master simulator to listen to the renogy as slave1 but did not get any RX from Renogy.
USB RS485 with only A and B connections.

Wondering if this would work in general?

Master simulator is showing timeout with 9600,8N2 and 9600,8N1

thx
 
Hi, just an idea I had. Tried with a master simulator to listen to the renogy as slave1 but did not get any RX from Renogy.
USB RS485 with only A and B connections.

Wondering if this would work in general?

Master simulator is showing timeout with 9600,8N2 and 9600,8N1

thx
Yes this worked for me, I found the 0V connection to be essential for use with arduino to DCC50S, but can't remember if this applies when linking PC to DCC50S, try it.

I used Modbus Master Simulator and you are correct with 8N2 for the Mega code, however these are the settings in my .mbp file;

1613075527058.png

I had a nagging feeling that I had problems with the parity/stop bits. If you find the above .mbp setting work for you then either a) the Arduino library does not implement the N2 correctly or b) Modbus poll does not implement the E1 correctly (Modbus poll has been around for ever so I find this hard to believe)

In conclusion, if 8N2 works in the mega, and 8E1 works in MBP, and we are aware of this, who cares? :)
 
really crazy with the serial settings 8n2 versus 8E1
I've found that arduino libraries are a great resource, but if you expect them to work 'out of the box', especially across platforms (uno, nano33ble, mega etc) you will be dissapointed. Also, the cores (firmware?) for the nano33ble have serious bugs in them, there's usually help to fix these on github etc, but you are sometimes in uncharted territory.
 
Back
Top