Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 1:55 pm

I am a total noob but I’m attempting to create a way to control a PC 100% by Raspberry Pi USB OTG acting as a USB keyboard (and mouse, if possible). The video from the PC would be transmitted to the Raspberry Pi via HDMI. Essentially it’s Remote Desktop except instead of using software on the PC it is 100% hardware based. Any help is greatly appreciated.

Here’s a pic of what I have in mind:

User avatar
neilgl
Posts: 3244
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 2:35 pm

The HDMI output from the PC to the pi won’t work as the pi has no HDMI input.
Can’t see the picture

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 2:41 pm

Oops. Here is the picture:
Capture.JPG
Capture.JPG (92.59 KiB) Viewed 595 times
I have also purchased a Geekworm Raspberry Pi Hdmi-in Module, Hdmi to CSI-2, Hdmi inpute Supports up to 1080p25fps Compatible with Raspberry Pi 4B/3B+/3B/Pi Zero/Zero W (https://www.amazon.com/gp/product/B0899L6ZXZ) to accommodate the HDMI input.

User avatar
thagrol
Posts: 4927
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 2:48 pm

Scottnapleton wrote:
Wed May 05, 2021 1:55 pm
I am a total noob but I’m attempting to create a way to control a PC 100% by Raspberry Pi USB OTG acting as a USB keyboard (and mouse, if possible). The video from the PC would be transmitted to the Raspberry Pi via HDMI. Essentially it’s Remote Desktop except instead of using software on the PC it is 100% hardware based. Any help is greatly appreciated.
Assuming you can get over no model Pi having any video input you'll still likely get better performance running VNC or remote desktop servers on the PC. Especially if the PC is connected vai ethernet rather than wireless.

If you can find a suitable driver I guess you could "project" the PC's display to the PI then VNC* to that, but why? Is there an IT policy stopping you running remote desktop on your PC? If so your IT department are likely to frown on attempts to bypass it.

*: and you'd still have to pass HID events both way between PC and Pi
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 2:58 pm

thagrol wrote:
Wed May 05, 2021 2:48 pm
Assuming you can get over no model Pi having any video input you'll still likely get better performance running VNC or remote desktop servers on the PC. Especially if the PC is connected vai ethernet rather than wireless.

If you can find a suitable driver I guess you could "project" the PC's display to the PI then VNC* to that, but why? Is there an IT policy stopping you running remote desktop on your PC? If so your IT department are likely to frown on attempts to bypass it.
The PC I'm connecting to is older and has been very unreliable when trying to use remote desktop software. Also it's kind of a challenge personally to see if I can pull off remotely controlling this computer by only using 100% separate hardware, regardless of cost or effort. There may be a friendly wager on the line as well. Almost a Rube Goldberg machine, if you will.

User avatar
neilgl
Posts: 3244
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 5:28 pm

Ah, I see you have bought an Hdmi-in Module, Hdmi to CSI-2 adapter, so it might work. Note that “audio is not passed through.”

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 5:43 pm

neilgl wrote:
Wed May 05, 2021 5:28 pm
Ah, I see you have bought an Hdmi-in Module, Hdmi to CSI-2 adapter, so it might work. Note that “audio is not passed through.”
Audio isn't necessary but that's good to know for future projects.

I did come across http://www.isticktoit.net/?p=1383 which seems like it might be helpful.

User avatar
thagrol
Posts: 4927
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 6:27 pm

Scottnapleton wrote:
Wed May 05, 2021 5:43 pm
I did come across http://www.isticktoit.net/?p=1383 which seems like it might be helpful.
That'll let the zero send HID events to the PC but you'll still have to get them from the remote computer to the zero.

I can see two approaches:
  1. Stream the incoming video over network/internet from the zero to your remote machine. Have software running on that machine to grab keyboard and mouse data, send it back to the zero which will forward it to the PC (with apropriate processing)
  2. Run a minimal X desktop on the zero to display the video. Expose that desktop via a VNC server. Capture and forward HID data on the zero as above.
  3. This is the funky option and depends a little on the OS the PC is running.
    • Run a USB over IP server on the remote computer to export the keyboard and mouse
    • Run a USB over IP client on the PC to grab them. On the positive side, you don't need to worry about handling low level HID stuff as once the PC's OS has booted they're just another USB device. On the negative side, keyboard and mouse won't work locally on the remote computer and won't work in the BIOS menus on the PC.
    • Stream the incoming HDMI video from the zero to the remote computer.
No idea what latency will be like and you may get better perofrmance using a 3A+ (It can do USB device/gadget mode but the config is slightly different).

A though has just occured: I have a feeling someone has already tried this. A forum and/or web search for something like "raspberry pi network kvm" might turn it up.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 6:42 pm

thagrol wrote:
Wed May 05, 2021 6:27 pm
...but you'll still have to get them from the remote computer to the zero.
For this couldn't I use a simple Remote Desktop program such as Chrome Remote Desktop? (Assuming CRD works on Raspberry Pi OS)

User avatar
thagrol
Posts: 4927
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 7:14 pm

Scottnapleton wrote:
Wed May 05, 2021 6:42 pm
thagrol wrote:
Wed May 05, 2021 6:27 pm
...but you'll still have to get them from the remote computer to the zero.
For this couldn't I use a simple Remote Desktop program such as Chrome Remote Desktop? (Assuming CRD works on Raspberry Pi OS)
No idea. Sorry. The default remote desktop application on RPiOS is VNC. Or rather one of its branches.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 7:18 pm

thagrol wrote:
Wed May 05, 2021 7:14 pm
Scottnapleton wrote:
Wed May 05, 2021 6:42 pm
thagrol wrote:
Wed May 05, 2021 6:27 pm
...but you'll still have to get them from the remote computer to the zero.
For this couldn't I use a simple Remote Desktop program such as Chrome Remote Desktop? (Assuming CRD works on Raspberry Pi OS)
No idea. Sorry. The default remote desktop application on RPiOS is VNC. Or rather one of its branches.
Ah okay. I would just use VNC, then.

User avatar
neilgl
Posts: 3244
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 8:25 pm

Hold on, earlier it was “ very unreliable when trying to use remote desktop software” but now “ I use a simple Remote Desktop program such as Chrome Remote Desktop?” ?? Over and out.

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 8:28 pm

neilgl wrote:
Wed May 05, 2021 8:25 pm
Hold on, earlier it was “ very unreliable when trying to use remote desktop software” but now “ I use a simple Remote Desktop program such as Chrome Remote Desktop?” ?? Over and out.
I meant I want to use Chrome Remote Desktop to connect to the Raspberry Pi, not the PC itself.

User avatar
thagrol
Posts: 4927
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 10:43 pm

Scottnapleton wrote:
Wed May 05, 2021 8:28 pm
neilgl wrote:
Wed May 05, 2021 8:25 pm
Hold on, earlier it was “ very unreliable when trying to use remote desktop software” but now “ I use a simple Remote Desktop program such as Chrome Remote Desktop?” ?? Over and out.
I meant I want to use Chrome Remote Desktop to connect to the Raspberry Pi, not the PC itself.
That will only help if the zero is runnning a desktop and the video coming from the PC is being displayed on said desktop. And you'l stil have to get HID events (keyboard and mouse data) from the zero to the PC. In both directions (keyboard LEDs are controlled by the USB host not the keyboard).

I'm going to assume you didn't bother with the search I sugested earlier so I'll save us all some time and repetition by doing so for you.

Have a look at at least the first three links returned: https://www.google.com/search?q=pi+as+network+kvm
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Scottnapleton
Posts: 8
Joined: Wed May 05, 2021 1:49 pm

Re: Control PC exclusively with Raspberry Pi Zero W

Wed May 05, 2021 11:17 pm

thagrol wrote:
Wed May 05, 2021 10:43 pm
Scottnapleton wrote:
Wed May 05, 2021 8:28 pm
neilgl wrote:
Wed May 05, 2021 8:25 pm
Hold on, earlier it was “ very unreliable when trying to use remote desktop software” but now “ I use a simple Remote Desktop program such as Chrome Remote Desktop?” ?? Over and out.
I meant I want to use Chrome Remote Desktop to connect to the Raspberry Pi, not the PC itself.
That will only help if the zero is runnning a desktop and the video coming from the PC is being displayed on said desktop. And you'l stil have to get HID events (keyboard and mouse data) from the zero to the PC. In both directions (keyboard LEDs are controlled by the USB host not the keyboard).

I'm going to assume you didn't bother with the search I sugested earlier so I'll save us all some time and repetition by doing so for you.

Have a look at at least the first three links returned: https://www.google.com/search?q=pi+as+network+kvm
I did a Google search as you suggested and came across https://www.tomshardware.com/how-to/kvm ... spberry-pi which appears should work out perfectly. I’m going to get started on it tomorrow and I’ll report back how it turns out.

Return to “Other projects”