Most active commenters

    ←back to thread

    756 points mtlynch | 14 comments | | HN request time: 1.134s | source | bottom
    Show context
    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 #
    1. 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 #
    2. swsieber ◴[] No.23928235[source]
    If you can plug stuff into it, just use the KVM from a laptop and sit by it.
    3. fanatic2pope ◴[] No.23928413[source]
    Plug it into a smart outlet running tasmota.
    4. 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 #
    5. 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 #
    6. hedora ◴[] No.23929195[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 #
    7. baq ◴[] No.23929351[source]
    hook up a gpio pin to a reset switch jumper somehow?
    8. wojciii ◴[] No.23929756[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.

    9. oakwhiz ◴[] No.23930250[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.
    10. 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
    11. davidzweig ◴[] No.23931740[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.
    12. Nexxxeh ◴[] No.23932602[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.

    13. voltagex_ ◴[] No.23934536[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.
    14. zyx321 ◴[] No.23938543{3}[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.