Automatically reconnecting a keyboard with an intermittent USB connection

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
cograil
Level 1
Level 1
Posts: 39
Joined: Tue Jul 26, 2016 12:33 pm

Automatically reconnecting a keyboard with an intermittent USB connection

Post by cograil »

I'd like to run Mint on an old Dell Venue convertible with a detachable keyboard. When the tablet is docked with the keyboard it's a 11" laptop. Unfortunately the connection between the keyboard and tablet has become less than perfect after a few years of daily use.

I've repeatedly tried running Mint on it and everything works great with the exception of the keyboard. Mint sees the keyboard as a USB device, but with Mint once the keyboard connection is lost it often remains lost until I restart. (Window 10 has lots of problems and crashes 4x a day, but it does consistently re-establish the keyboard connection automatically.)

Is there any method in Mint to monitor the connection with the keyboard and restart that interface automatically it if it is lost?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Automatically reconnecting a keyboard with an intermittent USB connection

Post by Moonstone Man »

cograil wrote: Fri Apr 16, 2021 4:35 pm Is there any method in Mint to monitor the connection with the keyboard and restart that interface automatically it if it is lost?
It is possible to monitor USB devices but I doubt anything will help in this case, except perhaps retiring the machine. The Windows crashing is telling you something, and just because it doesn't happen in Linux, it doesn't follow that Windows is the issue.

Anyway, what you want is not feasible and probably not possible either. If the USB connection goes away, the operating system has no way to know the difference between the USB being disconnected by you or because the connection failed. USB ports use sensing to detect a peripheral, and if the connection has gone away then power to the port is removed, so the only way to reactivate it is to unplug then re-plug the device. This is by design.

Windows crashing and disappearing USB devices are symptoms of your machine being on its last legs. If you want to keep using this machine, you'll just have to put up with whatever it throws at you, including the loss of all your data.
cograil
Level 1
Level 1
Posts: 39
Joined: Tue Jul 26, 2016 12:33 pm

Re: Automatically reconnecting a keyboard with an intermittent USB connection

Post by cograil »

In this case the tablet sans keyboard is fine.

Under Windows 8.1 the system was very stable and crashes were unusual, maybe once every couple of months. The constant BSOD's started after updating to W10 three weeks ago. Although W10 is fully supported on the hardware, it is just not stable.

Mint (and other Ubuntu based distros) are also very stable on this tablet. Even the display scaling and touchscreen support are pretty good in Mint. The only real issue I've had is the keyboard connection.

I was hoping there was some way to write a script to check for the keyboard regularly and then reset the port if it wasn't present. Since that isn't possible I guess I'm going to try to fall back to W8.1, not an appealing option but better than junking the system.

Thanks much for the reply.
cograil
Level 1
Level 1
Posts: 39
Joined: Tue Jul 26, 2016 12:33 pm

Re: Automatically reconnecting a keyboard with an intermittent USB connection

Post by cograil »

Apparently what I'm trying to do IS possible. I'm adding a link here for anyone else who is trying to reset USB devices.

Unplug and plug in again a USB device in the terminal:

https://askubuntu.com/questions/1036341 ... e-terminal
Locked

Return to “Hardware Support”