Disable com-port with software

Hey there,

I am trying to use an aruino leonardo as a keyboard. I have use the keyboard library and everything is working as intended when attached to a computer.

Since the arduino is supposed to control a kvm-switch it has to be an HID only device, so I need to disable the com port. To be able to access the arduino later again, this action should be triggert via an input pin and therefore I need a software solution.

Any ideas of tips on how to accomplish this behavior? I could only find solution that modify the usb config while flashing the sketch, but this would prevent a software toggle und brick the board forever.

Thanks for your help :slight_smile:

You need to provide a bit more information. Can you give a diagram of the overall setup? Multiple Leonardos are each a keyboard connected to a PC via KVM? Multiple devices are connected to the KVM, one of which is the Leonardo? What is the part number of the KVM? To my knowledge, a USB device can have more than one class, ADC, CDC, HID, MSC and custom. I don't know if that answers your question because I don't completely understand what you are doing.

Déjà vu: https://forum.arduino.cc/index.php?topic=721212.0.
Short story: As far as I know, it is not possible. There might be a few things worth investigating.

Perehama:
You need to provide a bit more information. Can you give a diagram of the overall setup? Multiple Leonardos are each a keyboard connected to a PC via KVM? Multiple devices are connected to the KVM, one of which is the Leonardo? What is the part number of the KVM? To my knowledge, a USB device can have more than one class, ADC, CDC, HID, MSC and custom. I don't know if that answers your question because I don't completely understand what you are doing.

I am using an Aten CS1944DP. This KVM supports KVM commands via keyboard. This keyboard must be plugged into the console keyboard port.
I recently switched my keyboard to a new one with n key roll over. Since I had problems using this new keyboard with my KVM I contacted the Aten support to figure out the exact specs the KVM supports. The techniciann stated that key roll over is not supported due to its implementation of registering multiple HID devices. When more than one USB device (or one device with multiple internal parts) is connected to the console keyboard port of the KVM no command detection is availible.
Additionally I have a USB hub, two monitors and four computers connected to the KVM, but I guess that is pretty irrelevant.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.