Page 1 of 1

Nano PI Serial

Posted: Tue Mar 06, 2018 6:11 am
by bwilcutt
How do I open/read/write any of the 4 (0-3) serial ports on the Nano PI?

Re: Nano PI Serial

Posted: Tue Mar 06, 2018 5:52 pm
by Petrov

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