WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Serial Console  (Read 11356 times)

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: Serial Console
« Reply #15 on: September 23, 2017, 10:29:23 AM »
Can someone fix a note I left, in a few messages back, please... Of course its passwd that's used to change a password, rather than passd
Thanks in advance,

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Serial Console
« Reply #16 on: September 23, 2017, 12:48:52 PM »
Hi kmhill
added /etc/inittab to the system backup list

I think by the time that file is restored it's too late and has already been executed. Also, you know to omit the leading /, right?


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Serial Console
« Reply #17 on: September 23, 2017, 12:52:04 PM »
Hi kmhill
Can someone fix a note I left, in a few messages back, please... Of course its passwd that's used to change a password, rather than passd
Thanks in advance,
Done.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Serial Console
« Reply #18 on: September 23, 2017, 01:35:49 PM »
Dont know but i think you also need the console command in cmdline that specifies the correct tty. I think the tty1 is for the x11 tty console.
« Last Edit: September 23, 2017, 01:38:42 PM by patrikg »

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: Serial Console
« Reply #19 on: September 23, 2017, 05:00:48 PM »
Rich, I used the Control Panel's Backup and Restore Lists Maintenance GUI to make that change. In looking back, yes. the list shows that the leading / was removed. I'm still new to all this. I don't know if the inittab file is used before or after the file restore.

Patrikg, I'm not sure how x11 starts, so maybe tty1 is about that...

I have to shift gears and set this aside for now, and get back to this later. Thanks folks.
« Last Edit: September 23, 2017, 05:02:49 PM by kmhill »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Serial Console
« Reply #20 on: September 23, 2017, 05:24:15 PM »
Hi kmhill
From someone who knows:
Backup restore happens way too late for inittab. You need to remaster to edit that.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Serial Console
« Reply #21 on: September 24, 2017, 08:20:09 AM »
Yes thats right.
I do it like this. This was with version 8.1.5.
Extract the files and edit the file and compact the files again.

1. Extract the files
Code: (bash) [Select]
sudo su
mount /mnt/mmcblk0p1/
mkdir /tmp/extract
cd /tmp/extract
zcat /mnt/mmcblk0p1/8.1.5.gz | cpio -i -H newc -d

2. Edit the file

3. Compact the file
Code: (bash) [Select]
sudo su
mount /mnt/mmcblk0p1/
cd /tmp/extract
find | cpio -o -H newc | gzip -2 > /mnt/mmcblk0p1/8.1.5.gz

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: Serial Console
« Reply #22 on: September 25, 2017, 09:37:58 PM »
Hi, I'm looking in /mnt/mmcblk0p1/ and I'm seeing two .gz files... 9.0.3.gz and 9.0.3v7.gz.
I looked in the config.txt file and see that the option [PI0] says to use 9.0.3.gz, so I'll use that one.


Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: Serial Console
« Reply #23 on: September 26, 2017, 09:39:25 PM »
Here are some preliminary results...

To start fresh, in bootlocal.sh I commented out the call to serialtty.sh and removed the entry for inittab from the backup list. Then I followed the outline from patrikg to edit the inittab file. So, now I can edit the inittab file and I've made a few attempts, but I don't fully understand the format of what's in the inittab file quite yet... I'm going to look back to prior notes again.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Serial Console
« Reply #24 on: September 27, 2017, 12:10:26 AM »
You have to edit the line to this

ttyAMA0::respawn:/sbin/getty -L 115200 /dev/ttyAMA0 vt100

Or

/dev/ttyS0::respawn:/sbin/getty -L 115200 /dev/ttyS0 vt100

Some hints:

https://github.com/FrankBau/raspi-repo-manifest/wiki/UART

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Serial Console
« Reply #25 on: September 27, 2017, 12:10:12 PM »
And don't forget like M-H says.. that some of the Raspberry PI's have bluetooth usage on the serial port.

http://forum.tinycorelinux.net/index.php/topic,21129.msg132018.html#msg132018

So you have to disable that in config.txt like this link.
https://openenergymonitor.org/forum-archive/node/12311.html

Include the disable device-tree overlay file pi3-disable-bt

And could be read more at this link.

https://www.raspberrypi.org/documentation/configuration/uart.md
« Last Edit: September 27, 2017, 12:12:39 PM by patrikg »

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: Serial Console
« Reply #26 on: September 28, 2017, 09:09:17 PM »
Hello folks;

I've settled on the following final edit to the inittab file. I inserted into the section that configures the tty's, the line for ttyS0. To better describe the system I'm using, its a RasPi-zero-W.

Quote
# /sbin/getty respawn shell invocations for selected ttys.
tty1::respawn:/sbin/getty -nl /sbin/autologin 38400 tty1
ttyS0::respawn:/sbin/getty -L 115200 /dev/ttyS0 vt100


While I haven't mastered all the content yet, I've learned much along the way, I'm satisfied with what I have so far. I like seeing in a serial terminal the start-up and shut-down system messages, I don't mind typing in the user name tc and a password, the command line works, I've been able to use the nano text editor to do some simple edits. Perhaps a text oriented game would be fun to do.

Thanks again folks. I appreciate your comments and support.