been fiddling with this for hours and get understand what is going on. I've been having problems with the Pi serial Uart communication.

I've tried this on 2 Raspberry Pi 2s, First one Jessie version 4.4.11 and second one Jessie version 4.4.21

I ran an Arduino code:

void setup() {

void loop() {
  int incomingByte;
  if(Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();

    // echo

And ran it with the minicom -b 9600 -o -D /dev/ttyAMA0 , but nothing appears on the screen when I type anything on the pi. I also realised the Serial.available() is always false. (No matter which serial pins I placed, Serial1,serial2)

Next, I decided to test the Pi. I connected the TXD pin and the RXD pin to each other and ran this program:

import serial
ser = serial.Serial(‘/dev/ttyAMA0’, 9600, timeout=1)

     while 1:
          response = ser.readline()
          print response
except KeyboardInterrupt:

I was expecting the "testing" to be printed out, however what it prints is just new blank line every loop, without the "testing" at all. Seems to me that the Pi is having some problems, but strangely, both PIs are having the same output and problems with minicom.

I was wondering if I am missing out any settings, here is what I have done: -Made sure there is no ttyAMA0 in /boot/cmdline.txt

-Disabled getty (systemctl disable [email protected])

-Did these steps as found in another forum:

sudo raspi-config -> Advanced Options -> Serial -> No

Add enable_uart=1 to \boot\config.txt


-Made sure the mode of TxD and RxD is on ALT0

Any help would be appreciated.

  • If you happen to have a USB - TTL adapter, you could try to send out data via the USB and receive it via the GPIO pin RX (and/or vice versa) and see if the problem persists. if this experiment is successful, it might give a clue where the problem lies. Commented Oct 19, 2016 at 18:33

2 Answers 2


Check the serial port settings with stty -F /dev/ttyAMA0. You might try piscope to check for activity on GPIO 14/15.


Apparently it was a faulty wire. Can't believe I didn't suspect that all these hours. Sorry for the time and thank you!!

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.