AlexGustafsson / homebridge-wol

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

Cannot read propert 'split' of null #107

Closed yceballost closed 4 years ago

yceballost commented 4 years ago

Backstory

I'm trying to turn on my Mac with wol

Issue

I can't turn on the pc

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of null
    at NetworkDevice.wake (/usr/lib/node_modules/homebridge-wol/lib/network-device.js:177:51)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at NetworkDevice.setOnline (/usr/lib/node_modules/homebridge-wol/lib/network-device.js:130:9)
(node:25039) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:25039) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment

Configuration

My configuration looks like this:

{
            "name": "Hackintosh",
            "ip": "192.168.1.35",
            "pingInterval": 2,
            "pingsToChange": 5,
            "pingTimeout": 1,
            "mac": "<mac-address>",
            "broadcastAddress": "192.168.1.255",
            "startCommand": "ssh yayo@192.168.1.35 caffeinate -u -t 300",
            "wakeGraceTime": 45,
            "shutdownCommand": "ssh yayo@192.168.1.35 sudo shutdown -h now",
            "shutdownGraceTime": 15,
            "log": true,
            "logPinger": false,
            "debugLog": false,
            "returnEarly": false,
            "accessory": "NetworkDevice"
        }
AlexGustafsson commented 4 years ago

Try wakeCommand instead of startCommand. See the README for full documentation.

yceballost commented 4 years ago

damn! works! I thought that wakeCommand was for unsleep the machine.

Thanks!