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

I added the presets in the web view tool. The presets work in the web view tool. I can use the UP, DOWN, LEFT, RIGHT and numbered presets in the web view tool and see the camera move in the SmartThings app. However, these functions in the app do not affect the camera.

I have tried deleting the presets and recreating them as well as recreating the Device and Device Handler.

Very strange since I can turn on debug and see the app sending the commands.

That is VERY strange.

Can you try taking one of the command URI’s from the debug log and paste it directly into your browser address bar? Does that work?

The command URI for preset #1, substituting your username, psswd, IP and port as appropriate, should look something like this:
http://username:psswd@192.168.100.100:80/cgi-bin/ptz.cgi?action=start&channel=0&code=GotoPreset&arg1=0&arg2=1&arg3=0&arg4=0

Sorry for the delay. Yes, taking the URI from the debug into the browser does work to move the camera.

The debug showed:
hubGet -> hubAction = GET /cgi-bin/ptz.cgi?action=start&channel=0&code=GotoPreset&arg1=0&arg2=6&arg3=0&arg4=0 HTTP/1.1

So in the browser I used:
http://mydomain.com/cgi-bin/ptz.cgi?action=start&channel=0&code=GotoPreset&arg1=0&arg2=6&arg3=0&arg4=0

Seems to work for others, so it could be my environment. I’ll keep plugging away at it. PTZ functions aren’t too critical. I also run the full Amcrest app on my mobile.

Thanks for the app and all your help.

I think I am also seeing the same issue. Let me know if there is anything I can do to help with debug.

Just noticed this comment and figured I would reply. That IP would actually be a public IP.

The private IP addresses are:
192.168.0.0 - 192.168.255.255
172.16.0.0 - 172.31.255.255
10.0.0.0 - 10.255.255.255

Trying to get this device set up, I’m not really sure what to type into the port or the video channel.

Which port do I put in? TCP? UDP? HTTP? RTSP?

Also, I have HTTPS enabled on the camera, will that mess anything up?

And is the channel just a 1? Or a 2?

Yes, the IP was a typo on my part.

Try the different protocols and ports that you have setup in the Amcrest Web View. When you get that working, you will have your answers.

There are many combinations that work and I have given examples of a few, but to quote JDRoberts: Your use case may not be my use case.

Okay, I guess I’ll play around. I have all the default settings so I was hoping there would be an easy answer.

I wasn’t sure what protocol (RTSP, UDP, TCP) SmartThings / The Device Type is written to support.

Regarding the video and MJPEG vs. RTSP, depending on how you configured your camera the answer is “both”. There is a switch button in the DTH to allow you to toggle back and forth, but your camera has to have the ports defined that you are giving the DTH.

Let me try to fill in a few more details:

Protocol used:
From the Amcrest camera settings you are looking at the HTTP Port and RTSP Port values under Network -> Connection page.

HTTPS is not supported.

RTSP is currently hard-coded to use port 554, which is the default for the camera.

If you are using the camera locally with the default settings and you have not done any port mappings, the port is 80.

I hope that helps.

Okay, thanks. I turned debug on and copied the url it’s using from the debug output. It works fine in my browser, but still not working in the SmartThings app. I guess I’ll just have to figure it out.

What is not working? Is this another PTZ issue? Snapshots? Video?

What is the URL that you pasted in the browser (minus username & password)?

Video stream won’t load, just says “Camera Unavailable”. I’ve tried switching between RTSP and MJPEG, but same results. Sorry, I didn’t mean to report an issue as it’s probably specific to me, I just assumed it was/is a configuration issue / user error and that it would be a quick answer quick fix. Normally I’d do more research into it before posting up for help.

Also when I hit the snapshot button, it just says “taking” for a long time, but nothing happens.

URL:
http://[username]:[password]@[ip-address]:80/cgi-bin/mjpg/video.cgi?channel=0&subtype=0

Are there any “Error” messages in the logs with debug mode turned on?

Or a “401 Unauthorized”?

No, none.

debug ipIsLocal -> Host IP ‘192.168.0.3’ is Local

debug ipIsLocal -> Found = 1100000010101000

debug convertIPtoBinary -> IP address passed in is 192.168.0.3 and the converted binary is 11000000101010000000000000000011

debug videoStart -> Streaming MJPEG video; apiCommand = /cgi-bin/mjpg/video.cgi?channel=0&subtype=0, IP = 192.168.0.3, Port = 80

info videoStart -> Turning Video Streaming ON

Yes, but what happens when you try to “Pan Right”.

Grab the logs (including the "parse -> "… lines) and paste them here so I can see what is happening.

I just re-installed this driver on 1 of my Amcrest cameras to test this and the snapshot, video and PTZ all work fine. So let’s see why yours is failing.

Okay, here is everything. I decoded the headers, removed the authorization bits, removed the Device GUID and removed the MAC address, but other than that it’s a copy paste. I don’t know what parts are security risks.

PTZ works, but video isn’t showing.

DONT KILL ME…if this is the reason…but does it have anything to do with me being at work…does the video stream not work over remote connections? I assumed it would be relaying through the ST hub…

Here’s the output:
https://dl.dropboxusercontent.com/u/17840535/STOutput.txt

Presets work, PTZ works, Zoom works, everything works. Just can’t seem to get video.

:scream: :confused: :confounded:

Yes, that does matter.

You are basically issuing commands to your work WiFi.

If you want to control your home cameras remotely (outside of your home WiFi network) then you need to either establish a VPN connection (difficult, requires additional software and/or hardware) or use a DNS service that will map your public IP to a defined name.

Try this when you get home and let me know if you are still having problems while connected to your home WiFi.

Wait… I am confused… how to you know PTZ and presets work???

I kinda figured that was the case lol. Sorry. I’ve had that in the back of my mind this whole time, but I thought that it would use the ST hub as a relay for the snapshots and mjpeg streaming. I’ll try it when I get home. And when the PTZ commands worked, I really didn’t think that was the issue. I figured if the PTZ commands work, then why doesn’t the video/snapshot.

I already have that set up now, but I only have HTTPS set up for port forwarding.[quote=“Belgarion, post:78, topic:45023”]
Wait… I am confused… how to you know PTZ and presets work???
[/quote]

LOL, as mentioned above, I do have a Dynamic DNS service set up, but my network configuration is only set up for HTTPS connections for security, so I can’t use it with this device type. I’m using the app TinyCam on my android, and I have it set up with my DNS name and it supports HTTPS with credential encryption.

I also have TeamViewer on my home computer and I can view the cameras that way too.

TeamViewer is a very cool app.

Okay, well I think you will be fine when you try it at home. If something comes up, send another message and I will try to help you out.