hycken / homebridge-fujitsu-hvac

Homebridge plugin for devices compatible with the FGLAir app.
MIT License
2 stars 0 forks source link

Plugin crashes HomeBridge on launch #2

Closed Flintr closed 1 year ago

Flintr commented 1 year ago

[1/13/2023, 10:18:51 PM] SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at KeyExchange.decrypt (file:///usr/local/lib/node_modules/homebridge-fujitsu-hvac/dist/api/serverModels.js:112:21) at LocalServer.handleDataPoint (file:///usr/local/lib/node_modules/homebridge-fujitsu-hvac/dist/api/localServer.js:91:41) at LocalServer.httpHandler (file:///usr/local/lib/node_modules/homebridge-fujitsu-hvac/dist/api/localServer.js:54:29) at processTicksAndRejections (node:internal/process/task_queues:95:5) [1/13/2023, 10:18:51 PM] Got SIGTERM, shutting down Homebridge...

hycken commented 1 year ago

I'm trying to reproduce, but if you can make it happen consistently, would you be able to go into dist/api/serverModels.js and add a debug message? On line 104, before the JSON.parse, like this:

   decrypt(message) {
        console.log('Key Exchange Message: "' + message + '"')
        const body = JSON.parse(message);

Then just post the latest one just before the plugin crashes.

Flintr commented 1 year ago

I sent you a Twitter DM because I'm not sure if the key exchange included any sensitive info

chriswalsh79 commented 1 year ago

I am seeing the same error, was there a solution to this?

Flintr commented 1 year ago

Fixed in an update. Was caused by my model of HVAC not reporting back current temperature via api (not in FGLair app either).