Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
TakEhan committed Aug 16, 2023
1 parent d39ae78 commit 9b8b5e4
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
65 changes: 59 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,76 @@ Anker make good ones- I used a 3m white one for my tests.

Our USB-C to USB-A is great if you're using a USB-A port (but make sure it's a *high power* one): https://shop.pimoroni.com/products/usb-c-to-usb-a-cable-1m-black

For the shortage of power supply, ELECOM makes a splitter that PD via USB-C and data link via USB-A: https://www.elecom.co.jp/products/MPA-CAPDBK.html

A Raspberry Pi Mouse is also supported if plugged in, eg: https://shop.pimoroni.com/products/raspberry-pi-mouse?variant=29390982119507

Following mice works: https://www.elecom.co.jp/products/M-Y8UBPN.html

This project started out life as a gist - https://gist.github.com/Gadgetoid/5a8ceb714de8e630059d30612503653f

Thank you to all the people who dropped by with kind words, suggestions and improvements.

- [YASetup](#yet-another-setup)

--Original--
- [Quickstart (Ish)](#quickstart-ish)
- [Mouse Support](#mouse-support)
- [Building & Contributing](#building--contributing)
- [Building](#building)
- [Custom Mouse/Keyboard Devices](#custom-mousekeyboard-devices)


## Yet another setup
```
sudo apt install libconfig-dev git cmake
git clone https://github.com/Gadgetoid/pi400kb
cd pi400kb
git submodule update --init
mkdir build
cd build
cmake ..
make
chmod +x pi400kb
ln -s ./pi400kb /usr/sbin/pi400kbl
sudo systemctl edit --force --full pi400kb.service
```
It is need to add `dtoverlay=dwc2` to `/boot/config.txt`.
Then reboot.
On the terminal, type `sudo modprobe libcomposite`.
```
cd ..
mv pi400kb.service /etc/systemd/system/pi400kb.service
mv modprobe.service /etc/systemd/system/modprobe.service
sudo systemctl enable pi400kb.service
sudo systemctl enable modprobe.service
```
Or use /etc/modules-load.d/modules.conf instead of enabling.

However, it is recommended to test before enabling services by following commands.
```
sudo systemctl start pi400kb.service
sudo systemctl start modprobe.service
sudo systemctl status pi400kb.service
sudo systemctl status modprobe.service
```

Press `Ctrl + Raspberry` to grab/release your keyboard and mouse, switching between local use and USB.
Press `Ctrl + Shift + Raspberry` (on the grabbed keyboard) to exit. (This exit means break of detection loop)


## Modifications
### Simply implementation
- improve error handling #25 DeeNewcum:main
- Pass through all the devices #41 Daft-Freak:all-the-devices
- Adds the modprobe.service on startup #33 tigertank591:main

### Modification
- Modify the key to grab/release keyboard and mouse from the host #27 Shuya4
- DeeNewcum:pi400kb


# Original
## Quickstart (Ish)

Add `dtoverlay=dwc2` to `/boot/config.txt`
Expand All @@ -25,8 +83,6 @@ Reboot!

`sudo modprobe libcomposite`

//alt?: libcompositeが/etc/modulesに書かれている必要がある。らしい。#19#39に対する対応らしい。

Grab the latest pi400kb for your system from releases: https://github.com/Gadgetoid/pi400kb/releases

`chmod +x pi400kb`
Expand All @@ -41,6 +97,7 @@ Press `Ctrl + Raspberry` to grab/release your keyboard and mouse, switching betw

Press `Ctrl + Shift + Raspberry` (on the grabbed keyboard) to exit.


### Mouse Support

Pi 400 KB supports the official Raspberry Pi Mouse VID:PID = 093a:2510 by default, but other mice should work.
Expand Down Expand Up @@ -98,7 +155,3 @@ Supply these arguments when configuring with CMake, eg:
```
cmake .. -DMOUSE_DEV="/dev/input/by-id/usb-EndGameGear_XM1_Gaming_Mouse_0000000000000000-event-mouse" -DMOUSE_VID=0x3367 -DMOUSE_PID=0x1903
```



modprobe.service: Adds the modprobe.service on startup #33, tigertank591:main
2 changes: 1 addition & 1 deletion pi400kb.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=pi400kb USB OTG Keyboard & Mouse forwarding

[Service]
ExecStart=/usr/bin/pi400kb
ExecStart=/usr/sbin/pi400kbl
User=root
Group=root
Type=simple
Expand Down

0 comments on commit 9b8b5e4

Please sign in to comment.