Skip to content
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

magic packets sent not waking pc anymore #250

Open
pizzaboy314 opened this issue Oct 11, 2023 · 14 comments
Open

magic packets sent not waking pc anymore #250

pizzaboy314 opened this issue Oct 11, 2023 · 14 comments
Labels

Comments

@pizzaboy314
Copy link

pizzaboy314 commented Oct 11, 2023

Backstory

i hadn't updated or restarted Homebridge or my plugins in a while. after restarting Homebridge recently after disabling another plugin, this plugin stopped waking my PC.

Issue

i did take steps to update Homebridge and this WoL plugin to the most recent version, but the problem persists.

i recently set up a Home Assistant server and i was able to confirm my PC's WoL settings are right by testing it with Home Assistants developer service wake_on_lan.send_magic_packet, when i tested this with my mac address the PC woke up immediately

Environment

assuming homebridge host OS?
- os and os version: Win10 (10.0, build 19045)
- node version: 18.18.0
- homebridge version: 1.6.1
- homebridge-wol version: 5.0.2

Configuration

{
    "bridge": {
        "name": "Homebridge 3F2D",
        "username": "REDACTED",
        "port": REDACTED,
        "pin": "REDACTED"
    },
    "accessories": [
        {
            "name": "SPAHRTAN-RIG-2021",
            "manufacturer": "homebridge-wol",
            "model": "NetworkDevice",
            "host": "10.0.0.216",
            "pingInterval": 2,
            "pingsToChange": 5,
            "pingTimeout": 1,
            "pingCommandTimeout": 0,
            "mac": "REDACTED",
            "startCommandTimeout": 0,
            "wakeGraceTime": 45,
            "wakeCommandTimeout": 0,
            "shutdownGraceTime": 15,
            "shutdownCommandTimeout": 0,
            "logLevel": "Debug",
            "returnEarly": false,
            "accessory": "NetworkDevice"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "refreshToken": "REDACTED",
            "platform": "Ring"
        },
        {
            "name": "Hue",
            "anyOn": true,
            "effects": false,
            "groups": true,
            "lights": true,
            "nativeHomeKitLights": true,
            "nativeHomeKitSensors": true,
            "resource": true,
            "rooms": true,
            "scenes": true,
            "scenesAsSwitch": true,
            "schedules": true,
            "users": {
                "ECB5FAFFFE1C2196": "REDACTED"
            },
            "wallSwitch": true,
            "platform": "Hue"
        }
    ],
    "disabledPlugins": [
        "homebridge-hue"
    ]
}

Logs

When I follow these steps:

  1. Make sure logLevel is set to Debug on all NetworkDevice accessories
  2. Run homebridge
  3. Let it run for a couple of minutes
  4. Try to turn a device on or off using the plugin
  5. Wait one minute
  6. Repeat step 4

I get the following log:

