Resetting a serial port

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Resetting a serial port

Andrea Venturoli
Hello.

I've got a box connected to an hardware device through a serial port.
This is a real RS-232 on the motherboard, not an USB adapter.

 From time to time, the serial port will got stuck and stop
communicating with the device.
This is not a problem with the device, as powering it on and off won't
help. Instead rebooting the whole FreeBSD server will solve.

This box, however, is running several services, several jails and a
couple of bhyve VMs, so rebooting it all is... somewhat troublesome at
the least.

Is there anything I can try (hopefully a long time from now) to get the
serial port back working without a real reboot?

  bye & Thanks
        av.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Resetting a serial port

Polytropon
On Tue, 19 Mar 2019 17:57:41 +0100, Andrea Venturoli wrote:
> I've got a box connected to an hardware device through a serial port.
> This is a real RS-232 on the motherboard, not an USB adapter.
>
>  From time to time, the serial port will got stuck and stop
> communicating with the device.
> This is not a problem with the device, as powering it on and off won't
> help. Instead rebooting the whole FreeBSD server will solve.

I have successfully done this with a parallel port
(a _real_ one, not an USB adapter):

        # /usr/bin/true > /dev/lpt0

Maybe the corresponding serial device can be reset
in the same way?


--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Resetting a serial port

Matthias Apitz-4
Am Dienstag, 19. März 2019 19:39:07 CET schrieb Polytropon
<[hidden email]>:
> On Tue, 19 Mar 2019 17:57:41 +0100, Andrea Venturoli wrote:
>> I've got a box connected to an hardware device through a serial port.
>> This is a real RS-232 on the motherboard, not an USB adapter.
>>
>>  From time to time, the serial port will got stuck and stop
>> communicating with the device.
>> This is not a problem with the device, as powering it on and off won't
>> help. Instead rebooting the whole FreeBSD server will solve.
>

What software is running on that serial interface? What is the exact device
name?

matthias



--
Sent from my Ubuntu phone
http://www.unixarea.de/
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Resetting a serial port

Andrea Venturoli
In reply to this post by Polytropon
On 3/19/19 7:39 PM, Polytropon wrote:

> # /usr/bin/true > /dev/lpt0
>
> Maybe the corresponding serial device can be reset
> in the same way?

In case it locks again (it did two times the last month, but it hadn't
happened for years), I'll try.
Thanks.

  bye
        av.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Resetting a serial port

Andrea Venturoli-4
In reply to this post by Matthias Apitz-4
On 3/19/19 9:05 PM, Matthias Apitz wrote:

> What software is running on that serial interface?

http://weewx.com/

When the serial port locks, however, I kill it and just try /usr/bin/cu.



> What is the exact device name?

/dev/ttyu0



  bye
        av.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Resetting a serial port

Matthias Apitz-4
In reply to this post by Andrea Venturoli
El día Wednesday, March 20, 2019 a las 08:04:55PM +0100, Andrea Venturoli escribió:

> On 3/19/19 7:39 PM, Polytropon wrote:
>
> > # /usr/bin/true > /dev/lpt0
> >
> >Maybe the corresponding serial device can be reset
> >in the same way?
>
> In case it locks again (it did two times the last month, but it hadn't
> happened for years), I'll try.
> Thanks.

Note: In the command shown above the '/usr/bin/true' does nothing with
the TTY. It is the shell opening the device for writing. I in your case
would write some C-pgm to uses the syscalls open(2) and ioctl(2) to get
information about the device status.

        matthias
--
Matthias Apitz, ✉ [hidden email], http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba
instead of Nazis, to live instead of to survive.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"