Most active commenters
  • mtlynch(17)
  • Nexxxeh(3)

←back to thread

756 points mtlynch | 60 comments | | HN request time: 1.046s | source | bottom
1. mtlynch ◴[] No.23927535[source]
Author here. Happy to answer any questions or take any feedback about this post.
replies(13): >>23928048 #>>23928079 #>>23928102 #>>23928108 #>>23928824 #>>23929025 #>>23929273 #>>23931092 #>>23931871 #>>23931962 #>>23932019 #>>23932032 #>>23935887 #
2. pdevine ◴[] No.23928048[source]
Dude, thanks so much for this. I have a loud machine I’m using for ML stuff and I’ve been reluctant to move it to the basement as I didn’t want to have to run downstairs with a monitor for the odd issue. I also looked at KVMs and was annoyed at the prices. I have a R Pi sitting here I was looking to do a project with. This is perfect!
replies(1): >>23928566 #
3. simlevesque ◴[] No.23928079[source]
How would you remotely connect to something like this ? using something like ngrok ?
replies(2): >>23928584 #>>23932089 #
4. ghaberek ◴[] No.23928102[source]
Would a Pi Zero W work for this, or do you need a full-size Pi 4? I would think that with the HDMI dongle doing the hardware MJPEG encoding, a Pi Zero might suffice. It'd be really neat to A) bring the cost down another $30 and B) be able to package everything into a tiny 3D printed case.
replies(3): >>23928203 #>>23929540 #>>23932694 #
5. wojciii ◴[] No.23928108[source]
Cool project, but what about power management? What happens if the PC being controlled crashes and does not let you reboot it using keyboard shortcut?

I'm might be damaged by testing and working with embedded development.

replies(5): >>23928235 #>>23928413 #>>23928441 #>>23928912 #>>23931560 #
6. mtlynch ◴[] No.23928203[source]
Thanks for reading!

>Would a Pi Zero W work for this, or do you need a full-size Pi 4?

I tested Key Mime Pi (the keyboard-only version) on the Pi Zero W and it worked great. I haven't tested TinyPilot on the Pi Zero W, but I think it will work. The video encoding is happening in the HDMI dongle, so it doesn't hammer resources much. I don't have a USB to microUSB adaptor on hand, but I'll order one now and see if it works.

>be able to package everything into a tiny 3D printed case.

Yeah, that would be neat! One of the biggest issues I have with TinyPilot's setup right now is that it looks kind of like a bunch of random hobbyist parts stuck together. A 3D printed case would be good and wouldn't have the heat issues that Pi 4 has.[0]

[0] https://www.jeffgeerling.com/blog/2019/best-way-keep-your-co...

replies(2): >>23929197 #>>23930046 #
7. swsieber ◴[] No.23928235[source]
If you can plug stuff into it, just use the KVM from a laptop and sit by it.
8. fanatic2pope ◴[] No.23928413[source]
Plug it into a smart outlet running tasmota.
9. mtlynch ◴[] No.23928441[source]
Thanks for reading!

>Cool project, but what about power management? What happens if the PC being controlled crashes and does not let you reboot it using keyboard shortcut?

Yeah, that's one of the limitations. TinyPilot can't control power for the target computer.

I don't know of any way to manage power without connecting the Pi to the target machine's motherboard, but that increases complexity significantly. I'm using this for a homelab, so it's easy for me to walk over and cycle power if that ever comes up, but for this to support more remote scenarios, I'd need to address this.

