Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
123Next
Return to list New
View: 13504|Reply: 21

Enable the serial port in Debian Jessie

[Copy link]

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
Post time 2016-2-22 18:48:06 | Show all posts |Read mode
Hello eveyone !Does someone can help me to solve the problem of serial port /dev/ttyS0 ?
It seems that I have to open some files and set something to use the serial port .....
Thanks !

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-22 19:19:48 | Show all posts
Edited by xwalter at 2016-2-22 19:59

at the moment in the /etc/inittab I have this information
S0:23:respawn:/sbin/getty -L ttyS0 115200 vt102Measuring with Voltmeter I have
GPIO14 - GND = 3.3 V
GPIO15 - GND = 3.3 V
The GND of orangepi is connected to GND of FTL232-USB to TTL 3V3 converter
It seems that the two pins are setted as output ...I don't know
I hope the layout pins is correct because I didn't found an orangepi pinout diagram but raspberry pi2

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 02:27:38 | Show all posts
I did some tests
  1. setserial -g /dev/ttyS[0123]
Copy the Code

this is ok ....and then I set the serial ports enabled
  1. systemctl enable serial-getty@ttyS0.service
Copy the Code

To check is serial port are enabled I see the IRQ assigned and it's ok
Then I type
  1. dmesg | grep ttyS
Copy the Code

Ant last control is
  1. ls > /dev/ttyS0
Copy the Code
  1. ls > /dev/ttyS2
Copy the Code
  1. ls > /dev/ttyS3
Copy the Code

Without any message and it's ok
But the serial ports don't work , no one port receive something and transmit something
This is a big problem ....

2

Threads

144

Posts

985

Credits

Senior member

Rank: 4

Credits
985
Post time 2016-2-23 02:30:38 | Show all posts
Do you actually have those serial-ports enabled in your script.bin?

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 02:48:42 | Show all posts
Edited by xwalter at 2016-2-23 03:02

in /boot  I have several script.bin , each one for each monitor resolution
Very strange because when I prepared the sd card I have followed the tutorial and renamed the uImage and script.bin depending by my monitor
But anyway inside the script.bin_xxxxx  I can read only one character which is  "N" in somewhere and "0" in other file
I have setted 1080_60 for the monitor  .....I have orangepi plus 2 and inside /boot I found two files for that ....
- script.bin.OPIPLUS_1080p50
- script.bin.OPIPLUS_1080p60
In both files there is only one data and it is 0  (zero) , but when I have installed from sd card was 36 kb ...then I install to the emmc by typing sudo install_to_emmc.
Do you mean I have to set to 2 or 3 to have uarts?
One question.....at pins 13 and 14 there is uart3 = /dev/ttyS3 ?

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 03:13:10 | Show all posts
I'm checking into my sd card that I remained with last image and script.bin but how to open it ?

2

Threads

144

Posts

985

Credits

Senior member

Rank: 4

Credits
985
Post time 2016-2-23 16:39:49 | Show all posts
You need to install sunxi-tools, then you convert the bin-file to a fex with "bin2fex script.bin > script.fex" or back with "fex2bin script.fex > script.bin"

Depending on your distro the actual files used for booting may be in /mnt/boot or /media/boot, even though there are also files in /boot.

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 17:49:02 | Show all posts
ok thanks !
Now I try to install sunxi-tools

5

Threads

355

Posts

2380

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
2380
Post time 2016-2-23 18:01:08 | Show all posts
/dev//ttyS0 is the debug port! Attach your serial dongle there and you will see something.
check sunxi wiki!
e.g. http://linux-sunxi.org/Xunlong_Orange_Pi_Plus should be the same for pi plus2 apart 2gb ram same crappy usb to sata.
zio pino
Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 18:10:24 | Show all posts
Edited by xwalter at 2016-2-23 18:23

yes you're righe zio pino . The orange pi plus is the same of plus 2 apart the EMMC and  the RAM sizes.
At the moment I have connected the pins PA13 and PA14 each which is :
- PA13  ->  UART3_TX
- PA14  ->  UART3_RX
So I'm using the /dev/ttyS3  ,  is that right?
Yes because ....
  1. dmesg | grep ttyS
Copy the Code
Responds .....
  1. [    0.000000] Kernel command line: earlyprintk=ttyS0,115200 loglevel=8 initcall_debug=0 console=ttyS0,115200 console=tty0 init=/init
  2. [    0.627413] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
  3. [    0.723616] console [ttyS0] enabled
  4. [    0.850323] uart2: ttyS2 at MMIO 0x1c28800 (irq = 34) is a SUNXI
  5. [    0.850572] uart3: ttyS3 at MMIO 0x1c28c00 (irq = 35) is a SUNXI
  6. [   10.213707] systemd[1]: Expecting device dev-ttyS0.device...
  7. [   10.228992] systemd[1]: Expecting device dev-ttyS3.device...
  8. [   10.244060] systemd[1]: Expecting device dev-ttyS2.device...
Copy the Code
The test
  1. ls > /dev/ttyS3
Copy the Code
....it's ok , no message
But serial doesn't work yet



You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2022-5-16 17:24 GMT+8 , Processed in 0.035346 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list