Power & Source of Big Ideas

Nano PI Serial

Moderators: chensy, FATechsupport

How do I open/read/write any of the 4 (0-3) serial ports on the Nano PI?

Code: Select all

pi@NanoPi-NEO2:~$ ls /dev/ttyS*
/dev/ttyS0  /dev/ttyS1  /dev/ttyS2  /dev/ttyS3

To check if ports are enabled:

Code: Select all

pi@NanoPi-NEO2:~$ dmesg | grep tty
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait fsck.repair=yes panic=10 fbcon=map:1
[    0.257152] console [ttyS0] disabled
[    0.277282] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 30, base_baud = 1500000) is a U6_16550A
[    1.026807] console [ttyS0] enabled
[    1.052633] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 31, base_baud = 1500000) is a U6_16550A
[    1.083783] 1c28c00.serial: ttyS3 at MMIO 0x1c28c00 (irq = 32, base_baud = 1500000) is a U6_16550A


Then https://en.wikibooks.org/wiki/Serial_Programming/termios

Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 13 guests