Fmstrat / diy-ipmi

A DIY IPMI / IP KVM system utilizing the Raspberry Pi
897 stars 100 forks source link

Modified from Fmtstrat repo to be systemd service based with keyboard… #26

Open spyd3rweb opened 5 years ago

spyd3rweb commented 5 years ago

… and video working over the network. Simply flash the Pi3 and Pi0 with the lastest Raspbian and update the diy-ipmi-environment variables per you environment (a static ip address is recommended for all devices), and use install-w.sh to automate the installation.

Fmstrat commented 5 years ago

Wow, thanks for putting so much work into the project! So, there is a LOT in this PR for review. Rather than ask for PRs from separate branches for each, could you give me a bit more info on what you have done for the additional video devices? I want to make sure if someone is using different video devices, or not using the one you are, that the appropriate options are in place to have the right processes running. For instance, how is the video device type and keyboard device defined in the config file for working with multiple servers? Thanks.

spyd3rweb commented 5 years ago

@Fmstrat

For multiple server support the ipmi.conf file is still used the exact same way it was previously. When using this pull request's install-w.sh file, with a LKV373A for video and a Pi0 Wireless for a keyboard, the video device (/dev/video0) is still v4l2 and the keyboard device is still a tty, they are simply now both virtual devices.

My use case for diy-ipmi is for using a single video and keyboard device as a web/ip front end for a KVM Switch with hotkey support (https://www.ebay.com/itm/IOGEAR-16-Port-VGA-KVM-Miniview-Ultra-GCS1716/302811391821). Unfortunately, I can't yet use the hotkey to switch devices, as I have to find a way around the lack of BOOT Mode support for the Pi0 HID device when using the default libcomposite and usb_f_hid modules.

I broke out all the systemd units to help with debugging, but there's nothing really preventing the consolidation of systemds unit for video and keyboards using multiple calls to ExecStartPre and ExecStart. Currently the install-w.sh references a single diy-ipmi-environment variable file for configuring and enabling the systemd units for the Pi3 and Pi0. On start the systemd units also import information from the diy-impi-environment variable file. Currently the systemd units have static ports set for which they send and listen:

Keyboard network flow:

(Pi0 W) -- SSL 4433 --> (Pi3)

Video network flow:

(LKV373A) -- UDP 5004--> (Pi3:eth0) -- UDP 5005 --> (Pi3:lo)

For the Pi3 video (LKV373A) services:

For the Pi3 keyboard services:

For the Pi0 W keyboard service:

Utlimately there's nothing I'm aware of that would prevent using multiple network based video or keyboard devices; each additional set of Pi0/LKV373A would simply have to be configured to send to the Pi3 on different ports. Two quick ways of going about this:

seffyroff commented 5 years ago

as I have to find a way around the lack of BOOT Mode support for the Pi0 HID device when using the default libcomposite and usb_f_hid modules.

I'd welcome some digging into this, assuming what you're referencing here is the ability for the Pi0 USB Keyboard device to be enumerated by the BIOS?

spyd3rweb commented 5 years ago

I had done some additional digging a couple weeks back, and actually found that the libcomposite and usb_f_hid modules do infact work with my KVM Hotkey and OSD; which we've been assuming requires boot mode support based on this thread (https://github.com/Fmstrat/diy-ipmi/issues/15).

Unfortunately it seems the javascript/php that diy-ipmi currently uses to send key strokes doesn't actually send all of the mod and/or function keys needed, and I was only able to confirm my KVM support by manually using the sendkeys program directly on the Pi0.