joe-ng / homebridge-dyson-link

MIT License
206 stars 40 forks source link

error when running homebridge command "TypeError" #41

Open azaiszen opened 6 years ago

azaiszen commented 6 years ago

When I am running the home bridge command, I am getting an error that is

crypto.js:99 this._handle.update(data, encoding); ^

TypeError: Data must be a string or a buffer at Hash.update (crypto.js:99:16) at config.accessories.forEach (/usr/lib/node_modules/homebridge-dyson-link/index.js:73:72) at Array.forEach () at getDevicesFromAccount (/usr/lib/node_modules/homebridge-dyson-link/index.js:50:49) at IncomingMessage.res.on (/usr/lib/node_modules/homebridge-dyson-link/index.js:201:25) at emitNone (events.js:111:20) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

Any ideas?

MLBumstead commented 6 years ago

I have exactly the same problem and can't get the dyson-link plugin to work as a result.

joe-ng commented 6 years ago

from the error, it seemed that it could not find the password of your devices from your account. maybe you can try either a) check the user name and password of your account b) check the country code that you put on c) change to use the device password instead (only for Dyson pre-2018 devices)

MLBumstead commented 6 years ago

Thanks Joe, that worked for me. I had the wrong country code (I was using UK instead of GB for the United Kingdom) and I also had the incorrect serialNumber for one of my Dyson fans. Amending both seems to have resolved the issue.

husoseli15 commented 6 years ago

I'm having the same issue. I double checked my username/password and country code (2018+ Fan).

Log: crypto.js:99 this._handle.update(data, encoding); ^

TypeError: Data must be a string or a buffer at Hash.update (crypto.js:99:16) at config.accessories.forEach (/usr/lib/node_modules/homebridge-dyson-link/index.js:73:72) at Array.forEach () at getDevicesFromAccount (/usr/lib/node_modules/homebridge-dyson-link/index.js:50:49) at IncomingMessage.res.on (/usr/lib/node_modules/homebridge-dyson-link/index.js:201:25) at emitNone (events.js:111:20) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

Any help would be appreciated. Thank you!

Best, Huso

joe-ng commented 6 years ago

did you see other error log right before this entry? it may give some cue on what happened

MaievJL commented 5 years ago

I'm having the same issue. I ensure my country code is CA for Canada, checked password and email and serial from the app. Not sure what I'm doing wrong. Thank you for your time!

The homebridge would start, then stop :(

TypeError: Data must be a string or a buffer
    at Hash.update (crypto.js:99:16)
    at config.accessories.forEach (/usr/lib/node_modules/homebridge-dyson-link/index.js:73:72)
    at Array.forEach (<anonymous>)
    at getDevicesFromAccount (/usr/lib/node_modules/homebridge-dyson-link/index.js:50:49)
    at IncomingMessage.res.on (/usr/lib/node_modules/homebridge-dyson-link/index.js:201:25)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)

Here's my json config.

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "platforms": [{
        "platform": "config",
        "name": "Config",
        "port": 8080,
        "sudo": false
    },{
        "platform": "DysonPlatform",
        "name": "DysonPlatform",
        "email": "something@gmail.com",
        "password": "abcdefgh",
        "country": "CA",
        "accessories": [{
            "ip": "192.168.1.104",
            "displayName": "Dyson Air Purifier",
            "serialNumber": "DYSON-VS5-CA-KDABCDEF"
        }]
    }]  
}

Maybe you can spot something I can't 👍 thank you ahead of time for developing this plugin.

fluidpixel commented 5 years ago

The problem is with the serial number. It doesn't need the 'DYSON-' prefix.

Here's the output of accountDevices I'm getting back within getDevicesFromAccount:

{ 'XXX-XX-XXXXXXXX': 
   { Serial: 'XXX-XX-XXXXXXXX',
     Name: 'Office',
     Version: 'ECG2PF.02.05.001.0006',
     ...