LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 01-05-2024, 05:20 PM   #1
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 506

Rep: Reputation: 47
Enable serial device /dev/serial0


How do I enable the /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 devices?

I want to be able to use the GPIO 14 (TXD) and GPIO 15 (RXD) pins on a Raspberry Pi 3:
https://www.raspberrypi.com/document...-Diagram-2.png
 
Old 01-05-2024, 09:52 PM   #2
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Geremia View Post
How do I enable the /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 devices?
Edit /etc/inittab and modify the section below to enable a serial line:

Code:
# Local serial lines:
#s0:12345:respawn:/sbin/agetty -L ttyAMA0 9600 vt100
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100
 
Old 01-05-2024, 10:14 PM   #3
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 506

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by Exaga View Post
Edit /etc/inittab and modify the section below to enable a serial line:
Editing that alone (and running "init q") doesn't give me a /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 device.
Don't I need to do something in /boot/config.txt ?
 
Old 01-06-2024, 01:17 AM   #4
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Geremia View Post
Editing that alone (and running "init q") doesn't give me a /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 device.
Don't I need to do something in /boot/config.txt ?
In your /boot/config.txt file:

Code:
enable_uart=1
After ensuring that is enabled, reboot. Now what is the output of this command?

Code:
root@slackware:~# ls -l /dev/ttyAMA*
For me it's:

Code:
root@iana:~# ls -l /dev/ttyAMA*
crw-rw---- 1 root dialout 204, 74 Jan  6 03:32 /dev/ttyAMA10
I would advise you, given that you're experiencing so many issues by installing Slackware AArch64 with the SARPi installer, to use the official Slackware installer software and follow the instructions on https://docs.slackware.com/slackware...4_bcm2711_rpi4 to ensure complete success. Even though this is intended for the RPi4 it works just as well on a RPi3.

SARPi does work as intended (in most cases) but sometimes requires a little more effort, and knowledge/experience of troubleshooting the Raspberry Pi with regards to configuration settings and such. If all you want to do is get Slackware AArch64 up and running as quickly and easily as possible then the official means and methods is by far the best option. SARPi is a community driven effort for playing around and for when there are no other official options available (e.g. for the Raspberry Pi (1) & 2, etc.).

[EDIT] You will probably also need to disable BlueTooth in your /boot/config.txt file in order to get a serial line working:

Code:
dtoverlay=disable-bt

Last edited by Exaga; 01-06-2024 at 01:57 AM. Reason: typos & edit
 
Old 01-06-2024, 12:22 PM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Enable serial device /dev/serial0

Yes, disable the Bluetooth uart. If it is enabled the serial console will not work on the rpi3.

To connect use gnu screen:
Code:
screen /dev/ttyUSB0 115200
Check dmesg to see if ttyUSB0 is the serial device.

Edit: Typo, lq is hard on a Smart phone!

Last edited by mralk3; 01-06-2024 at 12:24 PM.
 
Old 01-06-2024, 03:18 PM   #6
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 506

Original Poster
Rep: Reputation: 47
I put
Code:
enable_uart=1
dtoverlay=disable-bt
in /boot/config.txt.

Quote:
Originally Posted by Exaga View Post
After ensuring that is enabled, reboot. Now what is the output of this command?

Code:
root@slackware:~# ls -l /dev/ttyAMA*
For me it's:

Code:
root@iana:~# ls -l /dev/ttyAMA*
crw-rw---- 1 root dialout 204, 74 Jan  6 03:32 /dev/ttyAMA10
For me, it's:
Code:
root@raspi:~# ls -l /dev/ttyAMA*
crw-rw---- 1 root dialout 204, 64 Dec 31  1969 /dev/ttyAMA0
Why's the date so off?
Code:
root@raspi:~# date
Sat Jan  6 14:17:59 MST 2024
is normal.

Reading hangs:
Code:
$ python3
>>> import serial
>>> port = serial.Serial('/dev/ttyAMA0')
>>> port
Serial<id=0x7f944f29d0, open=True>(port='/dev/ttyAMA0', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
>>> port.write(b'AT\r')
3
>>> rcv = port.read(10)

Last edited by Geremia; 01-06-2024 at 03:20 PM.
 
Old 01-06-2024, 03:22 PM   #7
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 506

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by mralk3 View Post
To connect use gnu screen:
Code:
screen /dev/ttyUSB0 115200
I don't have a /dev/ttyUSB0.
Code:
screen /dev/ttyAMA0 115200
hangs.
 
Old 01-07-2024, 04:20 AM   #8
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,549

Rep: Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313
Quote:
Originally Posted by Geremia View Post
How do I enable the /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 devices?

I want to be able to use the GPIO 14 (TXD) and GPIO 15 (RXD) pins on a Raspberry Pi 3:
https://www.raspberrypi.com/document...-Diagram-2.png
In Slackware, Serial console support is preconfigured upon setup. Across all Raspberry Pi models, the system utilises /dev/ttyS1 for serial communication. The serial configuration is described at the foot of the Install guide.

Code:
root@mutley:~# slk-hwm-discover
Raspberry Pi 4 Model B Rev 1.4
root@mutley:~# grep -A1 serial /etc/inittab
# Local serial lines:
s0:12345:respawn:/sbin/agetty --keep-baud 115200,38400,9600 ttyS1 vt100
root@mutley:~#
Here's Slackware's RPi4 undergoing testing of Linux 6.6:

Code:
Welcome to Linux 6.6.9-armv8 aarch64 (ttyS1)

mutley login:

Last edited by drmozes; 01-07-2024 at 04:22 AM.
 
1 members found this post helpful.
  


Reply

Tags
gpio, pins, raspberrypi 3, sarpi, serial



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why is there a need for /dev/null, /dev/zero and other special device (files) in /dev suttiwit Linux - General 13 08-07-2012 12:26 AM
pseudo terminals: /dev/ptmx <-> /dev/pts/ vs. /dev/ptyp <-> /dev/ttyp rtspitz Linux - Software 2 12-02-2011 02:07 PM
Is it possible to access an IrDA device as a serial device such as /dev/ttyUSB0? cricketlong Linux - Hardware 1 05-24-2011 03:11 PM
using flash drive changes device /dev/sr0 to /dev/sr1 for mapping to /dev/pktcdvd/0? lugoteehalt Linux - Software 3 10-24-2007 10:27 AM
/dev/tty0, /dev/tty1, /dev/tty10...and so on...which should be used for a device ??? b0nd Slackware 2 04-02-2006 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 02:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration