Problem with Putty

I have several Arduinos talking to each other with APC220 rf modules. I wanted to monitor the talk on my PC. I got a serial<->USB device with the APC220s. I connected it to the PC and it was recognized as Com 7. By using the terminal in Arduino, I could see all the communication. I loaded Putty but nothing gets displayed on Com 7. I have tried every option allowed for serial in Putty's configuration menu
but none seem to work. Does anyone have an idea why?

Jim

I don't know why but maybe this will help...

My test sketch...

void setup( void )
{
  Serial.begin( 9600 );
}

void loop( void )
{
  Serial.println( F( "tick" ) );
  delay( 1000 );
}

PuTTY displays a configuration dialog when I run it. A picture of the dialog is attached as 01.jpg. I changed Serial line to COM14 and Speed to 9600 then clicked Open and it worked. There are more serial parameters on the last configuration dialog (19.jpg) that appear to be relevant. If you believe any of the other configuration dialogs may be important let me know.

01.jpg

19.jpg

Confirm if you had swap the TX and RX pins. The TX of the usb converter must connect to RX of the board and TX to the RX.
Also check the baud if it is correct

I think I need to make my setup clearer. setup is


| |
| Arduino | -->rf
| w/ rf module| -------------- --------------- -----------------
----------------- | | | | | |
------------------ | rf |-------|USB<>serial|---------| PC |
| | | module 3 | | | | |
| Arduino | -->rf --------------- --------------- -----------------

w/ rf module
There is no wired link between the Arduinos and the PC. The 3rd rf module is directly connected to the usb/serial adapter which plugs into the pc's usb port and becomes Com7. Using the IDE's terminal displays what the rf module 3 receives from the two arduinos when com7 is selected as the IDE's port. Putty does not! What are the differences between the IDE's terminal and Putty?

Jim

Configuration settings! You don't have all the settings configured correctly so Putty isn't wanting to work. The communications works, Putty doesn't.

alfiesty:
I think I need to make my setup clearer. setup is

Thank you. That helps.

What are the differences between the IDE's terminal and Putty?

There are two possibilities: line settings and flow control.

The line settings are: baud rate, stop bits, parity. Serial Monitor uses the baud rate you've selected, one stop bit, and no parity.

Flow control is some combination of software and hardware (or nothing). Serial Monitor uses no software flow control so that cannot be the issue. Hardware flow control consists of the DTR / DTS lines and the RTS / CTS lines. I don't know for certain but I suspect Serial Monitor asserts both DTR and CTS. In my version of PuTTY, the flow control setting is on the Connection / Serial page of the configuration dialog. Try setting it to RTS/CTS or DSR/DTR.

I have the same problem as the thread starter.

I have a Arduino Mega 2560 which I uploaded this program to:

int counter = 0;

void setup() {
  Serial1.begin(9600);
  digitalWrite(5, HIGH);
}

void loop() {
  Serial1.print("Counting ");
  Serial1.println(counter++);
  delay(500);
}

Using the Arduino IDE's serial monitor on the COM port which the USB to serial adapter is connected to I can see it print those lines nicely, ½ second delay.
I've tried putty with RTS/CTS and DSR/DTR as you suggested but to no avail.
I tested with python and pySerial but the same. Totally quiet.
Baudrate is 9600 everywhere (air rate for the wireless, COM port in programs and in device manager). Running Windows 7 64-bit. The serial monitor doesn't display any other settings it is using. Maybe I need to go so far to check the source code to it.

If you are using the usb serial port on a Mega, then you should use Serial instead of Serial1.

int counter = 0;

void setup() {
  Serial.begin(9600);
  digitalWrite(5, HIGH);
}

void loop() {
  Serial.print("Counting ");
  Serial.println(counter++);
  delay(500);
}

I looked into the code. It reads the values out of preferences.txt
serial.stopbits=1
serial.databits=8
serial.parity=N

