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

Unable to login #9

Closed
djw8625 opened this issue Jun 10, 2022 · 16 comments
Closed

Unable to login #9

djw8625 opened this issue Jun 10, 2022 · 16 comments

Comments

@djw8625
Copy link

djw8625 commented Jun 10, 2022

Hello,

I'm getting the below error when trying to connect my Hik system.

Error: Error: Login failed, wrong account or password
at HikConnectPlatform._loginToHikConnect (/var/lib/homebridge/node_modules/.pnpm/homebridge-hikconnect@1.2.1/node_modules/homebridge-hikconnect/src/index.js:49:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at HikConnectPlatform.discoverDevices (/var/lib/homebridge/node_modules/.pnpm/homebridge-hikconnect@1.2.1/node_modules/homebridge-hikconnect/src/index.js:30:7)

My credentials work at https://www.hik-connect.com/devices/page

Can you help?

@judge
Copy link
Owner

judge commented Jun 14, 2022

Hello,
Did you add the account and password fields to the configuration of the plugin? If you are using Homebridge then a popup should appear on installation asking for these info. If you using HOOBS you need to add these to the configuration manually.

@djw8625
Copy link
Author

djw8625 commented Jun 14, 2022 via email

@judge
Copy link
Owner

judge commented Jun 14, 2022

Then everything should be fine on the plugin side. If you log in to hik-connect.com with your browser, can you access this URL? It should return a big JSON file.
If you can, could you paste your config file? But please remove the account/password values. :)

@djw8625
Copy link
Author

djw8625 commented Jun 14, 2022

Here you go :-)

