How can I add HikVision camera (problem with CORS)?

Moderator: leecollings

Post Reply
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

How can I add HikVision camera (problem with CORS)?

Post by fantom »

Hi

In postman i can call
http://IP:PORT/ISAPI/Streaming/channels/101/picture
with basic or digest auth, and i see a image.

In Domoticz I set this data, and when i click "Test connection" i don't see picture.

In network status i see "(blocked:origin)"

How can I fix it?
User avatar
habahabahaba
Posts: 212
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by habahabahaba »

I have 3 hikvision cameras. All works fine in Dz (etc. in Dzvents, 'http://<user>:<pass>@192.168.0.85/ISAPI ... 01/picture' - for taking picture)

May be Port number, user, password? https instead of http?
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by fantom »

I try set parameters in configuration->Cameras

I am providing exactly the same ones as via postman.

But error is weird. Its not something like 401,404,405 etc. Its "blocked origin".
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by waltervl »

Is the ImageURL correct? should be: /ISAPI/Streaming/channels/101/picture
Perhaps strange characters in userID or password?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by fantom »

Yes - url corrected - like in first post.
Zero weird characters in user/password.
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by waltervl »

Did you try ImageURL without the first slash?
ISAPI/Streaming/channels/101/picture
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by fantom »

I can set anything, and i always see in network:
picture (blocked:origin)

This is problem with CORS or something like that (I think).
User avatar
habahabahaba
Posts: 212
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by habahabahaba »

screenshots?
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by fantom »

I can change anything (ip, user, path etc) and i have always this same error in network.

In Postman i call http://192.168.1.xx:80/ISAPI/Streaming/ ... 01/picture and I can get picture.
Attachments
screenshot
screenshot
Capture.PNG (46.94 KiB) Viewed 2431 times
User avatar
habahabahaba
Posts: 212
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by habahabahaba »

May be try to update the firmware of camera?

And did you try to get image from dzvent-script?
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by fantom »

This is problem with routing/proxy or something like that i think

Camera have the newest firmware.

I don't use LUA :(
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by waltervl »

This preview is sometimes not working on this page. Perhaps check the normal functionality. Eg add a trigger switch and have the screenshot sent by email.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: How can I add HikVision camera (problem with CORS)?

Post by kimot »

First - I see your address "/channels/1/pic..." and for me works "/channels/101/pic..."

Second - Hikvision in manual recommends using strong passwords, but beware, you cannot use some characters in the http address.

For example my own painful experience when testing stream with VLC. My password contains a capital letter and a + character and VLC converted everything to lowercase letters before sending the address and removed + character. Therefore, I recommend a simple username and password for testing.
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest