Describe the bug
When openHAB2 is not available e.g. after reboot, homebridge crashes with an unhandled ECONNREFUSED exception within the isOnline() function (see log below).
Expected behavior
homebridge-openhab2-complete should wait until openHAB2 is available instead of crashing homebridge.
Feb 06 18:45:59 raspberrypi homebridge[2371]: [06/02/2020, 18:45:59] [openHAB2-Complete] Waiting for openHAB host (http://raspberrypi4.fritz.box) to come onl ine...
Feb 06 18:46:03 raspberrypi homebridge[2371]: [06/02/2020, 18:46:03] [Config] Homebridge Config UI X v4.9.0 is listening on :: port 8081
Feb 06 18:46:05 raspberrypi homebridge[2371]: [06/02/2020, 18:46:05] Error: connect ECONNREFUSED 192.168.0.35:8080
Feb 06 18:46:05 raspberrypi homebridge[2371]: at extractValue (/usr/lib/node_modules/homebridge-openhab2-complete/node_modules/sync-rpc/lib/index.js:165: 19)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at /usr/lib/node_modules/homebridge-openhab2-complete/node_modules/sync-rpc/lib/index.js:175:12
Feb 06 18:46:05 raspberrypi homebridge[2371]: at request (/usr/lib/node_modules/homebridge-openhab2-complete/node_modules/sync-request/lib/index.js:28:15 )
Feb 06 18:46:05 raspberrypi homebridge[2371]: at OpenHAB.isOnline (/usr/lib/node_modules/homebridge-openhab2-complete/util/OpenHAB.js:68:27)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at new OpenHABComplete (/usr/lib/node_modules/homebridge-openhab2-complete/index.js:80:45)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:337:32)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:90:36)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
Feb 06 18:46:05 raspberrypi homebridge[2371]: at Module._compile (internal/modules/cjs/loader.js:1151:30)
Feb 06 18:46:05 raspberrypi homebridge[2371]: [06/02/2020, 18:46:05] Got SIGTERM, shutting down Homebridge...
Feb 06 18:46:10 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=143/n/a
Feb 06 18:46:10 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Environment (please complete the following information):
OS/Environment: Debian on RaspberryPi4
Homebridge Version 1.1.0
NodeJS Version 13.7.0
Additional context
The issue #63 may be related to this as it often seems to occur after a hard crash of homebridge.
Describe the bug When openHAB2 is not available e.g. after reboot, homebridge crashes with an unhandled ECONNREFUSED exception within the
isOnline()
function (see log below).Expected behavior homebridge-openhab2-complete should wait until openHAB2 is available instead of crashing homebridge.
Configurations
Logs:
Environment (please complete the following information):
Additional context The issue #63 may be related to this as it often seems to occur after a hard crash of homebridge.