laszlojakab / hikvision-intercom-python-demo

Hikvsion intercom Python demo
MIT License
19 stars 6 forks source link

"cannot open shared object file: No such file or directory" error is coming while cdll.LoadLibrary() #7

Closed Vignesh-AK closed 1 year ago

Vignesh-AK commented 1 year ago

"cannot open shared object file: No such file or directory" error is coming while cdll.LoadLibrary()

File "/home/cf/hikvision-intercom-python-demo/hcnetsdk.py", line 162, in HCNetSDK = cdll.LoadLibrary(hcnetsdk_path) File "/usr/lib/python3.9/ctypes/init.py", line 452, in LoadLibrary return self._dlltype(name) File "/usr/lib/python3.9/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: /home/cf/hikvision-intercom-python-demo/EN-HCNetSDKV6.1.9.4_build20220412_linux64/lib/libhcnetsdk.so: cannot open shared object file: No such file or directory

pergolafabio commented 1 year ago

check if your path is correct, or maybe permission error?

pergolafabio commented 1 year ago

are you using Home Assistant btw?

Vignesh-AK commented 1 year ago

I am not using Home assistant. Just running this in rasperrypi (debian). The path is correct. I have validated it with linux command

pergolafabio commented 1 year ago

the sdk is not supported for Aarch64 , only x64

pergolafabio commented 1 year ago

try this folder, i got sdk from hikvision, but never tested , since i dont have an RPI take this folder:

https://github.com/pergolafabio/Hikvision-Addons/tree/main/hikvision-sdk/lib-arm_aarch64-linux

Vignesh-AK commented 1 year ago

Is there any way we can install SDK ?

pergolafabio commented 1 year ago

take my folder, in reply above, its an SDK for RPI (aarch64) but i have never tested it keep me posted

Vignesh-AK commented 1 year ago

Thanks

Vignesh-AK commented 1 year ago

That's working !

pergolafabio commented 1 year ago

Aha, cool, you are the first confirming that it works on RPI :-)

Vignesh-AK commented 1 year ago

Yeah its working bro

pergolafabio commented 1 year ago

yeah, but how did you fix error 29 ? what was the issue?

cerahmed commented 1 year ago

try this folder, i got sdk from hikvision, but never tested , since i dont have an RPI take this folder:

https://github.com/pergolafabio/Hikvision-Addons/tree/main/hikvision-sdk/lib-arm_aarch64-linux

I'm running into the same problem while running the code in RPI. @pergolafabio @Vignesh-AK, the link for the aarch64 is no longer working, do you still have a copy of the files you can share?

pergolafabio commented 1 year ago

Sure, look here for addon:

https://github.com/pergolafabio/Hikvision-Addons/tree/main

source and project can be found here:

https://github.com/pergolafabio/Hikvision-Addons/tree/dev/hikvision-doorbell

cerahmed commented 1 year ago

Thanks a bunch @pergolafabio! It's now working great on the pi. My sole purpose of using this script it to detect when the unlock button is pressed from my indoor station, then run a custom script.

Thanks again for this useful script!

pergolafabio commented 1 year ago

if you want , you can use my project, it can also run as standalone container, also on dockerhub it can capture a lot more events!

cerahmed commented 1 year ago

if you want , you can use my project, it can also run as standalone container, also on dockerhub it can capture a lot more events!

I am indeed using your project in conjuction with the aarch64 Hikvision SDK to achieve this.

pergolafabio commented 1 year ago

Perfect:-)