Controlling a Giant LED Dot Matrix Sign through RS-485

I'm doing this for my YouTube Channel Gear Down For What If you can help me out, ill give you a shoutout! Thanks in advance!

The Board is an Arduino MEGA

The sign is a huge LED matrix array that is 7 x 96, and in the documentation says that it is J1708 serial protocol, but from what I understand that is baiscally RS-485, which is good, because I have a RS-485 Converter

So for the connections, I have the sign powered, and it boots up. I have the RS-485 converter powered, the light comes on, the serial "A" terminal is connected to the serial "A" terminal on the sign, the same with the "B" Terminals. On the Arduino to converter side I have DE and RE connected together and going back to Pin 3, Then DI on the converter is going back to TX1

Documentation for the sign Can be found here

So, according to the documentation, I have to send a "M" style message with the characters to display, and then confirm the selection with a "T" Trigger style message, and, I know the program is doing this in a really crude way, but when I do a test with the serial monitor, it seems like everything should be sending correctly.

I just don't understand where I'm going wrong.

#define SerialTxControl 3   //RS485 Direction control

#define RS485Transmit    HIGH
#define RS485Receive     LOW

#define Pin13LED         13
const int MSGL = 13;
const int MSGL2 = 6;
byte Byte[MSGL];
byte Trigger[MSGL2];


void setup()   /****** SETUP: RUNS ONCE ******/
{

 
Byte[0] = 194;
Byte[1] = 255;
Byte[2] = 245;
Byte[3] = 4; //Bytes of data sent
Byte[4] = 'M';
Byte[5] = 1; // Sign Number 0 will brodcast to all
Byte[6] = 1; // 
Byte[7] = 0; // Horizontal position
Byte[8] = 'G';
Byte[9] = 'D';
Byte[10] = 'F';
Byte[11] = 'W';

Trigger[0] = 194;
Trigger[1] = 255;
Trigger[2] = 245;
Trigger[3] = 1; //Byte Counts of Following Data
Trigger[4] = 'T';// Message Type


  // Start the built-in serial port, probably to Serial Monitor
  Serial.begin(9600);
  Serial1.begin(9600);
  pinMode(Pin13LED, OUTPUT);   
  pinMode(SerialTxControl, OUTPUT);    
  
  digitalWrite(SerialTxControl, RS485Transmit);  // Init Transceiver   
  
}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
  
  byte chk = 0;
for ( int i=0; i<MSGL; i++)  { //length = 19 (22-02 = 20 - 1)
    chk += Byte[i];    
}
Byte[12] = chk;

//sum=10+C1+00+00+00+3E+90+32+00+21+16+10+1E+11+01+33+C1+0A+CD+19 = 042C
//discard accumulated carries; we get 2C = 0010 1100
//take 2's complemet code : 1101 0011 + 1 = D4 
Serial.println("WriteM");
for ( int i=0; i<MSGL; i++)  { //length = 19 (22-02 = 20 - 1)
    Serial1.write(Byte[i]);
    Serial.println(Byte[i]);
}

for ( int i=0; i<MSGL; i++)  { //length = 19 (22-02 = 20 - 1)
    chk += Byte[i];    
}
Trigger[5] = chk;

Serial.println("WriteT");
for ( int i=0; i<MSGL2; i++)  { //length = 19 (22-02 = 20 - 1)
    Serial1.write(Trigger[i]);
    Serial.println(Trigger[i]);
}
delay(2000);
 
}//--(end main loop )---

[code/]

is there any response from the device?

in situations such as this it is a good idea to monitor the communication protocol using a RS485 dongle (or a second arduino with RS485 shield) - this could help to indicate any errors

looking at your code after you calculate the first checksum you don't appear to zero the checksum before calculating the second

is there any response from the device?

There cannot be any because OP has constantly activate the bus driver on the Arduino side so the matrix sign won't be able to send anything.

I ramped my code a little bit, now I wait for serial activity to go away before writing anything, when the sign boots up, I get this message

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E0 0 0 0 0 0 FE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

But it doesn't give any response to messages that I send to it

#define SerialTxControl 3   //RS485 Direction control

#define RS485Transmit    HIGH
#define RS485Receive     LOW

#define Pin13LED         13
const int MSGL = 13;
const int MSGL2 = 6;
byte Byte[MSGL];
byte Trigger[MSGL2];
unsigned long Timer = 0;


