valiquette / homebridge-rachio-irrigation

Provides Homebridge support for Rachio controller
MIT License
17 stars 4 forks source link

v1.0.6 - no file read SyntaxError: Unexpected end of JSON input #6

Closed rcoletti116 closed 2 years ago

rcoletti116 commented 2 years ago

The irrigation controller doesn't work in v1.0.6, v1.0.5, and v.1.0.4

Here is an error on startup. [31/08/2021, 16:17:31] [Rachio] no file read SyntaxError: Unexpected end of JSON input at JSON.parse () at new RachioPlatform (/usr/local/lib/node_modules/homebridge-rachio-irrigation/index.js:86:35) at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40 at Array.forEach () at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)

v1.0.3 doesn't contain the error and works.

valiquette commented 2 years ago

Can I ask what platform you are running homebridge on? Those versions introduced a comparison of the plugin's config file to the previous version, if there is a change it removes the plugins cache to start fresh. In the Storage path dir there should be a file called file called previousconfig.json. If you delete that file I suspect those version will launch. I will look at what i can to do to address this assuming it is a corrupt file. please let me know.

valiquette commented 2 years ago

I was able to replicate this issue by corrupting the previousconfig.json file. and confirmed that removing it will remove that error. I have a fix that will remove the file automatically on that error. I should be able to publish that fix soon.

rcoletti116 commented 2 years ago

Sounds good. To answer your first question, I'm running the Homebridge Image on Raspberry Pi.

valiquette commented 2 years ago

fixed in v1.1.0

rcoletti116 commented 2 years ago

confirmed, no longer getting the error and device is being created.