Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

spyd3rweb
Copy link

… 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.

… 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.

- Raspberry Pi Zero W (https://www.adafruit.com/product/3400)
- LKV373A HDMI Extender (https://www.eevblog.com/forum/reviews/lkv373a-hdmi-streamer-my-findings/) (https://www.amazon.com/AEMYO-Extender-V3-0-Ethernet-Supports/dp/B01LGUT9HW/)
- SainSmart Web Relay (Not implemented yet) (https://www.amazon.com/SainSmart-Channels-Ethernet-Controller-Compatible/dp/B00NBGGCHK/)
Modified from Fmtstrat repo to be systemd service based with keyboard…
@Fmstrat
Copy link
Owner

Fmstrat commented Nov 6, 2018

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
Copy link
Author

@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:

  • diy-ipmi-video-lkv373a: uses http to configure the LKV373A to send FHD/HD/SD video to UDP port 5004 directly to the Pi3 (unicast vs multicast)
  • diy-ipmi-video-lkv373a-unicast: uses socat to remove 0 length udp packets from UDP port 5004 and forwards the udp to loopback 5005
  • diy-ipmi-video-lkv373a-video0: uses ffpmeg to take the h264/mpegts stream from UDP port 5005 and outputs rawvideo to a virtual v4l2loopback device.

For the Pi3 keyboard services:

  • diy-ipmi-keyboard-pty: uses socat to create and link two virtual tty/pts (TTY0/TTY1)
  • diy-ipmi-keybaord-pty-shell: uses socat to listen for ssl on port 4433 and pipe to virtual pts TTY0.

For the Pi0 W keyboard service:

  • diy-ipmi-keyboard-shell: uses socat to pipe bash over ssl to port 4433 of the Pi3

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:

  • Modify install-w.sh to create uniquely named diy-ipmi-environment variable files and duplicate systemd services (diy-ipmi-video* and diy-ipmi-keyboard*) for each LKV373A/Pi0 Set
  • Create a more intelligent systemd services that are able to fork multiple socat/ffmpeg processes based off a config with multiple sets of LKV373A (VID SERVER) and Pi0 W (HID SERVER)

@seffyroff
Copy link

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
Copy link
Author

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 (#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants