A keyboard/mouse switch that works on a Raspberry Pi Zero over bridged ethernet or a Raspberry Pi Zero W over Wi-FI.
- Flash Raspbian Lite on a Micro SD card
- On the flashed card, edit
/boot/config.txt
to havedtoverlay=dwc2
/etc/modules
to havedwc2
andlibcomposite
/etc/rc.local
to have/home/pi/hid-emu/usb_device_emu
beforeexit 0
/etc/systemd/system/dhcpcd.service.d/wait.conf
to haveExecStart=/usr/lib/dhcpcd5/dhcpcd -b -q %I
instead of the previous command. Speeds up boot by ~30 seconds when a DHCP server is not immediately available.
- Clone this repository to
/home/pi/
- Boot the Pi with the card
- If not using Wi-Fi, bridge the RNDIS interface with your ethernet interface to get LAN (and internet) access
- Use your preferred method to secure the connection between
client.py
(ran on the device that has the keyboard) andserver.py
(ran on the Pi on boot). By default the connection is over plain TCP socket. Remember to editserver.py
so that it doesn't listen to all interfaces. - Run client.py