replies(6): >>23929351 #>>23929756 #>>23930250 #>>23931740 #>>23932602 #>>23934536 #
10. mtlynch ◴[] No.23928566[source]
Oh, that's great! So glad it was helpful!
11. mtlynch ◴[] No.23928584[source]
Yeah, I haven't looked into that much because everything is on my local network. ngrok looks like it would work. One of my users is looking into remote.it, which seems like a similar service.
replies(2): >>23929621 #>>23931063 #
12. tinco ◴[] No.23928824[source]
This is epic, I run a small computer cluster using workstation hardware (AMD 3970X's) and no IPMI boards exist. If I get some time I might build 7 of your little system to manage them all. Thanks!
replies(1): >>23928969 #
13. zyx321 ◴[] No.23928912[source]
If you need access to the power and reset, you can replace the respective buttons with a cheap relay switch controlled by GPIO. If you know what you're doing you can also solder your own circuit using opto-isolators instead of relays, to reduce the power draw on the Pi.
replies(1): >>23929195 #
14. mtlynch ◴[] No.23928969[source]
Awesome! I'd love to hear how it turns out.
15. silverp1 ◴[] No.23929025[source]
Any thoughts on how this could work with VGA for example?
replies(1): >>23931928 #
16. hedora ◴[] No.23929195{3}[source]
This isn’t a bad choice:

https://wiki.52pi.com/index.php/DockerPi_4_Channel_Relay_SKU...

It’s $17 for four relays, expandable to 16. If you wire it “normal closed” then the relays will only draw power while it’s resetting the other machine.

However, the relays are only rated for 3 amps. (360W at 120V). Also, the board is labeled backwards so, the NO port is normal closed, and NC is normal open.

Has anyone found something that’s similarly plug and play with a higher amperage rating?

Edit: this would work as a switched AC outlet (to replace a four outlet PDU) or for hot wiring the power / reset buttons. You could do both buttons and the AC line and have a relay left over.

I’d feel funny running AC that close to the lower button wires though (if cross those wires, it will certainly let the magic smoke out of your motherboard).

replies(1): >>23938543 #
17. cricalix ◴[] No.23929197{3}[source]
You might also be able to use the "standard" radio kit metal boxes - tap some standoffs, carefully drill some holes for wires etc. Dunno which works out better for the world - ordering a pre-fab metal box that you have to do some work on (or perhaps use https://www.frontpanelexpress.com/ to get a customised enclosure), or printing something from plastic. Might depend on production volume, metal used etc.
18. tlamponi ◴[] No.23929273[source]
Really nice, exactly what I need just now as I'm setting up a remote workstation/part-time server at my families farm, but did not have a motherboard with IPMI/iKVM at hand.

Oh, and thanks for using Proxmox VE! Was positively surprised when I saw our installer flash up out of nowhere :)

replies(1): >>23931912 #
19. baq ◴[] No.23929351{3}[source]
hook up a gpio pin to a reset switch jumper somehow?
20. Deathmax ◴[] No.23929540[source]
I think you might run into a lack of connectivity on the Pi Zero W. Since the only data USB port has to run in device mode, I would assume you can't connect the HDMI capture device.
21. gyrgtyn ◴[] No.23929621{3}[source]
zerotier
22. wojciii ◴[] No.23929756{3}[source]
APC produces (or rebranded) power control modules you can control over Ethernet. They are probably expensive.

There are most likely cheaper products which would work. You should probably implement some kind of power control interface that could be used. Calling a shell script would be enough and some example implementations provided by your users. :) It doesn't need to be complicated.

23. trm42 ◴[] No.23930046{3}[source]
Do you happen to have any idea, whether older RPIs like 1 or 2 could work for this fast enough? Have some of those laying around.
replies(1): >>23931027 #
24. oakwhiz ◴[] No.23930250{3}[source]
Perhaps a fake USB device that issues power or sleep button requests could work. I had limited success with this on Linux using an HID keyboard emulator. However this won't work on a machine that's too far gone to respond to USB, and that's also an issue with the physical power button as well. Perhaps an AC latching relay would work to cut power.
25. mtlynch ◴[] No.23931027{4}[source]
The video capture part should work, but I don't believe they support USB OTG, so they wouldn't be able to impersonate the keyboard.

The official documentation[0] says all Pi devices have USB OTG, but I'm not sure if there's something else about the Pi 4 and Pi Zero W that allows USB gadget mode because I've never found anyone talking about using it before recent generations of Pi. This StackExchange answer says the A and the A+ had it, but that the 2 doesn't.[1]

