-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support for iMou devices (DAHUA based) #6
Comments
My guess is I need to implement this #4 and it'll work. I don't have the hardware to test with so it makes implementing it a little difficult. I'll try to buy one of these cameras soon to test with. |
Greatly appreciate it! |
Hi, I have cameras model IPC-A22E (Imou Ranger2) and another IPC-C22EP-IMOU (Imou Cue2). I have tried adding them and neither of the two models works but I want to try to do more tests and activate the debug mode that you mention in the readme.md. If you need me to try something to test the cameras, do not hesitate to let me know. |
@gelokatil that would be the same issue as #4 I'm buying one of those cameras this week so I can build in support for it. Not sure how long shipping will take, but hopefully not to long. |
I also have two iMou Ranger 2 IPC-A22E cameras. With the windows app Smart PSS can be controlled locally, even the PTZ. When configuring, the program uses port 37777. If you need us to do any testing, here we are. Thanks for everything! |
I just ordered this. It’ll arrive Monday and I’ll try to get it working ASAP. |
I'am not able to connect to a IPC-HFW2100P. Is it the same issue? br, |
@paalj69 I'm not sure. |
The hardware arrived today. I hope to test it out soon. Will report back as soon as I know more. |
I have an Imou Ranger 2 (IPC-A22E) too! Thanks! |
Just have a imou Ranger Pro which is a new version having 2K, is it similar with the imou ranger 2? Look like it is IPC-A26HP. |
@inevity probably the same API. Just a heads up, I finally got this device hooked up so now I can start hacking away :) I'll continue to keep you posted. Sorry for the delays! |
OK this is going to take some work. This camera uses the RPC2 API (which is better because it's json based). The other cameras support the same RPC2 API but the way I coded this integration up was with the REST API. I'll have to either build a translation layer or switch to the RPC2 API (it'll just take some time). I'll see what I can do. |
Ok rroller, thanks in advance for all your work |
Thank you for the work you are doing. I don't think it's very useful, but with the ConfigTool app, which is inside the ToolBox app, you can change the image settings, like switching the compression of the main video to H264, making it compatible with HA, the bitrate, resolution etc ... |
Just to keep everyone posted, I've started to write the first bit of code for this. Nowhere near done, but at least it's a start 😆 |
I have the basic commands working with the RPC2 API (login, logout, get device details). This works great for all my Dahua cameras but it still doesn't work for the iMou camera. It will require more digging to understand what's going on. |
As far as I can tell, these cameras do not have an HTTP API. Unfortunately you have to connect over a socket and send the commands according to their protocol as seen here https://github.com/mcw0/PoC/blob/master/Dahua-3DES-IMOU-PoC.py |
I doubt this will help at all... but I just released 0.8.13 which uses the rpc2 API during the config flow. Can some of you try with the latest 0.8.13 release to see if you get further along when trying to add an iMou camera? I really doubt it will help, but I'd like to rule it out. |
Hi, I've tested with IPC-A22E and IPC-C22EP-IMOU and gives on both this error message. DEBUG (MainThread) [custom_components.dahua] Attempting login with URL http:https://192.168.20.34:80/RPC2_Login Traceback (most recent call last): |
Imou Ranger 2 Logger: custom_components.dahua TimeoutError fetching information from http:https://192.168.1.134:80/cgi-bin/magicBox.cgi?action=getMachineName - :( I already use this camera in HA with a standard onvif config, but I have a lot of lag and no PTZ (so I can't control the camera), just image. |
Nevermind, i've got the same result with or without the ONVIF integration |
Hello rroller, Maybe this is wasting time but I have been playing with the code you have named and I have successfully managed to connect to my camera through the IMOU cloud, passing it as the camera serial parameter. I'm not a programmer at all, but maybe the part of the code that authenticates to the cloud could be redirected to the local IP of the camera instead of going through their cloud. I have achieved it with this command passing the camera serial as a parameter. python3 dahua_3des.py --dhp2p XXXXXXXXXXXX -dd |
@gelokatil thanks. We don't want to use the cloud here and would like to stay completely local. I should have mentioned this before... the local username is With the mcw0 tools I was able to restart the device which means everything we want to do is doable, but it's doing all of this over socket communication. Writing a client for that is very tedious |
@mabusdogma that's the same that I'm getting. It's because the Dahua integration is trying to speak HTTP to an API that doesn't understand HTTP so the iMou device just hangs waiting for the right header bytes. If I send the right bytes over a socket I can make progress but it's going to take me awhile to really write something that works and to fully understand the protocol based on @mcw0's work (and hope that the API isn't different from Dahua's HTTP api). Right now this is going to be low on my list of things to do as I want to build in more support for native Dahua cams. |
Guys, thanks for "alerting" in the post, please let me know how I could help you out. FYI, I mostly use Dahua undocumented API, not the same as their official CGI API. |
By the way, the undocumented API I am mostly using working 99.9% with both HTTP/HTTPS and DHIP (DHIP, what I guess you refer as socket), and 2nd, I do have few IMOU devices that I testing/playing with ) |
Imou db60 doorbell? |
Hi, THX |
So do I understand correctly now that this feature will never come? I just bought two imou Rex devices (IPC-A46LP-D) but it has become clear that without this feature I'll have to return them, sadly they are not as 'onvif-ready' as implied... |
@sophof I'm very sorry that I'm short on time and can't dedicate time to get this working. Right now I won't have the time, maybe someone else will jump in and help out but not sure, it's not an easy problem to solve. But I think @VaLeXaR already did the actual hard work, so we need to integrate that. |
@rroller Sorry, I see now that my comment was a bit harsh, it wasn't intended that way. It simply was unclear to me what the status was in general. Since I just bought them I still have a window where I can return them, so I really wanted it to be clear, that was all :) I have some experience working on home assistant integrations, but none on camera's and their API's but maybe I can help @VaLeXaR (under similar time constraints :P)? I had a look at your code a few days ago, but I discounted it because it was about coaxial control, so I assumed it wasn't relevant? |
After reading some more I think I understand, let me try to summarise. These cameras exclusively use the RPC2 API, where the current integration uses a REST api, which works for most older cameras. For coaxial control @VaLeXaR needed to use the RPC2 api, so he further adjusted that for his usecase. However, all currently supported camera's, including those via the 'current' rpc2 api communicate through HTTP/HTTPS, where the imou camera's for some reason only use something called DHIP. It stands to reason that they haven't written an entirely new API, so probably what is needed is some way to 'translate' (my knowledge isn't deep enough to understand what is needed for that). I see @mcw0 is working on a dahua console that supports DHIP and is in pre-alpha status though. Presumably this is the same work in essence? |
@sophof DHIP is the way to go, working both on HTTP/HTTPS and binary mode. CGI stuff totally sux, just lacking lots of stuff. I did some attempts for making it as python library, but I'm far from done, as I have other things to do. However, if @rroller , @sophof or anyone else are interested to work with that as well, I can setup a repo for that. |
@mcw0 Yeah, I saw that your code was currently at the 'pre-alpha' stage. Sadly, my level of knowledge about these communication protocols is literally zero, so it would require a lot of effort for likely little result from my part. [edit] In the end I decided to keep the cameras since other alternatives (available here at least) all had other disadvantages. So I'm still interested but also still lacking in skills :P |
With this 'coaxial control' variant, I can enter the Imou IPC-A22E. Also the camera view works, the other entities don't seem to work. |
Hey, I have the same Imou camera, how did you make it work? I Installed the coaxial_control, set the username/password and so on, but I just get this message: Dahua device at 192.168.1.xxx isn't fully initialized yet Did you select some specific features? (at the beginning, there was a lot of checkboxes and I set them all on 'check', did you?) something else I'm missing, maybe? |
this is the error log:
|
Well, installing the coaxial control version, restart HA, and log in. If I reload the integration, it gives me the same error as you, but if I disable it and reactivate it, it logs in without problems. But little else can be done, since no sensor gives correct information, no switch works because from what I understand the cgi commands don't work. |
Now it works! but... is there a chance to use PTZ to control from HA? To be honest I started to follow this thread more than a year ago because I want to control on HA what the camera sees, and to open/close the camera, so I could inactivate video when I'm home for privacy. |
In fact, I'm the same as you, right now they are in a drawer precisely because there is no option to move or disable the video. I commented to report that the coaxial control version was logging into the Imou Ranger 2 IPC-A22E, the current main version never gets around to logging in. |
I can confirm this is working with the Cruiser SE+ (IPC-S21FE), including pan+tilt controls, but no mic support. |
Good news for people with Imou cameras: Just look at this! Now I can automate when to open and close the transmission (from HA) or detect people, or to set the alarm... |
Sadly that is a non-local solution, which is a deal-breaker for me. |
I hope there's a local solution soon, I like the idea too |
Hello, I bought the Ranger 2C... this is the fourth camera I bought, as you I am upset by manufacturers applications and clouds, I was thinking after few reading that this one was able to work locally without any requirment of creating an account or using a mobile app... I am also trying to hack this thing but dont want to loose a huge amount of time, I wonder if I am not going to re-sent this device... I got a ten years old camera from TPLink in my garage that I was able to make running in a cupple of minutes using its web gui... nowadays all mannufacturers try to force theirs applications this is really discouraging |
For now I have just connected to it using its Wifi AP and password written on the camera, doing a port scan give me 80 & 554 TCP open but no HTTP layer, any HTTP request fall in timeout, no response, at TCP layer just an ACK no payload. I'll try to use my computer as a wifi AP and make the first official steps, see what I can grab but I have few hopes to get anything usable. |
I knew, it was not going to be that simple... After a bit more than one hour here is what I was able to make : 1 - make my computer appear as to be the camera for the mobile application. 2 - make my computer appear as to be the mobile application for the camera So finally, the start of the scenario is : So next step, is to respond to the webcam for its DNS request for devaccess.easy4ipcloud.com an try to proxy all requests. Not sure I will do this. |
Use the SmartPSS application to change the DNS and hostname. You need to connect over TCP port 37777. The username is "admin" and the password is your |
The correct RTSP format looks like this
|
Yes in the mean time I bought an Amcrest camera (because it works with it own integrated web interface) and was nicely surprise to see that the mobile Amcrest application detect it aswell as other camera configuration application like Dahua conifg tool. Anyway, thanks for your tips. EDIT: SmartPSS is very nice |
Does your RTSP stream still work? Bought a brandnew IPC A22EP-0 (Ranger 2C), updated to firmware version 2.800.0000000.13.R.230708 and did not manage to make RTSP work Update: The problem was my VLC media player. |
HI eadmaster |
Is there chance of this working with imou Ranger 2 cameras, which are based on DAHUA IPC-A22EP?
The text was updated successfully, but these errors were encountered: