4

I've purchased a used Raspberry Pi and have followed the instructions from Wolf Paulus's Journal to connect to the Raspberry Pi from my computer using a PL2303 USB adapter. The specifications on the PL2303 adapter say that it is for use with 3.3 V devices such as the Raspberry Pi.

Sending data to /dev/cu.usbserial and watching the voltages on the TX and RX confirms that the maximum voltages are right around 3.3 V - so I believe the adapter is good and that it is connected to the three correct pins (common ground, no connection with the red +5 V wire).

When I boot the Raspberry Pi I'm not getting any console messages via the serial device even though I'm using the default Raspbian image. I've tried /boot/cmdline.txt with both console=ttyAMA0,115200 (default) and also console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 as was suggested elsewhere, but I get nothing.

When I run stty -F /dev/ttyAMA0 I get:

speed 115200 baud; line = 0;
-brkint -imaxbel

Other than purchasing more of these and swapping them around, how can I test the Raspberry Pi to see if the serial / UART is good? And how can I test the PL2303 USB cable to see if that is good? Are there low-level tests I can do? Or perhaps something with an oscilloscope?

Additional information per @joan's request:

  • The USB is connected to the computer
  • I have tried connecting with 115200, 38400, and 9600 bit/s
  • I'm not even getting strange characters to indicate that the baud is incorrect
  • On the computer I'm using screen to connect:
  • screen /dev/tty.usbserial 115200 8N1
  • /dev/tty.usbserial and /dev/cu.usbserial are the devices for this USB adapter
  • On the Raspberry Pi I'm using a stock 2014-09-09-wheezy-raspbian image which has "Enable/Disable shell and kernel messages on the serial connection" set to "Enabled" (default setting)
  • The pins are connected to the Raspberry Pi like this. I have tried switching white / green "just in case", but without luck either way:

Connection

I believe I'm doing everything correctly so my question is more about how to know if there is either a problem with the USB adapter or the Raspberry Pi's serial connection.

Also, I was also curious if there was a way I could use screen on the Raspberry Pi itself to connect to its own console port (virtually), I tried this without luck: screen /dev/ttyAMA0 115200 8N1.

4
  • Perhaps edit your post to answer the following. Could you confirm that the USB end is plugged in to your computer and the wire end is plugged in to the Pi on pins 6, 8, and 10? Have you connected the computers RX to the Pi's TX? What baud rate are you running on your computer? What baud rate are you using on the Pi? What software are you using on your computer?
    – joan
    Jan 6, 2015 at 19:23
  • @joan - added the additional information you requested
    – cwd
    Jan 7, 2015 at 15:16
  • With the set up you have (boot messages enabled) you should be able to run screen at 115.2k 8N1 and see boot messages from the Pi. So set up screen on your computer and reboot the Pi (swap green/white if the first attempt doesn't work).
    – joan
    Jan 7, 2015 at 15:35
  • Just connect RX and TX to eachother and send something...
    – Zimano
    Jan 8, 2018 at 11:34

2 Answers 2

4

You asked "how to test to see if the serial ports on the Pi or the adapter". It is difficult to test the adapter, as so many things are involved, but you can test the Pi serial port.

You can check functionality without any external hardware. Connect GPIO pins 8-10 which will cause an external loopback.

Running a serial application on the Pi and you should see the output echoed back.

Terminal minicom is a suitable terminal program for test. You should set this up for device /dev/ttyAMA0 and echo off.

Current software should use /dev/serial0 See How-do-i-make-serial-work-on-the-raspberry-pi3

NOTE If you are doing this at the command prompt you need to disable serial console, otherwise the console output will confuse things. You can do this in raspi-config or editing /boot/cmdline.txt

2

It seems that using screen on Mac OS X was somehow the culprit - using picocom things work much better. I saw someone use picocom in a video and tried it after installing it with Homebrew:

brew install picocom
picocom -b 115200 /dev/cu.usbserial

The video used /dev/cu.usbserial instead of /dev/tty.usbserial so that's what I used and it worked well. screen did not seem to work with either one.

picocom tip: Use Control+A Control+X to exit or see the man page for other usage.

I still am not sure how to test to see if the serial ports on the Raspberry Pi or the adapter are actually good or bad - I suppose you just have to have known-good hardware with a known-good setup and swap them accordingly until something no longer works but then works when you switch it back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.