[0] https://www.raspberrypi.org/documentation/hardware/raspberry... [1] https://raspberrypi.stackexchange.com/questions/71613/how-to...

replies(2): >>23931264 #>>23934089 #
26. jimatremoteit ◴[] No.23931063{3}[source]
I work for remote.it. If you or your users need any help setting up remote access to the TinyPilot let us know. This looks like a great application. We can make ssh/VNC/http on the Pi available remotely over internet as a free service no problem.
replies(1): >>23931896 #
27. da39a3ee ◴[] No.23931092[source]
This isn't an area I know anything about but I really enjoyed your write-up (I still don't know what KVM stands for! But I get that you wanted to act as a physical keyboard and display over IP). From a quick skim of your site it looks like you've worked at large companies and now are doing some independent projects. Do you think you'll go back to working for a company (perhaps a smaller one?), or do you see yourself working independently for many years? I ask because (a) I'm also casting about at a similar point in my career doing independent projects, but (b) I've never worked at a truly large company, and (c) (someone like) you seem(s) like you'd be a great colleague to work with, and (d) my vague ambition is to work for a small company with skilled colleagues that I can learn from and to work on "technical" projects as opposed to product development but (e) I guess, when I see talented people such as yourself apparently rejecting the conventional job market, I partly infer that they've looked at what's on offer and declined and thus that I'm deluding myself in thinking that I'll find something in the conventional job market that I really want.
replies(1): >>23932081 #
28. Scaevolus ◴[] No.23931264{5}[source]
I'd expect the Pi Zero W to be fast enough to pass through the MJPEG stream and impersonate the keyboard, which should cut the cost by $20+ plus however much you save on not needing a fancy case.
replies(2): >>23931891 #>>23932517 #
29. FatalException ◴[] No.23931560[source]
If the motherboard of the PC being controlled supports Wake-on-Lan that may be a viable option to send a packet from the local subnet to boot up the computer. https://en.wikipedia.org/wiki/Wake-on-LAN
30. davidzweig ◴[] No.23931740{3}[source]
Wake-on-Lan can handle powering on. It should be possible to directly connect a RPi GPIO pin directly to the 0.1" headers on the motherboard.. the power and reset buttons are just closing a circuit to pull high/pull low an input pin. Use a 1k resistor between the Rpi and motherboard headers for protection.
31. PaulKeeble ◴[] No.23931871[source]
Have you looked at a solution for controlling the power on/off yet? This was something I was considering to do with a Raspberry PI and a relay and I figure it is the final part of the solution for when the machine inevitably crashes. Admittedly if its just across the room it was less of a concern but I have had the need to restart while I was away before and it would be nice to be part of the solution.
replies(1): >>23932686 #
32. mtlynch ◴[] No.23931891{6}[source]
Yeah that's true. I stopped thinking about the Pi Zero W early in the project because I assumed it would choke on video encoding. When I discovered that the HDMI dongle was doing the heavy lifting, I forgot to revisit that assumption. I'm going to order an USB to micro-USB adaptor to test it out because it would slim things down significantly.
replies(1): >>23934283 #
33. mtlynch ◴[] No.23931896{4}[source]
Oh, that's awesome. Thank you!
34. mtlynch ◴[] No.23931912[source]
Wow, thank YOU for making Proxmox! I'm switching over after three years of Kimchi[0], and Proxmox does everything so much better.

[0] https://github.com/kimchi-project/kimchi

replies(1): >>23937291 #
35. mtlynch ◴[] No.23931928[source]
I believe it should work with a VGA to HDMI adaptor, as another commenter suggested[0], though I haven't tested this personally.

[0] https://news.ycombinator.com/item?id=23928401

36. tootie ◴[] No.23931962[source]
If this just requires USB and HDMI, it should theoretically work identically a for Mac Mini or even something like a Fire TV, yes? Is there an upper limit on resolution and frame rate for the dongle?
replies(1): >>23932166 #
37. Uhhrrr ◴[] No.23932019[source]
I love how this is a project which puts together several different projects which are themselves the product of significant amounts of effort: RPi, the HDMI-USB dongle, the browser, and uStreamer. I think we are in for an interesting decade or so of people plugging things together like this.

I'm curious why you use the browser instead of ffplay for decoding and display. I'd guess ffplay would be faster - but maybe not?

replies(1): >>23932463 #
38. fock ◴[] No.23932032[source]
and today I was wondering how to solve the video problem! that's great timing.
39. mtlynch ◴[] No.23932081[source]
Thanks for reading!

>I still don't know what KVM stands for!

Oh, keyboard, video, mouse. The article does define it, but it's a little buried.

>From a quick skim of your site it looks like you've worked at large companies and now are doing some independent projects. Do you think you'll go back to working for a company (perhaps a smaller one?), or do you see yourself working independently for many years?

I'd love to continue working for myself forever. My ideal would be if I could find a business sustainable enough that I can hire 2-5 developers and other teammates to work with me. If I did have to go back to being an employee, I'd probably lean toward something smaller.

It's very much about your temperament, what type of work you enjoy, and how much you value flexibility and autonomy. A good way to test the waters is by building a side business and see if you enjoy it more than your job. You can also read/hear more about the lifestyle in places like Indie Hackers[0], Starter Story[1], and WIP[2].

But I agree with you that you pass up certain kinds of growth by working on your own. I'm happy that I had ~10 years of experience with big companies before doing my own thing. I learn a lot on my own, but I don't think I could have learned a lot of my software "craftsmanship" kind of skills (e.g., designing for maintainability, creating repeatable, well-documented processes) had I not worked for Google and Microsoft.

[0] https://indiehackers.com

[1] https://starterstory.com

[2] https://wip.chat

40. fock ◴[] No.23932089[source]
or VPN on your router? or just get a VPS and run wireguard.
41. mtlynch ◴[] No.23932166[source]
>If this just requires USB and HDMI, it should theoretically work identically a for Mac Mini or even something like a Fire TV, yes?

I believe so, but with the caveat that I haven't tested it. Does Fire TV take USB keyboard input?

I have successfully captured video from a Roku Premiere[0], even though it's HDCP protected. The LKV373A couldn't capture anything out of it, but the $11 dongle did just fine. But that was just video capture. I didn't have a way of sending input to the Roku.

>Is there an upper limit on resolution and frame rate for the dongle?

Yes, the limit is 1280x720px @ 30FPS.

[0] https://twitter.com/tinypilotkvm/status/1277994838210875392

replies(1): >>23935016 #
42. mixmastamyk ◴[] No.23932463[source]
For one, it wraps the screen and input into one window. Using two would be unwieldy.
43. ◴[] No.23932517{6}[source]
44. Nexxxeh ◴[] No.23932602{3}[source]
A horrible way would be to set the target to power on after power loss. Plug the target into a WiFi-controlled smart plug, like the Belkin Wemo. In the event of catastrophic hard lock, power cycle it at the wall.

A better way would be a relay and microcontroller, which you could also potentially use for the USB HID stuff too.

In theory, you could have a HDMI switch, a single Pi and HDMI grabber, and just a microcontroller board for each target machine that could have power button control, keyboard emulation etc built in.

45. MayeulC ◴[] No.23932686[source]
This is a pretty simple thing to achieve electrically, just plug something instead of the power button inside the computer. You likely just need one mosfet. If soldering is too uncomfortable, you can find relays to control the main power supply (requires screwing a power supply cable and a couple dupont connectors).

If you don't want to touch anything related to electronics, you could rely on enabling a watchdog on boot-up. Or control if from a smart power supply (you likely have a UPS plugged in, for instance). Use the power after power loss BIOS feature, or WoL to wake it up.