As it should be. COM port name and baud rate are supplied. After this it dives into standard Java library, [docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/CommPortIdentifier.html#open(java.lang.String, int)](http://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/CommPortIdentifier.html#open(java.lang.String, int)).
And that made me suspect other Java program might also work. Quickly googled a terminal program written in Java and found this
BirdTerm Java Serial Port Terminal download | SourceForge.net
And sure enough, it gets the output from the Arduino. Worth nothing is that flowcontrol is set to None.

I dived down into the code (paralleling with openjdk), down to native libraries which calls win32 api.
I studied pySerial also. I'm tested jython (python running on Java Virtual Machine), which had a separate implementation. But it wouldn't load (could not connect back to java's APIs. Otherwise it would been kind of funny that the same program running in jython would have worked but not in CPython.

SurferTim:
If you are using the usb serial port on a Mega, then you should use Serial instead of Serial1.

*SNIPP*

The APC220 RF module connects over serial (RX & TX pins). And what I've read a small Arduino won't work with something connected to the RX and TX at the same time using it for USB serial.
So that's why I used my Mega so I could have it connected and powered from USB but at the same time transmitting.

I use Putty all the time with Serial COMx ports. I have not have any problems on Windows XP/7 32/64 bit. One thing to keep in mind most USB serial adapters do not handle hardware handshaking correctly with CTS/RTS or DTR/DSR. I always select 'none' or if I wanted some kind of in-band flow control then I use 'XON/XOFF'. But for most serial comm I usually select 'none' flow control or handshaking.

The 3rd rf module is directly connected to the usb/serial adapter which plugs into the pc's usb port and becomes Com7

An obvious question.Does the rf module use a TTL RX TX lines or RS232 voltage levels?
Are you aware that you need to convert the signals if you have a TTL lines to connect it directly to the RS232 USB Converter ?

HugoPT:

The 3rd rf module is directly connected to the usb/serial adapter which plugs into the pc's usb port and becomes Com7

An obvious question.Does the rf module use a TTL RX TX lines or RS232 voltage levels?
Are you aware that you need to convert the signals if you have a TTL lines to connect it directly to the RS232 USB Converter ?

I think this isn't the issue here. This should be handled by the drivers or lower level.
As said by alfiesty (and the same for me). The diagnostic/setup program for the APC220 (which is buggy enough) manage to connect and read the modules (if they are at a low enogh COM port number). The Serial Monitor in Arduino IDE reads it correctly, so does that other terminal java program I found. Descending through the different levels of source code (Arduino IDE, Java, JNI C) I couldn't find anything special with the code at first look. But I need to have a second try and look more at the code when I have some more spare time. But if one works and the other (putty & pySerial on CPython) it ought to be something in the higher software levels.

But, I should admit that I wasn't aware how RS232 worked, but I found this which gave me a brief info about voltage levels RS-232 - Wikipedia

alfiesty:

Any updates here? I found the same issue, and no luck to find the difference between Putty(Pyserial...) and Serial Monitor....

While, find another tool could work fine... sscom32

Pls keep me posted if you have any founding

The problem:
The problem is the connection between APC220 and the USB to TTL converter.
Pin number 3 (EN) on the APC220 have to be set HIGH (or floating) to power up the radio. When this pin is set LOW (<1,6V) the radio powers down. This pin is connected to the RTS-pin on the USB converter, which is causing the problem.

Arduino Serial monitor doesn’t use flow control (handshaking), so this pin is left HIGH (for several reasons I will not go into) and the radio works without problems.

Putty leaves the RTS-pin LOW when you don’t use flow control, which powers down the radio. In my experience most of the programs leaves this pin LOW.

Solution:
Some programs, like "Terminal by Bray", lets you control the pin-output manually. By changing the RTS (and/or DTR) to a LOW output, this program should work fine (Kudos Bray XD).

If you still want to use Putty or other programs which won’t work, the easy way is to just cut* pin 3 (En-pin) on the radio. A better way is to connect a cable between the radio and the converter. Only connect 5V, Gnd, Rx and TX (Except for when you need to program the radio).

  • The EN-pin is used by RF-Magic. Cutting this pin makes programing trough RF-Magic impossible.

Hello,
This is how to solve the problem reading serial data with the APC220 from python :

import serial # pyserial 2.7

ser = serial.Serial()
ser.port = "COM5"
#ser.port = "/dev/ttyS2"
ser.baudrate = 9600
ser.bytesize = serial.EIGHTBITS #number of bits per bytes
ser.parity = serial.PARITY_NONE #set parity check: no parity
ser.stopbits = serial.STOPBITS_ONE #number of stop bits
ser.timeout = 0 #non-block read
ser.xonxoff = False #disable software flow control
ser.rtscts = False #disable hardware (RTS/CTS) flow control
ser.dsrdtr = False #disable hardware (DSR/DTR) flow control

ser.setRTS(0) # <---- THIS SOLVED THE PROBLEM READING SERIAL DATA WITH APC220

ser.open()
while 1:
time.sleep(1)
linea = str(ser.read(ser.inWaiting()))
print("." + linea )
ser.close()