bloomkd46 / homebridge-iRobot

A homebridge plugin for controlling iRobot devices
Apache License 2.0
62 stars 14 forks source link

Bug Report: Logging into iRobot Crashes Homebridge #79

Open haydenfulghum opened 2 years ago

haydenfulghum commented 2 years ago

Describe The Bug:

Homebridge crashes with spawnSync error when logging into iRobot service. Confirmed credentials are correct outside of plugin.

To Reproduce:

Configure plugin with credentials, restart Homebridge service.

Expected behavior:

Configure plugin with credentials, restart Homebridge service, access roomba.

Logs:

[1/31/2022, 9:05:21 PM] [HB Supervisor] Restarting Homebridge...
[1/31/2022, 9:05:21 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -K
[1/31/2022, 9:05:21 PM] [HB Supervisor] Started Homebridge v1.4.0 with PID: 38716
[1/31/2022, 9:05:21 PM] Loaded config.json with 0 accessories and 3 platforms.
[1/31/2022, 9:05:21 PM] Loaded 1 cached accessories from cachedAccessories.
[1/31/2022, 9:05:21 PM] ---
[1/31/2022, 9:05:21 PM] Loaded plugin: homebridge-config-ui-x@4.42.0
[1/31/2022, 9:05:21 PM] Registering platform 'homebridge-config-ui-x.config'
[1/31/2022, 9:05:21 PM] ---
[1/31/2022, 9:05:22 PM] Loaded plugin: homebridge-irobot@2.1.16
[1/31/2022, 9:05:22 PM] Registering platform 'homebridge-irobot.iRobotPlatform'
[1/31/2022, 9:05:22 PM] ---
[1/31/2022, 9:05:22 PM] Loaded plugin: homebridge-myq@2.7.4
[1/31/2022, 9:05:22 PM] Registering platform 'homebridge-myq.myQ'
[1/31/2022, 9:05:22 PM] ---
[1/31/2022, 9:05:22 PM] Loading 3 platforms...
[1/31/2022, 9:05:22 PM] [Config] Initializing config platform...
[1/31/2022, 9:05:22 PM] [Config] Running in Service Mode
[1/31/2022, 9:05:22 PM] [myQ] Initializing myQ platform...
[1/31/2022, 9:05:22 PM] [iRobot] Initializing iRobotPlatform platform...
[1/31/2022, 9:05:22 PM] [iRobot] Logging into iRobot...
[1/31/2022, 9:05:22 PM] Error: spawnSync C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\dist/scripts/getRoombaCredentials.js UNKNOWN
    at Object.spawnSync (node:internal/child_process:1083:20)
    at spawnSync (node:child_process:812:24)
    at Object.execFileSync (node:child_process:858:15)
    at getRoombas (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\getRoombas.ts:12:34)
    at iRobotPlatform.discoverDevices (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\platform.ts:65:36)
    at HomebridgeAPI.<anonymous> (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\platform.ts:34:12)
    at HomebridgeAPI.emit (node:events:402:35)
    at HomebridgeAPI.signalFinished (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge\src\api.ts:275:10)
    at Server.start (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge\src\server.ts:173:14)
[1/31/2022, 9:05:22 PM] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null
[1/31/2022, 9:05:27 PM] [HB Supervisor] Restarting Homebridge...
[1/31/2022, 9:05:27 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -K
[1/31/2022, 9:05:27 PM] [HB Supervisor] Started Homebridge v1.4.0 with PID: 35164
[1/31/2022, 9:05:27 PM] Loaded config.json with 0 accessories and 3 platforms.
[1/31/2022, 9:05:27 PM] Loaded 1 cached accessories from cachedAccessories.
[1/31/2022, 9:05:27 PM] ---
[1/31/2022, 9:05:27 PM] Loaded plugin: homebridge-config-ui-x@4.42.0
[1/31/2022, 9:05:27 PM] Registering platform 'homebridge-config-ui-x.config'
[1/31/2022, 9:05:27 PM] ---
[1/31/2022, 9:05:28 PM] Loaded plugin: homebridge-irobot@2.1.16
[1/31/2022, 9:05:28 PM] Registering platform 'homebridge-irobot.iRobotPlatform'
[1/31/2022, 9:05:28 PM] ---
[1/31/2022, 9:05:28 PM] Loaded plugin: homebridge-myq@2.7.4
[1/31/2022, 9:05:28 PM] Registering platform 'homebridge-myq.myQ'
[1/31/2022, 9:05:28 PM] ---
[1/31/2022, 9:05:28 PM] Loading 3 platforms...
[1/31/2022, 9:05:28 PM] [Config] Initializing config platform...
[1/31/2022, 9:05:28 PM] [Config] Running in Service Mode
[1/31/2022, 9:05:28 PM] [myQ] Initializing myQ platform...
[1/31/2022, 9:05:28 PM] [iRobot] Initializing iRobotPlatform platform...
[1/31/2022, 9:05:28 PM] [iRobot] Logging into iRobot...
[1/31/2022, 9:05:28 PM] Error: spawnSync C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\dist/scripts/getRoombaCredentials.js UNKNOWN
    at Object.spawnSync (node:internal/child_process:1083:20)
    at spawnSync (node:child_process:812:24)
    at Object.execFileSync (node:child_process:858:15)
    at getRoombas (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\getRoombas.ts:12:34)
    at iRobotPlatform.discoverDevices (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\platform.ts:65:36)
    at HomebridgeAPI.<anonymous> (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge-irobot\src\platform.ts:34:12)
    at HomebridgeAPI.emit (node:events:402:35)
    at HomebridgeAPI.signalFinished (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge\src\api.ts:275:10)
    at Server.start (C:\Users\hayde\AppData\Roaming\npm\node_modules\homebridge\src\server.ts:173:14)
[1/31/2022, 9:05:28 PM] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null

Config:

{
    "bridge": {
        "name": "Homebridge 1E73",
        "username": "0E:1C:BA:91:1E:73",
        "port": 51436,
        "pin": "733-91-927",
        "bind": [
            "Wi-Fi"
        ]
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "email": "hayden@fulghum.me",
            "password": "cyrnig-rEhquk-9qodqi",
            "platform": "myQ"
        },
        {
            "name": "iRobot",
            "email": "hayden@fulghum.me",
            "password": "********",
            "roombas": [
                {
                    "autoConfig": true,
                    "info": {
                        "ver": 2
                    }
                }
            ],
            "manualDiscovery": false,
            "lowBattery": 20,
            "offAction": "stop:dock",
            "status": "cycle:clean",
            "eveStatus": "inverted:cycle:clean",
            "bin": "none",
            "ignoreMultiRoomBin": true,
            "hideStuckSensor": false,
            "disableMultiRoom": false,
            "platform": "iRobotPlatform"
        }
    ],
    "disabledPlugins": [
        "homebridge-irobot"
    ]
}

Node Version:

v16.13.1

NPM Version:

8.3.1

Homebridge Version:

1.4.0

Plugin Version:

`-- homebridge-irobot@2.1.16

Operating System:

Windows

bloomkd46 commented 2 years ago

It looks like it is having a problem with your computer because windows uses \ in file paths instead of /

bloomkd46 commented 2 years ago

I am working on a version 3.0 in my spare time which should fix this problem

haydenfulghum commented 2 years ago

Ok. This is a test deployment, may move it to a pi soon, should resolve the issue.

bloomkd46 commented 1 year ago

Please try the latest beta: npm