[RELEASE] Amcrest IPM-721 & IP2M-841 LIVE Video/PTZ/Night Vision/Motion/Video Record/+More IP Camera DTH

I just picked up an IPM-HX1, and am able to pass the username/password through a browser. But I’ve been unable to get the DTH working in SmartThings.
Just to clarify I’m entering info correctly…
IP Address is the local network IP address.
Port is this the UDP? HTTP? RTSP?
Username/Password is for the camera, not an Amcrest account correct?

Thanks.

Looks like there hasn’t been a lot of responses lately. Am I safe to assume that if I just bought one of these that this DH will not work?

Read the very top of the first post. If you downgrade your firmware then it will work.

However, I called Support and escalated my problem to the top of their mgmt chain. This is pure BS. Release a product and document the API which clearly shows basic auth — only then to kill it off and piss off customers.

2 Likes

http login requires the mouse to select the password (or possibly the user id box), until it is done text will not be accepted. i wonder if this is enabled on rstp?

https://technet.microsoft.com/en-us/library/cc780170(v=ws.10).aspx

Not entirely accurate… mouse is not required to pass basic authentication. In your browser, try http://user:password@ip_of_cam — also can Google for “passing basic authentication url”

User colon password @ website. This is very typical and has been a standard for like 20 years. However, RTSP is enabled and can be accessed via similar means as passing credentials via URL. Here’s my Home Assistant URL used for Amcrest RTSP…

rtsp://user:password@192.168.0.111:554/cam/realmonitor?channel=1&subtype=0

Lastly, basic auth is fast and reliable while the others have proven to be a little slower. We also get way more compatibility from all platforms like SmartThings, Home Assistant, etc. without trying hard. They should have left it in and made it optional. Features/reasons for me buying a product should not be removed… BTW, I can flash the old firmware before basic auth was removed, but that will break cloud capability. Double edged sword and an angry customer of Amcrest as you can see as a result of this feature removal :slight_smile:

Does a factory reset reinstall the firmware that was originally on the camera? I doubt it, but I am curious.

Edit: Is the consensus that there is no solution if you upgrade firmware? I screwed up and updated it. Ugh.

Thanks.

Just got a new Amcrest 721s and was worried it would have the newer FW. Evidently I don’t as this appears to have setup great.

I have the device in my Things list and can see video from the camera in the SmartApp. A Woot for that. :slight_smile:

1 Like

@Belgarion I just ran across this DH that is handling digest auth with Samsung SmartCams. Would this work for the updated Amcrest devices?

1 Like

I’ve got a persistent indication that an update is available for this DTH (purple text in IDE). I complete an update/publish (multiple times) and it remains purple/indicating there is an update.

Anyone else?

Although I haven’t tried using this DTH, I have been using webCoRE and trying to use it to interact with my Amcrest IP2M-841 (w/ software version 2.520.AC00.18.R, Build Date: 2017-06-29) via webCoRE’s “make a web request” action. I have found a way to make it work. Basically, I have to use an external IP address and port (that then gets port forwarded to my camera via my Internet router.) In this scenario, webCoRE/ST is apparently able to use digest authentication. (The request is http://username:password@external_ip:external_port/cgi-bin?..) But, if I try to use the camera’s local IP address (and port) instead, without changing anything else, it fails with HTTP error 408 (timeout.) webCoRE/ST appears to be sending the request differently depending on whether I use an external vs an internal IP address. (In theory it’s able to send the request on my LAN direct from the hub to the camera, as opposed to sending it via the Internet???) If you’re interested, you can read my discussion on the webCoRE forum here:

The reason I’m mentioning this here is because I believe you had concluded that ST can’t do digest authentication, but my experience seems to disagree.

1 Like

At one point I had these working, but when I switched over to the DDNS url I get errors:

error java.lang.NullPointerException: Cannot invoke method toUpperCase() on null object @line 888 (hubGetImage)
warn IP Address is invalid (null), Error: java.lang.NullPointerException: Cannot invoke method tokenize() on null object
error Exception: java.lang.NullPointerException: Cannot invoke method take() on null object
warn IP Address is invalid (null), Error: java.lang.NullPointerException: Cannot invoke method tokenize() on null object
error Unable to convert hostname to IP Address, Error: groovyx.net.http.ResponseParseException: Forbidden

Any luck on fixing this?

I have not.

I’ve made progress using this code. I need to rewrite it to get the PTZ commands to work continuously. Hopefully I’ll have some time to do that. In any case I can connect and send digest commands to my Amcrest camera.

1 Like

I’m struggling to get MJPEG (streaming/image capture) to work.

Otherwise I’ve gotten Digest to work for all the commands. Nice to have control of my camera through SmartThings again. I’m running everything local so I don’t know if this works with public interfaces. Also Digest is unfortunately noticably slower than Basic authentication.

As long as @Belgarion is fine with it, I’ll post an update after some additional tweaking.

5 Likes

I took another look at this today and think the image capture issues I’m seeing may be a limitation or something in the SmartThings Hub. The request for an image works fine. I receive an image back but the hub always returns an empty body field even though the content-length definitely shows an image is returned. I’ll try and see if I can figure anything else out.

Woohoo! I got the image capture to work as well. Still waiting on comments from @Belgarion as I would prefer to continue to use his images.

From his code:

The images and/or files that originate from "http://smartthings.belgarion.s3.amazonaws.com/"
are for use within THIS code only and any reference to these resources beyond this use is
expressly prohibited.

In any case, if you want to try out the new code give me a PM.

4 Likes

Total noob here and I’ve read the the thread twice lol…how do you change your rtsp url? Mine is rtsp://ip/stream1. Thank you!

I need a little help, I can’t fine the Device Network ID for my amcrest camera, I followed your steps in the screenshots above (I had to enable github integration first). Since my cameras do not show up in graph.api.smartthings.com under my devices (I tried to add the camera from the smartthings original iPhone app but can’t). Out of desperation I selected AMCRESTCAM02 because you had that in your example. I do have two amcrest cameras, one is Model IPM-HX1B and the is Model IP3M-HX2W. Any ideas on how I can find the Device Network ID?

Don’t use that URL to try to log into your hub.

Go to https://account.smartthings.com