1

Latest Raspbian Buster OS and Raspberry Pi 3 V1.2 2015

This I can't get my head around this. Why can't I set up serial communication on Raspbian Buster for Raspberry Pi3 very easily after following many tutorials online?

These are the setups I took to enable serial communication through GPIO PINS 15 and 16

-Downloaded the latest Rasbpian Buster and installed it successfully.

-Set 15 and 16 GPIO PINs to ALT0. gpio mode 15 ALT0 gpio mode 16 ALT0

-Made sure /boot/cmdline.txt didn't have console=serial0,115200

-Raspi-Config - enabled serial, enabled serial hardware and disabled login shell through serial.

-Also had to disable console through the following commands. sudo systemctl stop serial-getty@ttyS0.service sudo systemctl disable serial-getty@ttyS0.service

-Also added the following line in /boot/config.txt dtoverlay=pi3-disable-bt and enable_uart=1

After all that, I saved everything and rebooted my pi 3. Everything came up as it should including my program that is suppose to communicate through 15 and 16 gpio pins. And there is absolutely no communication at all. The serial communication LEDs on our hardware don't even BLINK ONCE.

So, I ran the following terminal command. ls -l /dev This is what it is showing for serial0.

enter image description here

So, why can't I get serial communication working on Raspbian Buster on Pi 3? The interesting thing about this issue is that with the same setup on the same PI 3 running Raspbian Jessie my program starts communicating immediately as soon as my program is up and running with no problem.

UPDATE: After spending 3 whole days on this pulling my hair, I figured out what the issue is. With my pi3, I use 3.5 inch pitft adafruit touchscreen display. I noticed that any time adafruit is hooked up and turned on while displaying raspbian's desktop, serial communication stops working. My program can only send requests, but there is NEVER a reply back from the hardware. Once I unplug the display from my PI3 and remove the setup code from CONFIG.TXT, serial communication start working again as normal. Have a look at the setup code for my adafruit touchscreen display.

hdmi_cvt=720 480 60 1 0 0 0
# --- added by adafruit-pitft-helper Wed Aug 18 14:52:26 2021 ---
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft35-resistive,rotate=90,speed=20000000,fps=20
# --- end adafruit-pitft-helper Wed Aug 18 14:52:26 2021 ---

Can anyone tell me what the issue is with this setup in config.txt and how i can fix it so that display and serial communication works. Thanks.

4
  • All you should have done is download a fresh image and then run raspi-config to disable serial login and enable serial hardware. Everything else you have done has presumably screwed this up.
    – joan
    Aug 26, 2021 at 14:18
  • @joan Oh, really! Well, then let me do just that, right now.
    – ThN
    Aug 26, 2021 at 14:40
  • @joan You are almost right. I did just like you said, but there is no communication just like before. So, I disabled bluetooth in cmdline.txt and had to disable ttyS0.service. At this point, I have packets going out from GPIO pin 14 and 15. However, there seems to be something wrong with the communication itself. We are not getting any response from the hardware Pi is talking to. That shouldn't be. This means there is still something wrong about the pi's serial setup.
    – ThN
    Aug 26, 2021 at 16:40
  • @Milliways knows serial much better than me. Perhaps he will notice the question later.
    – joan
    Aug 26, 2021 at 17:08

1 Answer 1

2

Are you really using pins 15 and 16? The standard UART uses 14 and 15, I use a basic buster install, use raspi-config to disable serial console and enable serial IO then it all works as expected on pins 14 and 15.

I found this useful reference on the net:

https://uk.mathworks.com/help/supportpkg/raspberrypiio/ug/use-the-serial-interface-on-raspberry-pi-hardware.html

1
  • Well, wiringPi calls it 15 and 16 but based on BCM it is 14 and 15. Anyways, I figured out what the issue or why serial communication stops working. Have a look at the update in the question above. But I am not sure how to go about fixing it.
    – ThN
    Aug 27, 2021 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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