-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not waking/shutting down my iMac #30
Comments
Also just noticed that the iMac 5k accessory sets itself to “off” state even while I’m working on my iMac. |
You don't seem to have As for the issue regarding your iMac being shown as offline even when it's on, it's possible that you need to adjust the ping interval. The package pings your iMac every now and then (as specified in the config). When 5 pings are returned with the same status (turned on or off) the status of the computer is considered changed. So basically it's possible that 5 pings fails in a row even when your iMac is on. Lowering |
@VeniceNerd Have you been able to resolve the issue? |
Hi Alex! Not yet. I haven’t had time to look back into it. Also, I found out that apparently you can’t even wake up an iMac from shut off state. Only from sleep state. Also, when you wake up a mac from sleep over WOL it only wakes up for a few seconds before going right back to sleep. That seems to be a limitation of the Mac. Makes WOL less useful for me overall. |
Yes, these are some limitations of iMacs and MacBooks. However a common opinion that I share is that usually one does not really turn an Apple computer completely off. That mitigates that shortcoming. About the computer only being started for a minute or two before going back to sleep. That sounds like it could have to do with the computer not logging in. If possible, one mitigation could be to disable the login screen. Thank you for sharing your findings! I hope this issue can be helpful for others stumbling upon this or similar issues. |
In my (admittedly limited) testing, I've found that WOL will wake the computer from sleep (similar to if you attempt to ssh into it), but won't wake the screen. It likely explains why the computer doesn't stay awake for long, the system goes back to sleep after detecting no further activity (and the example Having the ability to issue a "wakeCommand" (in a similar vein to the existing Is there a chance this functionality could be added? |
@jellybeansoup Thank you for reporting your findings! The feature was added in
This configuration will wake up the computer using wake on lan and then wait one second before starting to ping the device and issuing the caffeinate command. The readme has been updated to reflect the changes. I hope this will solve your issue as well, @VeniceNerd. Feel free to update me whether or not the feature works as expected. |
Interesting. I may try this again. Question, though, will my iMac go to sleep if I turn the “outlet” off? Or does this not work on the Mac either? |
Yes, that feature works. The configuration shown in your original post is correct. Make sure that SSH is enabled on the Mac. |
I've done a few days of testing on this, and it appears to work as expected. Turning the device off via homekit causes my Macbook Pro to sleep, and the new I did find that too short a For reference, the settings I'm using are as follows:
It's worth noting that, in addition to having "Wake for network access" enabled, I've also disabled Power Nap, which tends to cause this plugin to think the device has turned on at random times (which is legitimate, the whole point is that it accesses the network to fetch things while sleeping). If you've got automation based on when the machine turns on, you might find disabling this will help at least reduce them (though I can't say if it disables the behaviour completely). |
Thank you, @jellybeansoup for posting about all of your findings. It’s great for future reference! |
@jellybeansoup thanks for the detailed post! Do you run homebridge on the same machine that you’re putting to sleep? I’m running homebridge on a Pi3 and was wondering if that would still work the same to control my iMac on the same network? |
@VeniceNerd I'm running homebridge from a Raspberry Pi Zero W, which uses SSH keys to log in to the Macbook Pro over Wifi. Your set up should totally work (I actually wouldn't suggest trying to run this from the iMac itself, or the bridge will go offline when the machine goes to sleep). FYI, if you're running into login problems, it could be a couple of things. A dynamic IP, which I'm getting around by using the hostname found in System Preferences > Sharing (it'll be noted as <ComputerName>.local). Alternatively, the need for a password, which you can bypass by setting up SSH keys to log into your iMac from the Raspberry Pi 3. |
@VeniceNerd Has your issue been solved? |
Hello! I'm able to call the sleep mode on my macbook but i can't wake up it. and the log:
but no log when i try to wake up the Macbook...seems that no command get given to homebridge |
Sorry update, with this configuration:
|
@bubez81 Hi! If this is a persisting problem, could you please open a separate issue? It makes it easier for me to follow and hopefully solve. |
ok sorry for the delay it's not a good period for me. |
@bubez81 No worries. Take your time! |
Hello, I’m having the same issue at the OP. I get ssh not found and I’m using a docker container. Any advice on adding ssh to docker? I’ve included it in the docker-compose.yml as a package (openssh). I added this after the initial installation, so I’m not sure if I’m supposed to do anything more? Edit: Discovered I need to add openssh to the docker-compose.yml file, then docker-compose down, docker-compose up and it installs. |
@PerthSteve Also make sure that you’re running your container on the host network interface - otherwise the container won’t be able to find devices on your local network. If you’re unsure of what I’m talking about, take a look at the docker documentation. Feel free to come back whether it works or not! |
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.
Steve
…On 7 Jul 2018, 19:15 +0800, Alex Gustafsson ***@***.***>, wrote:
@PerthSteve Make sure that you’re running your container on the host network interface - otherwise the container won’t be able to find devices on your local network. If you’re inspire what I’m talking about, take a look at the docker documentation. Feel free to come back whether it works or not!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
If u are using "oznu/docker-homebridge" the user "abc" is running node and with this your ssh keys are at a different location. |
Hi Alex, hope you can help me. I've also can't send my iMac to sleep or wake up.... when I send the ssh command to sleep to wake up from the console of the raspberry the iMac wakes up and go to sleep without any problem. When I try it over Homebridge it doesn't work.... |
Does the command work if you run it yourself in the terminal? It seems like either you don’t have SSH installed on the pi or it couldn’t connect to the Mac. |
Thanks for your quick response.... ssh on the raspberry should be installed. maybe my explanation was not detailed enough. for testing ssh I'm using the app Homebridge on my iPad. in the app I open the console on the raspberry pi and start the ssh comma as explained... when I send the ssh command from this console the iMac go to sleep or wake up. But not when I use Homekit... sorry for my bad explanation. But I'm al bloody beginner with raspberry... Can I give you further informations? |
There was no issue with your explenation. The reason for me asking is that homebridge-wol basically copy and pasted the command you enter and run it as a command the same way you would. The idea is that if it works when you type it yourself, it works with homebridge-wol. One difference, however, is that it inherits the user from homebridge. If you start homebridge as root, then SSH will also be run as root. Do you start homebridge with sudo? If so, does sudo ssh yourname@mac... work? |
changes nothing :-( I'm looking forward to run the home bridge in debug mode and will give you further informations.... |
same issue for me... issuing the caffeniate command directly in the terminal works fine, but the same command issued via the plugin does not |
Same issues: shutdown works great with either
Is this the latest information for this problem or is there another issue or PR open for it? |
@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. |
Locking this as there are many unrelated issues popping up now and then. |
I've published 3.2.5 to NPM which contains many fixes. Please try it and open new issues for any problems you may face. Closing. |
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:
And here is my configuration file:
Environment
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:
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!
The text was updated successfully, but these errors were encountered: