question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not waking/shutting down my iMac

See original GitHub issue

Backstory

Using the plugin via the Home App

Issue

I successfully installed homebridge-wol and added the configuration to the config file. The plugin seems to be running fine and my iMac 5K shows up in HomeKit.

However, I am not not able to either wake up or shut down my computer. Nor does the plugin update my iMac status if I manually turn it on or off. The switch doesn’t seem to do anything.

Here is screenshots of my networking settings:

screen shot 2018-01-31 at 1 16 53 pm screen shot 2018-01-31 at 1 17 00 pm

And here is my configuration file:

{
    "bridge": {
        "name": "Homebridge Misc",
        "username": "CD:22:4D:E3:DE:34",
        "port": 51826,
        "pin": "051-85-128"
    },
    "description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "accessories": [
        {
            "accessory": "NetworkDevice",
            "name": "iMac 5k",
            "mac": "<mac-address>",
            "ip": "10.0.1.12",
            "pingInterval": 45,
            "wakeGraceTime": 90,
            "shutdownGraceTime": 45,
            "shutdownCommand": "ssh 10.0.1.12 sudo shutdown -h now"
        }
    ],
    "platforms": [
        {
            "platform": "config",
            "name": "Config",
            "port": 8170,
            "log": "/homebridge/logs/homebridge.log",
            "restart": "docker-compose restart homebridge"
        }
    ]
}

Environment

  • os & os version: Raspberry Pi 3 - Raspian OS
  • node version: not sure
  • homebridge version: 0.4.37 (running via OZNU Docker)
  • homebridge-wol version: 3.1.0

Log

When I follow these steps: I couldn’t figure out how to run the DEBUG=* homebridge command. However, here is a copy of my log file:

I get the following log:

[2018-1-31 13:02:22] Homebridge is running on port 51826.
[2018-1-31 13:02:25] [Config] Using Form Authentication
[2018-1-31 13:02:25] [Config] Console is listening on port 8170.
[2018-1-31 13:03:55] [Config] Changes to config.json saved.

/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:42
    var error = dns_sd.buildException(errorCode);
                       ^
Error: dns service error: unknown
    at Advertisement.on_service_registered (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:42:24)
    at SocketWatcher.MDNSService.self.watcher.callback (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/mdns_service.js:18:40)
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
[2018-1-31 13:04:30] Loaded plugin: homebridge-dummy
[2018-1-31 13:04:30] Registering accessory 'homebridge-dummy.DummySwitch'
[2018-1-31 13:04:30] ---
[2018-1-31 13:04:30] Loaded plugin: homebridge-wol
[2018-1-31 13:04:30] Registering accessory 'homebridge-wol.NetworkDevice'
[2018-1-31 13:04:30] ---
[2018-1-31 13:04:31] Loaded plugin: homebridge-config-ui-x
[2018-1-31 13:04:31] Registering platform 'homebridge-config-ui-x.config'
[2018-1-31 13:04:31] ---
[2018-1-31 13:04:31] Loaded config.json with 1 accessories and 1 platforms.
[2018-1-31 13:04:31] ---
[2018-1-31 13:04:31] Loading 1 platforms...
[2018-1-31 13:04:31] [Config] Initializing config platform...
[2018-1-31 13:04:31] Loading 1 accessories...
[2018-1-31 13:04:31] [iMac 5k] Initializing NetworkDevice accessory...
Setup Payload:
X-HM://0023K0OYWKCPC
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:



























Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 051-85-128 │
    └────────────┘

[2018-1-31 13:04:31] Homebridge is running on port 51826.
[2018-1-31 13:04:34] [Config] Using Form Authentication
[2018-1-31 13:04:34] [Config] Console is listening on port 8170.
[2018-1-31 13:07:39] [iMac 5k] NetworkDevice awake cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:39] [iMac 5k] Attempting to wake up "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:39] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Offline" to "Waking Up"
[2018-1-31 13:07:44] [iMac 5k] NetworkDevice shutdown cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:44] [iMac 5k] Attempting to shut down "iMac 5k" (10.0.1.12) using "ssh 10.0.1.12 sudo shutdown -h now"
[2018-1-31 13:07:44] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Waking Up" to "Shutting Down"
[2018-1-31 13:07:44] [iMac 5k] An error occured while trying to shut down "iMac 5k" (10.0.1.12): Error: Command failed: ssh 10.0.1.12 sudo shutdown -h now
/bin/sh: ssh: not found

[2018-1-31 13:07:44] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Shutting Down" to "Offline"
[2018-1-31 13:10:21] [iMac 5k] NetworkDevice awake cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:10:21] [iMac 5k] Attempting to wake up "iMac 5k" (10.0.1.12)
[2018-1-31 13:10:21] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Offline" to "Waking Up"
[2018-1-31 13:11:51] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Waking Up" to "Offline"

Notes

I would love to get your help with this problem. I was REALLY excited to be able to remotely turn off and turn on my iMac. Please let me know if there is any additional information you need from me!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:33 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexGustafssoncommented, Jun 20, 2019

@amaisano Yes and no. Yes as this issue mostly has to do with Macs “lying” about their state. No as there’s most likely an issue with the internal state machine that has come up in other issues.

A PR came in yesterday mentioning pinging which may or may not be related.

I’d say that your best off following the milestone https://github.com/AlexGustafsson/homebridge-wol/milestones to follow progress.

1reaction
domeOocommented, Sep 11, 2018

Hi Alex, thanks for replying. I’ve managed to ssh from within the docker, even with rsa key and no password. The trouble seems to be when I use off switch the command fails in the logs. I’m unable to tell “who” is using the command, but assumed that within the container it’s root. I might try the verbose flag in the Config to see what ssh is doing

If u are using “oznu/docker-homebridge” the user “abc” is running node and with this your ssh keys are at a different location. If thats your problem u can go to /config/.ssh and put your keys there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If your Mac sleeps or wakes unexpectedly - Apple Support
Check your system's sleep settings · Click the “Turn display off on battery when inactive” pop-up menu on the right, then choose an...
Read more >
How to Fix Mac Won't Wake from Sleep Issue after mac OS 11 ...
1. Resetting System Management Controller (SMC) · Shut down Mac · Disconnect the connected MagSafe power adapter from computer · Remove battery ·...
Read more >
7 Ways to Fix Mac Sleep-Wake Failure Problems
Fix #1: Check Your Power and Screen Brightness. Fix #2: Switch Off Your Mac and Turn It Back On. Fix #3: Reset SMC...
Read more >
MacBook With OS X Is Not Waking Up
When a MacBook refuses to wake from sleep, the quickest and easiest solutions are often the most fruitful. Start by tapping on the...
Read more >
6 Best Ways to Fix Mac Display Not Working After Waking ...
If your Mac's display has still not turned on, you can try to force restart it by long pressing the Power Button or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found