void setup()   /****** SETUP: RUNS ONCE ******/
{

 
Byte[0] = 195;
Byte[1] = 255;
Byte[2] = 245;
Byte[3] = 8; //Bytes of data sent
Byte[4] = 'M';
Byte[5] = 0; // Sign Number 0 will brodcast to all
Byte[6] = 1; // 
Byte[7] = 0; // Horizontal position
Byte[8] = 'G';
Byte[9] = 'D';
Byte[10] = 'F';
Byte[11] = 'W';

Trigger[0] = 195;
Trigger[1] = 255;
Trigger[2] = 245;
Trigger[3] = 1; //Byte Counts of Following Data
Trigger[4] = 'T';// Message Type


  // Start the built-in serial port, probably to Serial Monitor
  Serial.begin(9600);
  Serial1.begin(9600);
  pinMode(Pin13LED, OUTPUT);   
  pinMode(SerialTxControl, OUTPUT);    
  
  digitalWrite(SerialTxControl, RS485Transmit);  // Init Transceiver   
  
}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
  digitalWrite(SerialTxControl, RS485Receive);
  if(Serial1.available() > 0) {
    Timer = millis();
  }
  if (millis() - Timer > 5000) {
    TransmitMessage();
    Timer = millis();
  }
  
  
  ReadSerial2();

 


 
 
}//--(end main loop )---
void ReadSerial2() {
  digitalWrite(SerialTxControl, RS485Receive);  // Init Transceiver   

    // Declarations
   unsigned char sBuffer[100];
  // digitalWrite(RSE, HIGH);

    // Check for RS485 data
   int nBytes = Serial1.available();
   if(nBytes > 0)
   {
       int nCount = Serial1.readBytes(sBuffer, nBytes);
       for(int nIndex = 0; nIndex < nCount; nIndex++)
       {
           Serial.print(sBuffer[nIndex], HEX);
           Serial.print(" ");
       }// end for
   } //end if
}// end loop

void TransmitMessage(){
  
 digitalWrite(SerialTxControl, RS485Transmit);  // Init Transceiver   
  
  byte chk = 0;
for ( int i=0; i<(MSGL-1); i++)  { //length = 19 (22-02 = 20 - 1)
    chk += Byte[i];    
}
Byte[12] = chk;

//sum=10+C1+00+00+00+3E+90+32+00+21+16+10+1E+11+01+33+C1+0A+CD+19 = 042C
//discard accumulated carries; we get 2C = 0010 1100
//take 2's complemet code : 1101 0011 + 1 = D4 
Serial.println("WriteM");
for ( int i=0; i<MSGL; i++)  { //length = 19 (22-02 = 20 - 1)
    Serial1.write(Byte[i]);
    Serial.println(Byte[i]);
}

chk = 0;
for ( int i=0; i<(MSGL2-1); i++)  { //length = 19 (22-02 = 20 - 1)
    chk += Byte[i];    
}
Trigger[5] = chk;

Serial.println("WriteT");
for ( int i=0; i<MSGL2; i++)  { //length = 19 (22-02 = 20 - 1)
    Serial1.write(Trigger[i]);
    Serial.println(Trigger[i]);
}
}
[code/]

The manual says that the communications uses serial ASCII, and I'm still trying to figure out if I should be using serial.print or serial.write to get that format.

This looks like a signal from a floating bus. Is that bus in a defined state (using pull-up/-down resistors for A and B)? The number of resistors on that RS-485 converter would lead to assume it should have these in place. Do you have schematics for that board?

According to your wiring description RO is not connected. Please post a wiring diagram (may be hand drawn) of your setup.

pylon:
This looks like a signal from a floating bus. Is that bus in a defined state (using pull-up/-down resistors for A and B)? The number of resistors on that RS-485 converter would lead to assume it should have these in place. Do you have schematics for that board?

According to your wiring description RO is not connected. Please post a wiring diagram (may be hand drawn) of your setup.

Initially RO was not connected. I connected it to RX1 to answer the question of am I receiving data

I do have resistors on the line, as shown in the documentation below, I tried using 4.7K resistors like they show but I stopped receiving data completely when I did that, so I went with 10K, and skipped the capacitors.

I found some really odd documentation that suggests that I invert Arduino's TX line with a NOT gate and connect that to DE, then connect Arduino's TX1 line to RE and DI, then connect Arduino's RX1 to RO. I tried this but it didn't seem to change anything.

UPDATE:
Just noticed that one of the IC's on the RS485 converter has a suspicious "bubble" coming out of the top of it. I'm assuming I blew it up in my last project that I never got working. I tested this by turning the baud rate down to "1" and placing an LED on each side of the converter, the led on the Arduino side flashes many times but the output only flashes once. I ordered a new converter.