dgreif / homebridge-hatch-baby-rest

A homebridge plugin for Hatch Baby Rest night light
MIT License
74 stars 19 forks source link

Error at startup: EAFNOSUPPORT, Address family not supported by protocol #25

Closed FlipABit closed 3 years ago

FlipABit commented 4 years ago

I installed v2.0.4, configured it through Homebridge UI and after Homebridge restarted it won't boot back up because of the error below:

Error: EAFNOSUPPORT, Address family not supported by protocol                               
    at new Hci (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/h
ci.js:74:18)                                                                                                        
    at new NobleBindings (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hc
i-socket/bindings.js:25:15)                                                                                         
    at Object.<anonymous> (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/h
ci-socket/bindings.js:546:18)                                                                                       
    at Module._compile (internal/modules/cjs/loader.js:1133:30)                                                     
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)                                       
    at Module.load (internal/modules/cjs/loader.js:977:32)                                                          
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)                                                
    at Module.require (internal/modules/cjs/loader.js:1019:19)                                                      
    at require (internal/modules/cjs/helpers.js:77:18)                                                              
    at module.exports (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/resol
ve-bindings.js:13:12)                                                                                               
    at Object.<anonymous> (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/index
.js:2:49)                                                                                                           
    at Module._compile (internal/modules/cjs/loader.js:1133:30)                                                     
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)                                       
    at Module.load (internal/modules/cjs/loader.js:977:32)                                                          
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)                                                
    at Module.require (internal/modules/cjs/loader.js:1019:19)                                                      
    at require (internal/modules/cjs/helpers.js:77:18)                                                              
    at new HatchBabyRest (/homebridge/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:30:22)         
    at new HatchBabyRestAccessory (/homebridge/node_modules/homebridge-hatch-baby-rest/lib/accessories/hatch-baby-re
st.js:20:20)                                                                                                        
    at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50                                                  
    at Array.forEach (<anonymous>)                                                                                  
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src
dgreif commented 4 years ago

What device are you running homebridge on? Does it have Bluetooth LE support?

FlipABit commented 4 years ago

I think the confusion came from the install setup via the Homebridge web UI. As soon as the plugin is installed, Homebridge pops up the configuration UI for the plugin, except the configuration looks like it's for the Rest (not Rest+ w/wifi), but that's not obvious. So the MAC address was for the Rest+. Removing that config and adding the username/pass config manually fixed it. That being said, it'd be nice if a bad MAC address or connectivity issue like this didn't crash all of homebridge.

Also, is it possible to set the default audio on the Rest+ like with the bluetooth Rest? It looks like it may be technically possible in the code for both, but I'm unclear what that configuration looks like.

dgreif commented 4 years ago

@FlipABit sorry for the confusion with the config. I originally built the plugin for the bluetooth rest, and then kept the config.scheam.json set up for that because it's more complicated than the rest+ config. I'm planning to re-work the whole config setup to make it more clear, but not sure when I'll have a chance to do it.

As for the default sound, it should just turn the light back on with the sound/color you had selected previously. If it doesn't, try changing your "favorites" in the Rest Sleep app to only contain a single favorite that is what you want. Let me know if that solves your issue.

dgreif commented 3 years ago

Closing due to inactivity