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?
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.
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
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?
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.
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.
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 ?
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
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.