Problem reading Serial

I’m new to Arduino, and i cant get this problem solved.

I have a device (Lutron HT-315) that send data via RS-232 serial, and want to read the data with an Arduino with a “RS232 to TTL DTE” shield.

The data send have a RS232 FORMAT : 9600, N, 8, 1 and send 16 digits.

I can read the data from the device (HT-315) in the computer with a USB-to-Serial Adapter, but not in the Arduino.

To test if the shield was fine i use a second Arduino with a “RS232 to TTL DCE” and can send data between Arduinos just fine.

I use this code from a tutorial to test the data between Arduinos

int incomingByte = 0;	// for incoming serial data

void setup() {
	Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
}

void loop() {

	// reply only when you receive data:
	if (Serial.available() > 0) {
		// read the incoming byte:
		incomingByte = Serial.read();

		// say what you got:
		Serial.print("I received: ");
		Serial.println(incomingByte, DEC);
	}
}

One thing i notice is that Serial.available() is not triggering with the HT-315.

Any idea what i can do?

You need to post a link to the datasheet for your HT-315 and for the "RS232 to TTL DTE" shield.

Also a photo of a drawing showing how you have everything connected. See this Simple Image Guide

And have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

This is the RS232 to TTL schematic: Link to PDF
And the user guide: User Guide

This is a photo of two Arduinos (One MEGA and a NANO) using the serial to share data:

Using the sketch from the tutorial i see this in the serial monitor:

I received: H
I received: e
I received: l
I received: l
I received: o

So the serial communication is working
This is the Arduino with the DTE:

And the Arduino with the HT-315:

I can´t get any data from the device.

This is the device connected to the computer:

And the data in the serial monitor:

The RS232-to-TTL come with jumpers for the handshake. I tried all the combinations in the user guide.
No availabre data in any of the three combinations.

The shield have two pins for RTS and CTS.
Maybe i have to connect that to the Arduino and read/send a signal?
I googled "arduino handshaking" but i haven't found a tutorial about RTS and CTS.

Don’t forget you can’t share the rs232 connection that is shared with the USB, if you are reading/ writing via it

The user guide mentions jumpers to select the RTS CTS mode. How have you set your jumpers?

As far as I can see you should have NO jumpers connected if you are not using handshaking. That would be the normal way to communicate between two Arduinos.

Your photos are very nice but they are not a substitute for a drawing that shows how things are connected. I can't figure out connections from a photograph when I am not familiar with the equipment.

And you have not posted a link to the important piece of hardware - the Lutron HT-315.

Also, post your Arduino program.

...R

The user guide mentions jumpers to select the RTS CTS mode. How have you set your jumpers?

Yes, i have try the three positions: 1. No RTS / CTS signals, 2. RTS / CTS loopback, 3. RTS / CTS HW handshake

Your photos are very nice but they are not a substitute for a drawing that shows how things are connected. I can't figure out connections from a photograph when I am not familiar with the equipment.

I can't find the rs232-to-ttl in Fritzing, but the connection are very simple:

RS232->Arduino

VCC -> 5V
GND->GND
RX->RX
TX->TX

(I know that Arduino->Arduino usually is TX->RX, but the module works when connecting RX->RX)

And you have not posted a link to the important piece of hardware - the Lutron HT-315.

I can´t find the schematics. The closets is the manual

Also, post your Arduino program.

The programs are very simple:

For test the connection i have an Arduino with a RS232-to-TTL Female with this simple program

void setup() {
Serial.begin(9600);
Serial.println("ARDUINO SENDER: ONLINE");
}

void loop() {
Serial.print("Hello");
delay(1000);
}

And to receive with the RS232-to-TTL Male DTE:

char incomingByte = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
        Serial.println("ARDUINO RECEIVER: ONLINE");
}


void loop() {               
        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();

                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte);     
        }
}

Using the connection RX-RX with the module, i get this in the receiver serial monitor:

I received: H
I received: e
I received: l
I received: l
I received: o

(If i try TX-RX, i got no response)

The next step i did was unplug the Arduino Sender, and connect the HT-315. I got no response from the receiver. It looks like serial.available() is not reading anything from the HT-315. But the HT-315 works fine if i connect it to the computer using the RS232-to-usb Adapter.

I have read that CTS and RTS don't have a library and that you have to "manually" turn on/off. I'm trying that at this moment... but without results.

Opochtli:
I can't find the rs232-to-ttl in Fritzing, but the connection are very simple:

We don't like Fritzing here - most Fritzing diagrams are useless. I asked you to post a photo of a drawing - just use pencil and paper.

I can´t find the schematics. The closets is the manual

I didn't want schematics. The user manual is what I wanted.
[/quote]

The details on page 10 of the user manual suggest that the connections are anything but obvious. Which doubles the importance of making a clear pencil drawing showing how everything is connected.

What are the functions of Pins 4, 2 and 5 of a 9 way RS232 D connector?

...R