Raspberry Pi 4B Serial port

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage Pi 4B 4Gb
    • OS: Buster
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2.5.0
  • Issue of the topic: getting serial port /dev/ttyAMA0 to work
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

Anyone have any experience getting ttyAMA0 working on a Pi 4B? I installed latest openhabian (Buster variant) and did the openhab2-config routine to allow the serial port but could never get ttyAMA0 to communicate. Interestingly, the Pi 4B has 4 additional serial ports, ttyAMA1-4 onboard, so I was able to get ttyAMA1 to work, but I would like to figure out why ttyAMA0 does not work, as it does with a similarly configured Pi 3B.

These are the relevant lines from my /boot/config.txt

# Enable DRM VC4 V3D driver on top of the dispmanx display stack


And /boot/cmdline.txt:

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=43732170-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

And /etc/default/openhab2:

EXTRA_JAVA_OPTS="-Xms250m -Xmx350m -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0:/dev/ttyAMA1:/dev/ttyAMA2:/dev/ttyAMA3:/dev/ttyAMA4"


What device are you using?
Some Z-wave USB sticks report themselves as supporting USB 3 when they do not. The workaround is to plug them into a USB 2 hub and then plug that into the Pi.

Not a USB issue. I am referencing the onboard UART. The Pi3 has a PL011 and a mini UART. The Pi4 has, as far as I can figure out, a mini and 5x PL011s (or something like a PL011). I was able to get /dev/ttyAMA1 communicating (which I assume is one of the PL011s), but not /dev/ttyAMA0, which is a different PL011 that corresponds to the Pi3 PL011. BTW I am talking to a serial port on a lighting controller with my own custom code through a MAX3232 chip which converts 3.3V RS232 to standard voltage RS232. Thanks for your help.

Using Bluetooth? IIRC you cannot use both at the same time, this was a restriction with Pi <=3, may or may not still be the same with a 4.