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.

Current pingCommand is useless for macOS

See original GitHub issue

Issue

Mac status is not working because in sleep state the ping command is always successful.

I could use a command like ssh user@192.168.1.256 'if [[$ (pmset -g powerstate IODisplayWrangler | tail -1 | cut -c29) -lt 4]]; then; echo 0; else; exit 1; fi;' but the current execution of pingCommand doesn’t make any sense to it

Environment

  • os & os version: macos catalina 10.15.5
  • node version: v12.18.2
  • homebridge version: 1.1.1
  • homebridge-wol version: 4.2.1

Configuration

My configuration looks like this:

    "accessories": [
        {
            "name": "Macbook Pro 2017",
            "ip": "192.168.1.256",
            "pingInterval": 45,
            "pingCommand": "ssh user@192.168.1.256 'if [[ $(pmset -g powerstate IODisplayWrangler | tail -1 | cut -c29) -lt 4 ]]; then; echo 0; else; exit 1; fi;'",
            "mac": "XX:XX:XX:XX:XX:XX",
            "broadcastAddress": "192.168.1.256",
            "wakeGraceTime": 10,
            "wakeCommand": "ssh user@192.168.1.256 caffeinate -u -t 300",
            "shutdownCommand": "ssh user@192.168.1.256 pmset sleepnow",
            "shutdownGraceTime": 15,
            "log": true,
            "logPinger": true,
            "debugLog": true,
            "returnEarly": false,
            "accessory": "NetworkDevice"
        }
    ],

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexGustafssoncommented, Jul 21, 2020

Fixed in 4.2.2 which will be released shortly. If you still face the issue after upgrading, please comment here or reopen a new issue as soon as possible.

1reaction
AlexGustafssoncommented, Jul 21, 2020

I’ve found the bug. Hopefully I get the time to push a fix out today. I’ve also dockerized integration tests to simulate an actual setup with a MacBook etc. to make sure that issues like this are much easier to find in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not use "pathping" command in macOS - Ask Different
Pathping works first by doing a traceroute to the destination then it uses ICMP to ping each hop in the transit path 100...
Read more >
Can't find ping on macbook - Stack Overflow
In Terminal, run the following command: sudo nano /etc/paths; Enter your password, when prompted. Go to the bottom of the file, and enter...
Read more >
How to use OS X's terminal to ping an IP using the latency as ...
I'd like a way to make the ping stop after the latency drops below a given value. Let's say 100, so in the...
Read more >
MacOS Monterey Problems – Fixing Issues with macOS 12
This is a rare but serious problem; some Mac users have discovered that installing MacOS Monterey renders their Mac completely useless.
Read more >
Ping a Specific Port - Server Fault
Try curl command, like: $ curl host:port. For example:
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