[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got user-triggered state change: 1
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Awake cycle started
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Attempting to wake up device
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Device went from status "Offline" to "WakingUp"
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [Pinger] Stopping pinger
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Attempting to start device by sending a WoL packet
[10/11/2023, 1:06:19 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Waiting for wake grace time (45000ms)
[10/11/2023, 1:06:29 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state request - reporting WakingUp
[10/11/2023, 1:06:29 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got user-triggered state change: 1
[10/11/2023, 1:07:04 PM] [SPAHRTAN-RIG-2021] [Pinger] Stopping pinger
[10/11/2023, 1:07:04 PM] [SPAHRTAN-RIG-2021] [Pinger] Starting pinger at an interval of 2000 milliseconds
[10/11/2023, 1:07:04 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:05 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:05 PM] [SPAHRTAN-RIG-2021] [Pinger] Got 0 positives out of 1
[10/11/2023, 1:07:05 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state change from pinger: offline
[10/11/2023, 1:07:05 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] The device is no longer accessible - assuming offline
[10/11/2023, 1:07:05 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Device went from status "WakingUp" to "Offline"
[10/11/2023, 1:07:07 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:08 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:09 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:10 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:11 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:12 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:13 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:14 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:15 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:07:16 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:07:16 PM] [SPAHRTAN-RIG-2021] [Pinger] Got 0 positives out of 5
[10/11/2023, 1:07:16 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state change from pinger: offline

after one minute

[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got user-triggered state change: 1
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Awake cycle started
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Attempting to wake up device
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Device went from status "Offline" to "WakingUp"
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [Pinger] Stopping pinger
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Attempting to start device by sending a WoL packet
[10/11/2023, 1:10:15 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Waiting for wake grace time (45000ms)
[10/11/2023, 1:10:24 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state request - reporting WakingUp
[10/11/2023, 1:10:24 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got user-triggered state change: 1
[10/11/2023, 1:11:00 PM] [SPAHRTAN-RIG-2021] [Pinger] Stopping pinger
[10/11/2023, 1:11:00 PM] [SPAHRTAN-RIG-2021] [Pinger] Starting pinger at an interval of 2000 milliseconds
[10/11/2023, 1:11:00 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:01 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:01 PM] [SPAHRTAN-RIG-2021] [Pinger] Got 0 positives out of 1
[10/11/2023, 1:11:01 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state change from pinger: offline
[10/11/2023, 1:11:01 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] The device is no longer accessible - assuming offline
[10/11/2023, 1:11:01 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Device went from status "WakingUp" to "Offline"
[10/11/2023, 1:11:03 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:04 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:05 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:06 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:07 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:08 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:09 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:10 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:11 PM] [SPAHRTAN-RIG-2021] [Pinger] Attempting to ping host '10.0.0.216'
[10/11/2023, 1:11:12 PM] [SPAHRTAN-RIG-2021] [Pinger] Result of pinging: offline
[10/11/2023, 1:11:12 PM] [SPAHRTAN-RIG-2021] [Pinger] Got 0 positives out of 5
[10/11/2023, 1:11:12 PM] [SPAHRTAN-RIG-2021] [NetworkDevice] Got state change from pinger: offline


### Notes

_No response_
@megaphonixmusic
Copy link

Confirming this plugin has also stopped working for me for a little while now. I'd say on the order of 2-3 weeks.

(No change to the PC's static IP)

@pizzaboy314
Copy link
Author

Confirming this plugin has also stopped working for me for a little while now. I'd say on the order of 2-3 weeks.

(No change to the PC's static IP)

that timeline sounds right for my experience as well

I'm now working around this issue by using Home Assistant's WoL feature and passing it through to homekit as a switch

@alissaman
Copy link

Try deleting these two lines from your config, I had similar issues and this plugin worked again after removal.

        "startCommandTimeout": 0,
        "shutdownCommandTimeout": 0,

@megaphonixmusic
Copy link

Try deleting these two lines from your config, I had similar issues and this plugin worked again after removal.

        "startCommandTimeout": 0,
        "shutdownCommandTimeout": 0,

Just tried this and restarted my Homebridge, still not working unfortunately.

@HobaiRiku
Copy link

advice to change wake_on_lan to wakeonlan to fix this

@michelebombardi
Copy link

Same issue here, since about two week this stopped working suddendly, without any reason.
No ping and no magic packet.
Please, any solutions?

@andywaplinger
Copy link

My solution to this was to install etherwake on my Raspberry Pi, then set the Start command to wakeonlan [WOL_MAC_ADDRESS] - works great! Love that I can now wake up and suspend my PC with automation.

@megaphonixmusic
Copy link

So I tried diving into my PC's BIOS just to double check my settings, and it turns out there was a "Boot From Onboard LAN" setting that was set to "Disabled" for some reason. I enabled that and this switch is working for me again... Your mileage may vary, but I suggest double checking your BIOS and Windows settings to ensure they didn't get changed like mine did somehow.

@AlexGustafsson
Copy link
Owner

It's interesting that you have seen the issue pop up around the same time, a time around which this plugin hadn't been updated. Could it be that some BIOS or Windows update changed the settings for Wake On LAN?

@pizzaboy314
Copy link
Author

It's interesting that you have seen the issue pop up around the same time, a time around which this plugin hadn't been updated. Could it be that some BIOS or Windows update changed the settings for Wake On LAN?

No, because within one day of this plugin no longer working, I set up a Home Assistant server and the built in WoL worked immediately with no changes to Windows.

@AlexGustafsson
Copy link
Owner

It's weird that something would break out of nowhere without changes anywhere. I'll keep the issue open for a while to see if anyone else has something to add. Otherwise I'll probably close this as there's been no related change made in a long time, so there's nothing that can be changed in the plugin to fix this. It's likely some external factor.

@alissaman
Copy link

I suspect that an update to HomeBridge or Raspbian caused the issue.

What I observe is that it might get stuck in the shutting down state, and does not move to offline.

The pc does get successfully shutdown and stops responding to pings.

[25/01/2024, 09:13:58] [Home PC] [NetworkDevice] Shutdown cycle started
[25/01/2024, 09:13:58] [Home PC] [NetworkDevice] Device went from status "Online" to "ShuttingDown"
[25/01/2024, 09:13:58] [Home PC] [NetworkDevice] Attempting to shut down the device using "ssh"

When it works correctly the following two log entries are recorded:
[NetworkDevice] Waiting for shutdown grace time (NaNms)
[NetworkDevice] Device went from status "ShuttingDown" to "Offline"

This issue could be related to or caused by #255

@rockychf
Copy link

My issue #255 is mainly focus on the "detecting" part of online PC (whether the PC is on or off, it only shows the PC is turning off), the turn on feature for PC is working as expect.

@michelebombardi
Copy link

In my case was fault of Homebridge (installed on Synology NAS) that, after an update, was unable to ping my computer.

To solve, I connected via SSH to the NAS as root user and executed the following command:

setcap 'cap_net_raw+ep' $(which ping)

Then everything went back working as before.
Hope this will help someone else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants