How to use serial port in raspberry pi 4 install with OpenWrt

I want to use the serial port, uart to transfer the data from the sensor, while reading the serial port ttyS0, I get the error, Can anyone help me with this issue

How can I read the serial port and transfer data by TX and RX in raspberry pi 4

unless you need opkg packages for your particular sensor... you should visit the rpi-foundation documents and forum...

there is nothing particularly openwrt specific about using rpi4 serial pins...

Well, that's not entirely true. We have target/linux/bcm27xx/image/distroconfig.txt which is included by target/linux/bcm27xx/image/config.txt (referring to source paths - these files are installed in the boot partition which usually is mounted as /boot). OpenWrt defaults to


which will put ttyAMA0 (first PL011) on GPIOs 14 and 15 instead of ttyS0 (miniUART). I have some mixed feelings about that. IMHO, it is often simpler to let Bluetooth be enabled and just use the miniUART for serial. But you'll have to enable the miniUART with


in config.txt since it is disabled by default. In addition to removing the unwanted BT disable - which confusingly is more about UART mapping than BT.

1 Like

Even after enabling_uart=1 in /boot/config.txt file, i am still getting the issue. usually in Raspberry Pi OS, after enabling the uart in /boot/config.txt , we can use serial devices.

Any other suggestion, which can help to use serial devices

it a bad idea to use uart0/1 for a sensor

much wiser to use uart2-5

This is my dev list, to enable the uart2-5, what I need to do

can you suggest me??