{"connectionInfos":{"F35385585":{"localIp":"192.168.40.86","netIp":"82.19.164.15","localRtspPort":0,"netRtspPort":0,"localCmdPort":9010,"netCmdPort":9010,"localStreamPort":9020,"netHttpPort":0,"localHttpPort":0,"netStreamPort":9020,"netType":3,"wanIp":null,"upnp":false}},"cameraInfos":[],"p2pInfos":{"F35385585":[{"ip":"34.249.121.84","port":6000},{"ip":"52.30.47.10","port":6000}]},"alarmNodisturbInfos":{"F35385585":{"alarmEnable":0,"callingEnable":0}},"kmsInfos":{"F35385585":{"secretKey":"bca03532ca1d4d1b80aa54f0f330aa40921193d3ea04d951aff0daab425fb8af","version":"101"}},"timePlanInfos":{"F35385585":[{"deviceSerial":"F35385585","channelNo":0,"type":2,"enable":0,"weekPlans":[{"weekDay":"0","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"1","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"2","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"3","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"4","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"5","timePlan":[{"startTime":"00:00","endTime":"23:59"}]},{"weekDay":"6","timePlan":[{"startTime":"00:00","endTime":"23:59"}]}]}]},"statusExtInfos":{"F35385585":{"upgradeAvailable":0}},"meta":{"code":200,"message":"操作成功","moreInfo":{}},"page":{"offset":0,"limit":100,"totalResults":0,"hasNext":false},"statusInfos":{"F35385585":{"diskNum":1,"diskState":"0---------------","globalStatus":1,"pirStatus":0,"isEncrypt":1,"encryptPwd":"6b835f7812ef4a4359af7d394037d520","upgradeAvailable":0,"upgradeProcess":100,"upgradeStatus":2,"alarmSoundMode":0,"optionals":{"latestUnbandTime":"1622474044794","updateCode":"0","diskHealth":"-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1","httpPort":"0","OnlineStatus":"2","cmdPort":"0","upnpMappingMode":"0","diskCapacity":"953869,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1","wanIp":"82.19.164.15","kms_version":"100","domain":"F35385585","superState":"0","latestUnbindTime":"1622474044794"}}},"wifiInfos":{"F35385585":{"netName":"eth0","netType":"wire","address":"192.168.40.86","mask":"255.255.255.0","gateway":"192.168.40.1","signal":0,"ssid":null}},"switchStatusInfos":{"F35385585":[{"deviceSerial":"F35385585","channelNo":0,"type":31,"enable":false}]},"deviceInfos":[{"name":"iHomeCCTV","deviceSerial":"F35385585","fullSerial":"DVR/DVS-12-A0420201230CCWRF35385585WCVU","deviceType":"DVR/DVS-12-A","devicePicPrefix":"https://devpic.ezvizlife.com/device/image/DVR-DVS-12-A/","version":"V4.20.001 build 190430","supportExt":"{"44":"1","26":"4","29":"1","175":"1","154":"1","232":"0","233":"0","234":12,"30":"1","31":"1","10":"1","11":"0","33":"1","99":"1","34":"1","13":"0","59":"1","1":"1","2":"1","3":"1","4":"1","5":"0","6":"0","7":"0","8":"0","9":"1"}","status":1,"userDeviceCreateTime":"2021-05-31 15:17:46","casIp":"eucas.ezvizlife.com","casPort":6500,"channelNumber":12,"hik":true,"deviceCategory":"COMMON","deviceSubCategory":"UNKNOWN","ezDeviceCapability":"{"264":"1","232":"0","265":"1","233":"0","266":"1","234":1,"268":"1","30":"0","31":"0","262":"1","175":"1","263":"0"}","customType":"DS-7204HUHI-K1/P","offlineTime":"2022-06-08 01:02:52","offlineNotify":0,"accessPlatform":true,"deviceDomain":"F35385585","instructionBook":"http://devpic.ezvizlife.com/device/image/DVR/DVS-12-A/instruction.jpeg","deviceShareInfo":null,"feature":null,"riskLevel":0,"offlineTimestamp":1654650172000}]}

@judge
Copy link
Owner

judge commented Jun 14, 2022

This is pretty strange. According to this the plugin should not work because your device does not expose lock information. Does your device have lock functionality?

@djw8625
Copy link
Author

djw8625 commented Jun 14, 2022 via email

@judge
Copy link
Owner

judge commented Jun 14, 2022

Some of the HikVision cameras have lock functionality and this plugin exposes those locks to Homekit so you can unlock from Home app.
Currently the plugin does not display camera feeds, it only exposes locks.

@kellery82
Copy link

kellery82 commented Jul 24, 2022

I’m having issues every now and again where I’m getting invalid login information and the lock does not work. I’m able to log in to Hik-Connect via a web browser ok, but just have to constantly restart homebridge to hopefully get the lock working again. Any ideas? I’m happy to post logs.
0DF706B2-5F63-4773-86F6-DD3F38C4617E

@judge
Copy link
Owner

judge commented Jul 25, 2022

Honestly I have no idea, I'm also using the plugin constantly and I have no problems logging in.
When you try to log in through the web, do you get captcha? Because if so, you have to 'break' the captcha on the web and then the plugin can logs in.

@kellery82
Copy link

Honestly I have no idea, I'm also using the plugin constantly and I have no problems logging in.
When you try to log in through the web, do you get captcha? Because if so, you have to 'break' the captcha on the web and then the plugin can logs in.

Thanks for your reply Judge. No, when logging in it’s just username and password. I did have to accept some terms and conditions maybe a week or so ago, but now just logging in gets me straight into Hik-Connect. Maybe I’ll restart my synology which hosts homebridge.

@kellery82
Copy link

I just tried manually specifying the api and that seems to have worked

@judge
Copy link
Owner

judge commented Jul 27, 2022

You mean if you set the API URL to https://api.hik-connect.com then it works? It's strange because the default url is also the same. :)

@kellery82
Copy link

You mean if you set the API URL to https://api.hik-connect.com then it works? It's strange because the default url is also the same. :)

I actually changed the URL to https://ius.hik-connect.com. Whether this is being ignored it seems to have fixed the issue. Has been working since doing this change. I tried removing, readding the plug-in, restarts prior and nothing seemed to work.

@judge
Copy link
Owner

judge commented Aug 7, 2022

Can I ask which country are you from? It seems some countries have different API urls, like in Russia it's https://www.hik-connectru.com

@kellery82
Copy link

I'm in Australia which makes it strange. Still working like a treat without the need for reboots

@judge
Copy link
Owner

judge commented Aug 9, 2022

That is strange indeed. :)
Anyway, I'm happy that it works fine and I'll close this, I'll try to update the README with API URL recommendations including this.
Thanks!

@judge judge closed this as completed Aug 9, 2022
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

3 participants