Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Pi5 #129

Open
pofamacska opened this issue Jan 23, 2024 · 1 comment
Open

Not working with Pi5 #129

pofamacska opened this issue Jan 23, 2024 · 1 comment

Comments

@pofamacska
Copy link

The plugin makes homebridge to cars and go into a crash - shut down - restart - crash cycle endlessly with this error message:
AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
at Bridge.Accessory.setupURI (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
at Server.setServerStatus (/var/lib/homebridge/node_modules/homebridge/src/server.ts:155:45)
at Server.teardown (/var/lib/homebridge/node_modules/homebridge/src/server.ts:199:10)
at signalHandler (/var/lib/homebridge/node_modules/homebridge/src/cli.ts:93:12)
at process.emit (node:events:517:28)
at process.emit (/var/lib/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)

Any idea how to avoid this?

@rajkundu
Copy link

I had this issue too on a Pi Zero 2 W with the latest versions of everything (clean install). The full stack trace was as follows:

homebridge-gpio-device API version: 2.7
[20/07/2024, 18:45:04] Registering accessory 'homebridge-gpio-device.GPIODevice'
[20/07/2024, 18:45:04] ---
[20/07/2024, 18:45:04] Loading 1 platforms...
[20/07/2024, 18:45:04] Loading 1 accessories...
[20/07/2024, 18:45:04] [Front Door] Initializing GPIODevice accessory...
[20/07/2024, 18:45:04] Error: EINVAL: invalid argument, write
    at Object.writeFileSync (node:fs:2368:20)
    at exportGpio (/var/lib/homebridge/node_modules/homebridge-gpio-device/node_modules/onoff/onoff.js:18:8)
    at new Gpio (/var/lib/homebridge/node_modules/homebridge-gpio-device/node_modules/onoff/onoff.js:172:36)
    at Object.init (/var/lib/homebridge/node_modules/homebridge-gpio-device/index.js:22:19)
    at new LockMechanism (/var/lib/homebridge/node_modules/homebridge-gpio-device/index.js:432:7)
    at new DeviceAccesory (/var/lib/homebridge/node_modules/homebridge-gpio-device/index.js:140:18)
    at /var/lib/homebridge/node_modules/homebridge/src/server.ts:367:50
    at Array.forEach (<anonymous>)
    at Server.loadAccessories (/var/lib/homebridge/node_modules/homebridge/src/server.ts:287:29)
    at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:167:12)
[20/07/2024, 18:45:04] Got SIGTERM, shutting down Homebridge...
[20/07/2024, 18:45:04] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
    at Bridge.Accessory.setupURI (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1004:11)
    at Server.setServerStatus (/var/lib/homebridge/node_modules/homebridge/src/server.ts:143:45)
    at Server.teardown (/var/lib/homebridge/node_modules/homebridge/src/server.ts:187:10)
    at signalHandler (/var/lib/homebridge/node_modules/homebridge/src/cli.ts:94:12)
    at process.emit (node:events:519:28)
    at process.emit (/var/lib/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
[20/07/2024, 18:45:09] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[20/07/2024, 18:45:14] [HB Supervisor] Restarting Homebridge...
[20/07/2024, 18:45:14] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules -D --strict-plugin-resolution
[20/07/2024, 18:45:14] [HB Supervisor] Started Homebridge v1.8.4 with PID: 3392
[20/07/2024, 18:45:16] Loaded config.json with 1 accessories and 1 platforms.
[20/07/2024, 18:45:17] Loaded 0 cached accessories from cachedAccessories.
[20/07/2024, 18:45:17] ---
[20/07/2024, 18:45:17] Loaded plugin: [email protected]

Thus, the root issue is EINVAL: invalid argument, write in the onoff package, and Googling this error led me to this StackOverflow answer:
https://stackoverflow.com/a/78184108
which solved the issue for me. It is perhaps a bit of a hacky workaround, but my use case is quite simple. Hope this helps someone else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants