User avatar
Doctorwho8
Posts: 78
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY

How would I go about changing the serial baud rate on a TTY

Mon Jul 06, 2020 12:07 am

Hello!
I followed these steps:
First I entered:
sudo systemctl enable serial-getty@ttyUSB0.service
And then I entered:
sudo systemctl start serial-getty@ttyUSB0.service

That was copied from:
http://0pointer.de/blog/projects/serial-console.html

Which provided the details as if I was working on an Intel system running Debian.

After entering the second command string on the serial console screen I immediately saw a prompt arrive on my second Putty terminal.That was running 9600 baud. I need to take this down to 4800 baud. Reason being is that it will be connected to a RS Model 102 who does 4800 rather well, but does 9600 baud poorly. I have vague memories of doing so sometime earlier on this Pi3B but, ah, it was so long ago I can not remember the steps. I found an earlier Forum series on a similar subject, and noted that the correspondent there faced a similar problem. But trying the recommended steps now wasn't at all working.
-------------------
Gregg
Doctor Who8

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How would I go about changing the serial baud rate on a TTY

Mon Jul 06, 2020 8:44 am

Normally you would just set the baudrate in the program that uses the serialport. If you are using a dedicated serial-library for your chosen language ( e.g. Pyserial ) those libraries will let you control the baudrate.

But if you just want to change it from the terminal the command is:

Code: Select all

stty -F /dev/ttyUSB0 4800
(of course use the correct device name for you.. )

.. but is this a usb2serial device connected to the USB port of the Pi ?
.. do you really want to have a login terminal for that ? ( i have no idea what an "RS Model 102" is )
.. what was the motivation for activating getty for that serial port ? ( if you wanted some output you could have just done "echo "Hello" > /dev/ttyUSB0" )


( And why on earth choose the eight Doctor ?? ;) :ugeek: )

User avatar
Doctorwho8
Posts: 78
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY

Re: How would I go about changing the serial baud rate on a TTY

Mon Jul 06, 2020 1:45 pm

topguy wrote:
Mon Jul 06, 2020 8:44 am
Normally you would just set the baudrate in the program that uses the serialport. If you are using a dedicated serial-library for your chosen language ( e.g. Pyserial ) those libraries will let you control the baudrate.

But if you just want to change it from the terminal the command is:

Code: Select all

stty -F /dev/ttyUSB0 4800
(of course use the correct device name for you.. )

.. but is this a usb2serial device connected to the USB port of the Pi ?
.. do you really want to have a login terminal for that ? ( i have no idea what an "RS Model 102" is )
.. what was the motivation for activating getty for that serial port ? ( if you wanted some output you could have just done "echo "Hello" > /dev/ttyUSB0" )


( And why on earth choose the eight Doctor ?? ;) :ugeek: )
Hello!
First things last. I chose him because it seems that the reality that Doctor Who does his/her best in seems to be largely ignoring him. :!: Never mind when he first surfaced, and then was last seen which was the movie celebrating the 50th anniversary of the Doctor. And next things next, please examine here first: https://arstechnica.com/information-tec ... model-100/ I did try it out on the original Pi and found that at the speed he set it for the screen on the Radio Shack Model 102 I used,, the screen smeared.

I also used the information here: https://zork.net/~octal/mod100.xhtml there was large amounts of information there. Finally several years ago for a completely different purpose I did manage to change the baud rate on the whole business. Back then I had connected to the same device a Pi3B I had connected to it, two Pi Zeros, one was working as a Gadget Zero Serial, and the other was working as a Gadget Zero Ethernet one. There's an unrelated issue of the WiFi departing in this configuration for the Pi3B when all of that there was connected this time.

Also here http://www.club100.org/ you should find out more information for the Radio Shack TRS-80 Model 102 for it.
-------------------
Gregg
Doctor Who8

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How would I go about changing the serial baud rate on a TTY

Mon Jul 06, 2020 2:19 pm

This thread:
viewtopic.php?t=155807
.. should contain all you need. ( note answers by dgordon2 )

just ask if seomthing is unclear.

Return to “Interfacing (DSI, CSI, I2C, etc.)”