Hello,
I try to use my Arduino UNO to send control data to a central heating unit. I can communicate with this unit via a maintenance programm (Window XP) obtained from the manufacturer. This communication is standard Serial 9600 baud which I can observe by means of a serial port sniffer (Device Monitor.exe).
When I send exact the same data to the heating unit by means of my Arduino UNO I can see the UNO sends the correct data. This I can observe by a serial port capture programm (Realterm).
But the heating unit does not recognise the data the UNO sends. When I try to observe the datastream by means of the serial port sniffer Device Monitor this sniffer too sees no data.
When I, while the UNO is busy sending the data to the heating unit, I simultanously start the serial capture programm Realterm the sniffer Device Monitor says "serial port opened by Realterm" and shows the data coming from the UNO.
It looks like the UNO opens the serial port in a way which is not understood by the heating unit nor by the sniffer programm.
My Arduino sketch:
#include <SoftwareSerial.h>
int R1[]= {8,0x02,0x52,0x05,0x06,0x01,0x0b,0x5b,0x03};
int n,x=0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
if (x==0) {
for (n=1; n<(R1[0]+1); n++) {
Serial.write (R1[n]); }
}
x=1;
}
I used my UNO in many other cases including serial port applications.
Can anyone help me please? Thanks!
What settings does the central heating unit expect for parity and stop bits ? Does it need the serial data to be terminated with a carriage return/line feed/either or both ?
When I, while the UNO is busy sending the data to the heating unit, I simultanously start the serial capture programm Realterm the sniffer Device Monitor says "serial port opened by Realterm" and shows the data coming from the UNO.
This sounds like you are trying to read the Arduino Serial output with 2 devices. This won't work.
#include <SoftwareSerial.h>
Why? You never create an instance.
void loop()
{
if (x==0) {
for (n=1; n<(R1[0]+1); n++) {
Serial.write (R1[n]); }
}
x=1;
}
Unreadable rubbish. Learn to indent your code properly, AND to put the } on its own line.
The TTL serial port on the Arduino is generally not compatible with RS232. You will need to add a device to your Arduino if you want to communicate via RS232.
This sounds like you are trying to read the Arduino Serial output with 2 devices. This won't work.
Yes you can, I have no problems doing it.
Mark
The original Arduino UNO programm is much longer, I brought this back to its bare minimum to show my problem. Sorry, I forgot to skip the include <SoftwareSerial.h>.
Unfortunately there is no information available how to communicate with the heating device. But others, including me, discovered a lot of details about this i.e. the communication is Serial, 9600 baud, 8 bit data, no parity, 1 stopbit; no end-of-line or whatoever. I found also how to generate the checkbit in a message and which start and stopbytes are required.
I can succesfully send data to the heating unit by means of the RealTerm software. I use its possibility to send a file. This file contains exact the same data as in int R1[] in my sketch. In this case succesfully means the heating unit accepts this data or several other files from the RealTerm programm and reacts as expected. It looks to me the Arduino sketch opens the serial communication in a peculiar way.
You haven't said how the central heating unit (CHU) is connected to the PC and to the Arduino.
If you are using serial connection (TTL or RS232) is it possible the CHU is relying on DTR or RTS or other control lines which the Arduino may not be managing?
...R
holmes4:
This sounds like you are trying to read the Arduino Serial output with 2 devices. This won't work.
Yes you can, I have no problems doing it.
Mark
Well, at the very least it could make the output unreliable. What definitely won't work is reading the Arduino serial output with 2 Windows programs on the same PC.
Well, at the very least it could make the output unreliable.
Not at all as your sending the same signal to 2 independent devices, remember there's no flow control or an thing. Take a look at the Wireless/SD shield in the products section this is how it works.
@OP do you have any links to a data sheet that would help a great deal. A photo of the "cable" and the socket on the CHU would help.
Mark
Seniorvos:
I can succesfully send data to the heating unit by means of the RealTerm software. I use its possibility to send a file. This file contains exact the same data as in int R1[] in my sketch. In this case succesfully means the heating unit accepts this data or several other files from the RealTerm programm and reacts as expected. It looks to me the Arduino sketch opens the serial communication in a peculiar way.
No, it opens it in a normal way, but as someone pointed out, it is TTL level; not RS232. Some RS232 devices will accept TTL level signals, but certainly not all of them
When you use RealTerm to communicate with it, are you using a USB->RS232 adapter? If so, it is likely to be RS232, and not TTL. You can use a MAX232 chip to generate true RS232 from 5V TTL serial.
Thanks for helping me. The picture is taken while the manufacterers programm is communicating with the Heating unit. Upper-left is the cable to the CHU. It has only 4 wires: +5V, 0V, and RX/TX. Right-below is the USB/TTL converter. In the middle is the RS232-TTL converer (MAX232A). This communication works fine.
When I try the UNO communicate with the CHU I connect the RX/TX wires from the UNO to the MAX232 (marked with small black and red dots below the MAX232). The signals of the UNO show up at the cable to the CHU (which I can see on my scope). The CHU does not respond as I described earlier while it does so when I send the same data by means of the RealTerm programm. When I parrallel to the output from the MAX232 connect a serial cable to COM1 of the PC the sniffer (DeviceMonitor.exe) sees no data until I also start the RealTerm programm. Then the sniffer says: "port opened" and shows the data from the UNO. The RealTerm Programm on its own always sees the UNO data.
I hope this additional information helps.
It's almost impossible to make sense of a photo like that. Can you draw a diagram of the wiring and post a photo of the drawing?
Can you write a short demo sketch that just sends data through the Max232 without bothering with anything else. Does that data show on your scope? No point trying anything else until you get that to work.
...R
Surpise! Yesterday night I replaced the MAX232A with a brand new one. This solved my problem. It appeared to be no Arduino problem at all.
Thanks for the support!
