DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th January 2020
beavers beavers is offline
Shell Scout
 
Join Date: Nov 2017
Posts: 85
Default serial console access

I've got a PC Engines APU2 and a regular desktop with a serial port, and a null modem cable between them. I'm trying to get connectivity in both directions via cu(1), but it only ever works one time. After the first connection attempt (from either side), subsequent connection attempts elicit:

Code:
# cu -s 115200
cu: open("/dev/cua00"): Device busy
On the APU2, I've got things enabled in /etc/boot.conf:
Code:
stty com0 115200
set tty com0
And on both machines, I have this in /etc/ttys:

Code:
tty00   "/usr/libexec/getty std.115200" vt220    on secure
Is there something I'm missing?
Reply With Quote
  #2   (View Single Post)  
Old 30th January 2020
victorvas victorvas is offline
Real Name: Victor
Linux
 
Join Date: May 2019
Posts: 120
Default

Try with default settings:
9600 baud
8 bits
no parity
1 stop bit
Reply With Quote
  #3   (View Single Post)  
Old 30th January 2020
beavers beavers is offline
Shell Scout
 
Join Date: Nov 2017
Posts: 85
Default

Quote:
Originally Posted by victorvas View Post
Try with default settings:
9600 baud
8 bits
no parity
1 stop bit
No change, I'm afraid. Or do you mean I should change the settings in /etc/ttys?
Reply With Quote
  #4   (View Single Post)  
Old 30th January 2020
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 277
Default

Pretty sure you can't listen and call on the same tty. ttyU00 and cuaU00 are the same port, just different in activation signal. See tty(4)

Once getty is listening for incoming connections (or maybe once it answers, which might be why it works once), you can't use cu to dial out on the same port.
Reply With Quote
  #5   (View Single Post)  
Old 30th January 2020
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,767
Default

You could check /var/spool/lock for a lock file. A lock file there could cause the issue that you see.

I always add myself to the group dialer. IIRC that solved the lock file issue.
Some time ago cu(1) was rewritten:
Quote:
HISTORY

The cu command appeared in 4.2BSD. This version was written for OpenBSD 5.4 by Nicholas Marriott.
The previous versions <5.4 included a FILE section in the man page:
From https://man.openbsd.org/OpenBSD-5.3/cu.1
Code:
FILES

/var/log/aculog
    line access log
/var/spool/lock/LCK..*
    lock file to avoid conflicts with uucp
I am not sure whether these two files are not used anymore, or if it is a simple man page omission/regression ;-)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 30th January 2020 at 07:59 AM. Reason: formatting
Reply With Quote
  #6   (View Single Post)  
Old 30th January 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,353
Default

I have a small fleet of Alix platforms, and use a USB-attached serial port on a laptop when connecting to them via a null modem cable. I provision the speed to 9600 baud on all of them through their BIOS -- as their default speeds vary by BIOS version. I added this in /etc/remote so I can $ cu usb when connecting:
Code:
usb|For outbound ucom(4) to all 9600 baud systems:\
        :dv=/dev/cuaU0:br#9600:tc=unixhost:
Reply With Quote
  #7   (View Single Post)  
Old 15th May 2020
beavers beavers is offline
Shell Scout
 
Join Date: Nov 2017
Posts: 85
Default

From cu(1)
Quote:
~^D or ~. Drop the connection and exit. Only the connection is dropped - the login session is not terminated.
Wondering if the bolded could be my issue? When the issue occurs, I'm noticing this on each box:

On the APU2:
Code:
$ ps aux | grep cu
root     41193  0.0  0.1   368  1396 00  S+     12:15PM    0:00.03 login -p -- d64 (desktop.domain
root     18478  0.0  0.1   272  1200 00  S<+p   12:23PM    0:00.01 passwd -v login=yes -s login -- d64 (desktop.domain default (login_passwd)
...and on the desktop:
Code:
$ ps aux | grep cu
root     82990  0.0  0.0   360  1424 cu  S+     12:15PM    0:00.00 login -p -- D
root     94152  0.0  0.0   268  1240 cu  S<+p   12:23PM    0:00.00 passwd -v login=yes -s login -- D/amd64 (apu.domain) (tt default (login_passwd)
Eventually those disappear and I'm able to connect again. Should I be disconnecting my sessions with something other than ~^D?

Last edited by beavers; 15th May 2020 at 04:37 PM. Reason: commands
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple serial consoles via null modem cable or serial console server J65nko General Hardware 0 16th January 2010 12:01 AM
disable console access milo974 OpenBSD Security 9 29th December 2009 01:36 PM
Controlling a RS-232 Serial Console from a Shell Script ishikawanakano Programming 0 9th January 2009 10:00 PM
Setting up the serial console PeterSteele FreeBSD General 6 3rd November 2008 04:42 PM
getty dies on serial console? michaelk FreeBSD General 9 18th May 2008 08:44 AM


All times are GMT. The time now is 12:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick