Pages: [1] 2   Go Down
Author Topic: Problem with Putty  (Read 5888 times)
0 Members and 1 Guest are viewing this topic.
Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 181
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

8000ft above the average

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

My test sketch...

Code:
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 (41.27 KB, 456x435 - viewed 278 times.)

* 19.jpg (34.01 KB, 456x435 - viewed 294 times.)
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1544
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 181
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

8000ft above the average

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1024
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thank you.  That helps.

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thank you.  That helps.

Quote
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:
Code:
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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5853
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using the usb serial port on a Mega, then you should use Serial instead of Serial1.
Code:
int counter = 0;

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
And that made me suspect other Java program might also work. Quickly googled a terminal program written in Java and found this
http://sourceforge.net/projects/birdterm/
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using the usb serial port on a Mega, then you should use Serial instead of Serial1.
Code:
*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.
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 29
Posts: 582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1544
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 ?
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 http://en.wikipedia.org/wiki/RS232#Voltage_levels
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-lol).

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.

Logged

Pages: [1] 2   Go Up
Jump to: