Re: serial input line not working [solved]

2016-10-06 Thread Peer Janssen
Am 22.09.2016 um 04:47 schrieb Philip Guenther:
> Backing up to the beginning...
>
> On Wed, Sep 21, 2016 at 2:39 PM, Peer Janssen  wrote:
>> I updated an alix.3c3 box from OpenBSD 4.6 release to 6.0 release
>> recently via bsd.rd install kernel.
>> This went very smoothly, except that now I can't get a serial stream via
>> the DB9 serial connector.
> Ah, you accessed it under OpenBSD 4.6.  That raises two questions:
> 1) What was the dmesg when this box ran 4.6?
> 2) What was the exact command line you used then
Since I riskily upgraded in-place, no chance to get back to a dmesg of
the installation which was already history.
>> But on that alix box, nothing seems to arrive at the serial line.
> The 6.0 dmesg you included doesn't include any "com" drivers that I
> recognize, so it doesn't surprise me that nothing seems to work...and
> thus the query about what 4.6 reported and what worked there.

That was indeed the problem.
The solution was to switch a setting in the BIOS which enabled the com0
port. Duh!

It was there from the beginning to see, but I didn't know certain
OpenBSD terminology yet to understand how the different levels of access
to the port were named and interact. E.g. what precisely "configured"
(as in "Device not configured") referred to, namely that it's not me who
had to do that configuring manually in whatever securelevel etc. of the
fine OpenBSD software, but that it should have been the autoconf
mecanism of the kernel which should have done it, so I searched around
without realizing, what is now obvious to me, too, that the
configuration had to take place -- manually indeed -- before OpenBSD
even got it's chance to do it's own configuration.

So, more RTFM cleared things up, and now I got a better grip on the system.
This also enabled me to get gpio working on that and other boards. Great
fun!

Thanks to all who helped! Great software!
Peer

--
Peer Janssen - p...@pjk.de



Re: serial input line not working

2016-09-21 Thread Darren Tucker
On Thu, Sep 22, 2016 at 12:29 PM, Peer Janssen  wrote:
> # cu -d -l cua00 -s 9600
> cu: open("/dev/cua00"): Device not configured
> # cu
> cu: open("/dev/cua00"): Device not configured

I have an ALIX 2d[something] and on it, the serial ports show up as com devices:

$ dmesg | egrep '^com'
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo

I notice that the com devices are missing from your dmesg output,
though.  Maybe it's not enabled in the BIOS?  I see
http://pcengines.ch/alix3d3.htm has "fix serial port" against the most
recent firmware version...

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.



Re: serial input line not working

2016-09-21 Thread Philip Guenther
Backing up to the beginning...

On Wed, Sep 21, 2016 at 2:39 PM, Peer Janssen  wrote:
> I updated an alix.3c3 box from OpenBSD 4.6 release to 6.0 release
> recently via bsd.rd install kernel.
> This went very smoothly, except that now I can't get a serial stream via
> the DB9 serial connector.

Ah, you accessed it under OpenBSD 4.6.  That raises two questions:
1) What was the dmesg when this box ran 4.6?
2) What was the exact command line you used then


> But on that alix box, nothing seems to arrive at the serial line.

The 6.0 dmesg you included doesn't include any "com" drivers that I
recognize, so it doesn't surprise me that nothing seems to work...and
thus the query about what 4.6 reported and what worked there.


Philip Guenther



Re: serial input line not working

2016-09-21 Thread Peer Janssen
Am 22.09.2016 um 04:00 schrieb Theo de Raadt:
>> Am 22.09.2016 um 00:23 schrieb Theo de Raadt:
 But on that alix box, nothing seems to arrive at the serial line. I
 tried all of these (the  were in 0 t o5):

 # cu -d -l ttyC -s
 9600

 Connected to /dev/ttyC (speed 9600)
>>> Well, because that is one of the virtual console / screen
>>> device.  You want to use tty00.
>> Thank you. Now I get this error:
>>
>> # cu -d -l tty00 -s 9600
>> cu: open("/dev/tty00"): Device not configured
>
> Use cua00
>
> Look -- did you read the manual page?
>
>
>  -l line
>Specify the line to use.  Either of the forms like cua00 or
>/dev/cua00 are permitted.  The default is /dev/cua00.  See
cua(4)
>for information on terminal devices.  Users in group ``dialer''
are
>permitted to use cua(4) devices by default.
>
>
> Did you then read follow the breadcrumps to read cua(4)
>
> ?
>
>> I didn't find how to configure this/a device. Tried /etc/remote,
>> /etc/ttys, many man pages, Absolute OpenBSD, read about line disciplines
>> (but didn't find hot to configure them), etc. Also, from 5.8 on tip is
>> not there any more, guess it was merged with cu or so. Or are there
>> (more) framework change with doc lagging behind?
>> Anyway -- any hints?
>>
>> If I understood ttys correctly, I can attach my serial logger software
>> (instead of getty) directly to tty00 (once I know how to configure it),
>> so that when the box boots, it automatically starts logging, and if the
>> process disappears, it restarts it. Right?
> It seems you did all that, but didn't read the manual pages.
Oh yes, I did. That's what I started with (but didn't tell so in my
first mail).
Then you sent me on the tty00 way and I tried to figure that out (and
learned certain things, like that tty and cua are kind of pairs for
rx/tx, but didn't get into the detailed details how it's attached where
internally, etc.), but to no avail.
> In fact, what you want is entirely the defaults:
>
># cu
Sure, it look's like a very standard thing to do, but:

# cu -d -l cua00 -s 9600
cu: open("/dev/cua00"): Device not configured
# cu
cu: open("/dev/cua00"): Device not configured

So I wonder if the device is recognized at all by the kernel when it
starts. Doesn't look like so, unless it's implied with certain devices.
(The dmesg is in my first post.)

Extract of my /etc/ttys (changed it a bit to try out tty00 without getty
getting in the way):

# name  getty   typestatus  comments
#
console "/usr/libexec/getty std.9600"   vt220   off secure
ttyC0   "/usr/libexec/getty std.9600"   vt220   on  secure
ttyC1   "/usr/libexec/getty std.9600"   vt220   on  secure
ttyC2   "/usr/libexec/getty std.9600"   vt220   on  secure
ttyC3   "/usr/libexec/getty std.9600"   vt220   on  secure
ttyC4   "/usr/libexec/getty std.9600"   vt220   off secure
ttyC5   "/usr/libexec/getty std.9600"   vt220   on  secure
ttyC6   "/usr/libexec/getty std.9600"   vt220   off secure
ttyC7   "/usr/libexec/getty std.9600"   vt220   off secure
ttyC8   "/usr/libexec/getty std.9600"   vt220   off secure
ttyC9   "/usr/libexec/getty std.9600"   vt220   off secure
ttyCa   "/usr/libexec/getty std.9600"   vt220   off secure
ttyCb   "/usr/libexec/getty std.9600"   vt220   off secure
#tty00  "/usr/libexec/getty std.9600"   unknown off
tty00   noneunknown off
tty01   "/usr/libexec/getty std.9600"   unknown off
tty02   "/usr/libexec/getty std.9600"   unknown off
tty03   "/usr/libexec/getty std.9600"   unknown off
tty04   "/usr/libexec/getty std.9600"   unknown off

I also tried console:

# cu -d -l console -s 9600
Connected to /dev/console (speed 9600)

Seems configured at least -- but no data arrives. So still something is
missing.
Maybe some BIOS quirk, who knows.
Maybe someone on this list had a similar problem?

This is a very fresh install, I didn't update but reinstall completely.

Peer


--
Peer Janssen - p...@pjk.de



Re: serial input line not working

2016-09-21 Thread Theo de Raadt
> Am 22.09.2016 um 00:23 schrieb Theo de Raadt:
> >> But on that alix box, nothing seems to arrive at the serial line. I
> >> tried all of these (the  were in 0 t o5):
> >>
> >> # cu -d -l ttyC -s
> >> 9600
> >>
> >> Connected to /dev/ttyC (speed 9600)
> > Well, because that is one of the virtual console / screen
> > device.  You want to use tty00.
> Thank you. Now I get this error:
> 
> # cu -d -l tty00 -s 9600
> cu: open("/dev/tty00"): Device not configured
  
Use cua00

Look -- did you read the manual page?


 -l line
   Specify the line to use.  Either of the forms like cua00 or
   /dev/cua00 are permitted.  The default is /dev/cua00.  See cua(4)
   for information on terminal devices.  Users in group ``dialer'' are
   permitted to use cua(4) devices by default.


Did you then read follow the breadcrumps to read cua(4)

?

> I didn't find how to configure this/a device. Tried /etc/remote,
> /etc/ttys, many man pages, Absolute OpenBSD, read about line disciplines
> (but didn't find hot to configure them), etc. Also, from 5.8 on tip is
> not there any more, guess it was merged with cu or so. Or are there
> (more) framework change with doc lagging behind?
> Anyway -- any hints?
> 
> If I understood ttys correctly, I can attach my serial logger software
> (instead of getty) directly to tty00 (once I know how to configure it),
> so that when the box boots, it automatically starts logging, and if the
> process disappears, it restarts it. Right?

It seems you did all that, but didn't read the manual pages.

In fact, what you want is entirely the defaults:

   # cu



Re: serial input line not working

2016-09-21 Thread Peer Janssen
Am 22.09.2016 um 00:23 schrieb Theo de Raadt:
>> But on that alix box, nothing seems to arrive at the serial line. I
>> tried all of these (the  were in 0 t o5):
>>
>> # cu -d -l ttyC -s
>> 9600
>>
>> Connected to /dev/ttyC (speed 9600)
> Well, because that is one of the virtual console / screen
> device.  You want to use tty00.
Thank you. Now I get this error:

# cu -d -l tty00 -s 9600
cu: open("/dev/tty00"): Device not configured

I didn't find how to configure this/a device. Tried /etc/remote,
/etc/ttys, many man pages, Absolute OpenBSD, read about line disciplines
(but didn't find hot to configure them), etc. Also, from 5.8 on tip is
not there any more, guess it was merged with cu or so. Or are there
(more) framework change with doc lagging behind?
Anyway -- any hints?

If I understood ttys correctly, I can attach my serial logger software
(instead of getty) directly to tty00 (once I know how to configure it),
so that when the box boots, it automatically starts logging, and if the
process disappears, it restarts it. Right?

Peer


--
Peer Janssen - p...@pjk.de



Re: serial input line not working

2016-09-21 Thread Theo de Raadt
> But on that alix box, nothing seems to arrive at the serial line. I
> tried all of these (the  were in 0 t o5):
> 
> # cu -d -l ttyC -s
> 9600
> 
> Connected to /dev/ttyC (speed 9600)

Well, because that is one of the virtual console / screen
device.  You want to use tty00.