AlexGustafsson / homebridge-wol

A Wake on Lan plugin for Homebridge
MIT License
301 stars 30 forks source link

Mac Mini now waking up or impossible to shutdown #104

Closed Seexelas closed 4 years ago

Seexelas commented 4 years ago

Backstory

I did the setup of my Mac Mini in the WOL plugin.

Issue

The Mac is recognize as online or offline, but when i try to start or shutdown, i have an error,

Environment

Configuration

My configuration looks like this: { "accessory": "NetworkDevice", "name": "Galaxy-iMac", "mac": "mac-address", "ip": "192.168.1.5", "pingInterval": 45, "wakeGraceTime": 10, "wakeCommand": "ssh 192.168.1.5 caffeinate -u -t 300", "shutdownGraceTime": 15, "shutdownCommand": "ssh 192.168.1.5 sudo shutdown -h now", "plugin_map": { "plugin_name": "homebridge-wol", "index": 0 }

IMPORTANT! Remove any mac addresses from the configuration by exchanging them with


### Log
When I follow these steps:
1. Run `DEBUG=* homebridge`
2. Let it run for five minutes
3. Tap a switch
4. Wait one minute
5. Tap the same switch

I get the following log:

[Galaxy-iMac] An error occured while trying to wake "Galaxy-iMac" (192.168.1.5): Error: Command failed: ssh 192.168.1.5 caffeinate -u -t 300 /bin/sh: ssh: not found

at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:310:20)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:310:20)
at Pipe.<anonymous> (net.js:672:12)

{ killed: false, code: 127, signal: null, cmd: 'ssh 192.168.1.5 caffeinate -u -t 300', stdout: '', stderr: '/bin/sh: ssh: not found\n'



### Notes
Thanks for your help
AlexGustafsson commented 4 years ago

The answer lies in the error; /bin/sh: ssh: not found means that there’s no command installed called “ssh”. You’ll have to read up on how to use SSH within your docket container on Synology as I have no experience running things on Synology.

Seexelas commented 4 years ago

Ok thank you for your answer, i was missing openssh client, i will test, Thanks a lot