RS 232 shield won't transmit data unless I disconnect RX line (SOLVED)

Hello everyone,

I am working on a project which involves using an Arduino board to control a separate device which can be remotely operated using RS-232 communications. I’m doing this via an RS-232 communications shield.

The code that I’m trying to upload simply sends a sequence of commands to the device (a power supply) over and over. I’m not yet trying to read data from this device.

This uploading process goes fine, but the sequence of commands does not start getting sent after the upload is complete, which I tried to code it to do.

The communications shield has a pair of LED’s that indicate when data is being sent to and from it. After uploading my code, though, only one of the two LED’s flashes. Counterintuitively for me, the LED that flashes is labeled “RXD”. I have read on another forum that these LED’s are mislabeled, however. This LED flashes rhythmically about three times every second rather than flashing at the rate my code would suggest.

For some reason, my setup stays in this state of not transmitting data to the device but having the “RXD” LED flash on the RS-232 shield until I remove the wire that connects the Arduino’s RX port to it’s corresponding pin on the shield (I’m not mounting the shield directly onto my Arduino). After disconnecting these pins, the setup starts to behave as expected. It successfully controls the device and both of the communications shield’s LED’s flash according to the sequence in my code. I can then reconnect the wire I removed and the system still works fine. If I reset or reupload, though, it goes back to the first state. I would like the sequence of commands to start being sent immediately without this weird step of temporarily removing one of my connections.

Stuff I’m Using

-Arduino MEGA 2560.

-LinkSprite SHD_RS232_V2_AA (a link). I have two identical units of these and I have the same problem with both.

My Connections

*Mega * → Shield

GND GND
5V 5V
Pin 17 (TX2) Pin 1 (MTX)
Pin 16 (RX2) Pin 0 (MRX) (This is the connection I have to temporarily remove)

My Code

Here is the code I’m uploading minus some long comments, in case it can help:

void setup() {
  // start serial port at 9600 bps:
  Serial2.begin(9600);
  while (!Serial2) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  ///////////////////////////////////////////////////////////////
  establishContact();  // send a byte to establish contact until receiver responds
  ///////////////////////////////////////////////////////////////

  delay(500);

  
  
}

void loop() {
  // if we get a valid byte, read analog ins:
  if (Serial2.available() > 0) {
    // get incoming byte:
    delay(500);

    
    Serial2.println("ADR 14");
    delay(500);
    Serial2.println("RMT REM");
    delay(500);
    Serial2.println("OUT ON");
    delay(1000);
    Serial2.println("PV 2.5");
    delay(2000);
    Serial2.println("PV 0");
    delay(500);
    Serial2.println("OUT OFF");
    delay(500);
    Serial2.println("RMT LOC");
  
  }
}

void establishContact() {
  while (Serial2.available() <= 0) {
    Serial2.print('A');   // send a capital A
    delay(300);
  }
}

Also, in case it is relevant, I have successfully controlled this device using my PC and a terminal emulator without the device itself causing any issues.

I can’t help but suspect I’m being a noob making some obvious mistake here, but I can’t seem to figure it out, so I would appreciate any help people have.

Thank you very much in advance and please let me know if any more information can help.

Hello again,

I've actually managed to find and fix the issue I was having. I thank anyone who might have taken the time to ponder what the problem was, but I don't think I will need any more assistance.

I don't know how to lock or delete this thread.

Select Modify and add SOLVED to the first post.

Thanks you