46. Nexxxeh ◴[] No.23932694[source]
The immediate issue would be the Pi Zero W only has one usable (micro)USB port, the other port is Power In only. If you run it for OTG, you can't use it for the dongle.

There would be ways around this though, perhaps using a cheap microcontroller for the USB HID stuff.

replies(1): >>23932779 #
47. ghaberek ◴[] No.23932779{3}[source]
Yeah I forgot that only one of the USB ports actually does data. I guess you could use a Teensy that interfaces through the GPIO pins and pretends to be the keyboard and mouse.
replies(1): >>23933032 #
48. Nexxxeh ◴[] No.23933032{4}[source]
That's what I'm thinking, or worst case, one that communicated via USB to TTL adaptors. Or an ESP-based board that connects over WiFi. Or BT-enabled board.

Combined with a HDMI switch, you could then control multiple devices with just one Pi+Cap device.

I've been looking to do something similar for a while, albeit possibly with Windows as that's where I've (very rusty Delphi) programming experience.

49. gruturo ◴[] No.23934089{5}[source]
Any Pi with just one USB port (zero, A, A+, 3A) is capable of USB gadget mode because there is no hub between the SOC and the port.

Those with multiple ports have a hub in between and are not capable of gadget mode.

The pi 4 is an exception, it is capable of gadget mode on its USB-C power input, not via the normal ports as there is a hub in between there too.

50. Scaevolus ◴[] No.23934283{7}[source]
Woops, forgot the major issue-- the Pi Zero only has one USB port (the other is just for power), so you couldn't get video frames in at the same time as you pretended to be a keyboard.
replies(1): >>23935035 #
51. voltagex_ ◴[] No.23934536{3}[source]
Can highly recommend the TP-Link HS100 for this - it's "just" a wifi power switch. Change your motherboard settings to "power on after power loss" and you've got your remote reboot.
52. tootie ◴[] No.23935016{3}[source]
I have a Fire TV brick (not stick) and it has a USB A port that I've successfully used with a mouse at least. I don't have a keyboard handy to test.
53. mtlynch ◴[] No.23935035{8}[source]
The Pi Zero's power port is actually a USB OTG port. I used it in my precursor project to forward keystrokes:

https://mtlynch.io/key-mime-pi/

replies(1): >>23945450 #
54. msbroadf ◴[] No.23935887[source]
I was wondering if you could try my usb-ip software for the hdmi dongle. https://www.virtualhere.com (ill give you a license key) i think this is quite useful for my customers and its something i was looking for. Can you pass the dongle directly through to your pc (no need for intermediate software) and see what the performance is like.
replies(1): >>23952902 #
55. tlamponi ◴[] No.23937291{3}[source]
Glad to hear that you like it!

For (integrated) mouse support you could take a look at a project from a good friend and colleague: https://github.com/Blub/netevent

Allows passing along arbitrary input events over the network and more.

replies(1): >>23946255 #
56. zyx321 ◴[] No.23938543{4}[source]
It could work on a power line, but I'd seriously recommend against it for a beginner project. Anything over 50V requires proper safety procedures.
57. magicalhippo ◴[] No.23945450{9}[source]
On the web page you explicitly say to connect it to the port labelled "USB", which is not the power port.
replies(1): >>23946167 #
58. mtlynch ◴[] No.23946167{10}[source]
Whoops, you're right. I misremembered. It's power on the Pi 4 and data on the Pi Zero.

Thanks for the correction!

59. mtlynch ◴[] No.23946255{4}[source]
Thanks! I'll check it out.
60. mtlynch ◴[] No.23952902[source]
Thanks for reading!

I'm not sure that VirtualHere would work in this scenario because it looks like it requires code on the client computer. I'd like to encapsulate all the software on the Pi so that the client computer doesn't need anything more than a web browser. The other tricky issue is that uStreamer is optimizing the stream to drop frames from the dongle when it detects that the browser is falling behind, so we'd lose that functionality.