koryhutchison / homebridge-opensprinkler-api

Homebridge plugin to control OpenSprinkler with Homekit
Apache License 2.0
8 stars 0 forks source link

Cannot read properties of undefined (reading 'fwv') #17

Closed sobelman closed 1 year ago

sobelman commented 1 year ago

Hi there, After setting up the plug in I got this error:

 [HomebridgeOpenSprinklerApi] Cannot read properties of undefined (reading 'fwv')

Setup is:

OpenSprinkler FW: 2.1.0 (old one, and cannot be updated atm) Node: v18.12.1 HomeBridge: v1.6.0 (HAP v0.11.0)

And clue what can be the issue?

koryhutchison commented 1 year ago

So when I set things up, I make a request to your OpenSprinkler to get the firmware version (fwv) and it sounds like your version of the firmware must report it differently, or not at all. Do you mind manually hitting the API yourself? So you'd get your MD5 password and do this:

http://<host>/ja?pw=<your_md5_string>

And then can you paste your results in here? Also, you might want to look over the data that comes back to make sure it doesn't have any sensitive information in it.

sobelman commented 1 year ago

Hi, Thank you very much for your response,

So I can see I can get this answer for the following end point:

Request:

http://192.168.1.228/jo?pw=e10adc3949ba59abbe56e057f20f883e

Response:

{"fwv":210,"tz":28,"ntp":1,"dhcp":1,"ip1":192,"ip2":168,"ip3":1,"ip4":2,"gw1":192,"gw2":168,"gw3":1,"gw4":1,"hp0":80,"hp1":0,"ar":0,"ext":0,"seq":0,"sdt":0,"mas":0,"mton":0,"mtof":0,"urs":0,"rso":1,"wl":100,"den":1,"ipas":1,"devid":0,"con":110,"lit":100,"dim":15,"rlp":0,"uwt":0,"ntp1":50,"ntp2":97,"ntp3":210,"ntp4":169,"reset":0,"dexp":0,"mexp":5}

When trying to access this endpoint: http://<host>/ja?pw=<your_md5_string>

I got back: {"result":32}

(Page Not Found - (e.g. page not found or requested file missing))

I guess this is my API version I am using: https://openthings.freshdesk.com/support/solutions/articles/5000405359-api-document-firmware-2-1-0

Any chance to support this API version ? even as read only ?

Thanks

koryhutchison commented 1 year ago

Ah ok so yeah the ja endpoint simply returns everything that all the other ones return. I'll look into seeing if I can support this version, and let you know. If it becomes too much, then it might be where I can't support it. When I've got a beta version for you to test with I'll let you know.

Also for security sake, you might want to remove your MD5 Hash.

sobelman commented 1 year ago

Cool Thanks Appreciate your support and assistance

(password is for testing, its ok, thanks)

koryhutchison commented 1 year ago

Yeah so after looking at this I don't think I'll be able to support this firmware. Everything I've done should support at least v2.1.6. At least that's the API document where I first see the /ja endpoint. I'd have to really change things to make it work (And that/ja endpoint is all read only stuff anyways) And since v2.1.6 came out in 2016, I don't feel like I need to support anything farther back than that.

I think I should put a disclaimer in the README that explains the version I support. I'm so sorry but I just don't think it makes sense for me to try and support that old of firmware.