Le Potato Raspian Bullseye is missing /dev/serial0

Great work updating the distro!!

I’m a repeat customer.

I’m trying to get a Le Potato (aml-s905x-cc) to interface with the adafruit BuildHat so that my son can do custom programming for lego robots.

The software library BuildHat (documented here: https://cdn-shop.adafruit.com/product-files/5287/buildhat-python-library.pdf and also: GitHub - RaspberryPiFoundation/python-build-hat: Build HAT Python library ) will not run even though I have followed every instruction on the installation document regarding using sudo raspi-config to set the serial port on but the serial terminal off.

The library fails with this message: FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/serial0’

How can I create the necessary links in order to access /dev/serial0 for serial communication?

Thank you!

Per Raspberry Pi Documentation - Build HAT, it uses Raspberry Pi GPIO numbers 4, 14, 15, 16, 17 for UART communication with the Raspberry Pi Microcontroller. This is equivalent to UART A on Le Potato and there’s an overlay in the libretech-wiring-tool to enable this interface which will show up as /dev/ttyAML6. You may also need to map the Raspberry Pi GPIO 4 (Pin 7, sysfs 499) in the software.

You need to clone their repository and update the code to use these references instead of serial0 and sysfs 4.

Thank you for such a quick reply! And not only that: it’s spot on!!

Thank you.

For those who might find this thread in the future, or be applying it to their own projects, here is the step-by-step that I used after librecomputer’s answer:

First off, I was using the 2022-09-22-raspbian-bullseye-arm64+aml-s905x-cc.img.xz file dated 2022-Dec-13.

The video referenced in the answer is very technical, and says you have to download and make the software, but in fact it’s already installed at /opt/librecomputer/libretech-wiring-tool/

You don’t need to use the command with a ./ in front of it.

On my system I issued the following two commands:

sudo ldto enable uart-a

sudo ln -s /dev/ttyAML6 /dev/serial0

The first enables the overlay for serial communication to the GPIO pins as described in the answer.

The second does an end-run around needing to recompile the BuildHat library by creating a symbolic link between the actual port set up by the overlay (ie /dev/ttyAML6) and the device expected by the BuildHat library (ie /dev/serial0).

This will probably work for other libraries as well.

To find the options for other overlays, you would use “ldto list”
To undo the overlays, you would use “sudo ldto disable uart-a”

Thanks again to the amazing work being done by the librecomputer team.

1 Like