* Add Arduino SPI diagram for HID
* Arduino SPI wiring and configuration
* Arduino SPI Photos
* Update arduino_hid.md
Some wordsmithing and technical review, some of the parts list has been stated elsewhere but included here with some comments on different parts or other considerations.
* Add TESmart 8 port switch
* Corrected diagram
Corrected diagram of the Arduino SPI HID layout wiring
* Corrected wiring layout
Corrected wiring layout of the Arduino Pro MIcro SPI HID
* moved spi hid image to correct directory
* Updated SPI HID pictures
Updated pictures of the SPI HID wiring to match the updated circuit diagrams.
* Update arduino_hid.md
* Add SPI instructions
SPI instructions and an example end-to-end build and flash of the SPI firmware to an Arduino Micro using SPI.
This operation can be done using your RPi. Here the common steps:
## TTL Firmware
This operation can be done using your RPi (except Pi Zero W). Here the common steps:
1. Disconnect the RESET wire from the Arduino board.
2. Connect the Arduino and RPi with a suitable USB cable.
3. Log in to the Raspberry Pi using SSH (`ssh root@<addr>` with password `root` by default) or using keyboard and monitor. The Raspberry Pi obtains the network address over DHCP.
4. Upload the firmware (USB keyboard & mouse is used by default, on this step [you can choose PS/2 keyboard](arduino_hid.md#ps2-keyboard)):
1. Connect the Arduino and RPi with a suitable USB cable.
1. Log in to the Raspberry Pi using SSH (`ssh root@<addr>` with password `root` by default) or using keyboard and monitor. The Raspberry Pi obtains the network address over DHCP.
1. Upload the firmware (USB keyboard & mouse is used by default, on this step [you can choose PS/2 keyboard](arduino_hid.md#ps2-keyboard)):
```shell
[root@pikvm ~]# rw
[root@pikvm ~]# systemctl stop kvmd
@ -14,8 +16,46 @@ This operation can be done using your RPi. Here the common steps:
[root@pikvm hid]# make install
[root@pikvm hid]# reboot
```
5. Connect the RESET wire, disconnect the USB cable, and reboot the RPi.
1. Connect the RESET wire, disconnect the USB cable, and reboot the RPi.
With a Pi Zero W, you may consider building the firmware on a faster system and programming using USB or booting from another SD card and following the build steps using a clone of the kvmd repo.
## SPI Firmware
This operation can be done using your Raspberry Pi without disconnecting any wires:
1. Connect the Arduino and RPi with a suitable USB cable.
1. Log in to the Raspberry Pi using SSH (`ssh root@<addr>` with password `root` by default) or using keyboard and monitor. The Raspberry Pi obtains the network address over DHCP.
1. Build and upload the firmware (USB keyboard & mouse is used by default)
```shell
[root@pikvm ~]# rw
[root@pikvm ~]# systemctl stop kvmd
[root@pikvm ~]# cp -r /usr/share/kvmd/hid ~
[root@pikvm ~]# cd ~/hid
[root@pikvm hid]# make spi
[root@pikvm hid]# make install
[root@pikvm hid]# reboot
```
## Common Errors
### Circuit Issues
#### Common - Reset Wire
Different pins are used for the reset wire but serve a similar function. For programming the TTL firmware over USB, the reset wire should be disconnected. When programming using SPI, the reset wire needs to be connected through a transistor circuit and connected to GPIO25 (pin 22 on the GPIO header)
#### SPI-specific Wiring
The 3v3, ground, Reset (GPIO25), MISO, MOSI, SCLK, and CS1 need to be connected appropriately. SPIO_CS0 and SPIO_CS1 can both be used but the default configuration uses SPIO_CS1 for the Arduino Microcontroller (CS0 is used for another device on the v3). These generally follow a block as follows:
```
Pin 0 2 4
2 0 0
.........GR.C.......
Row # 12345678901234567890
........3MMS........
Pin 0 1 3
1 7 9
```
The most common error is an "off-by-one" error where pins are shifted by a row. Some cases have non-standard GPIO layouts so please be careful when following these instructions using a case that has a modified pinout.
### Library Compatibility
On `make install` you may encounter the following error:
```
/root/.platformio/packages/tool-avrdude/avrdude: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
@ -27,3 +67,273 @@ Create a symlink for this library:
And run `make install` again.
If you have any problems or questions, contact us using Discord: https://discord.gg/bpmXfz5
### Example SPI build + Flash
Here's an end-to-end build and flash of the SPI HID firmware using the default options as described above.