Android IP Camera Device

I wrote an app to work with this device. Check it out.

1 Like

Hey @rob_a_landry, thanks for putting something like this together! I’m trying to get it it work but it’s just not working correctly for me yet. I am using an old Samsung GS3 for the camera/device. I created the device type in IDE, then created the device, downloaded the free version of the IP Webcam onto the SG3, found the internal IP address, forwarded a HTTP port on my router from that IP address (made it 8081), checked the external IP of the SG3 and put that into the ST preferences for the ST app, and I still cannot get it to work. I started a stream from the SG3 IP camera app, and used the phone’s internal IP address and port to open up a browser window. I can get to the settings on that window, but nothing else seems to work. In the ST settings, I tried both the internal and external IP address, the port number I forwarded and the remote port that showed up on IPChicken, and still nothing. When testing, I would try to take a photo from ST app, and sometimes it would freeze up, but no photo ever showed up on ST.

Is it required that we use something like Dropsync? Is that my issue? From the OP, I thought it may be optional. I was hoping to just see a stream on my ST app dashboard and then, hopefully, set it up on SmartTiles. Am I doing something else wrong setting up the IP’s or with port forwarding? Any help would be much appreciated!

My goal is to have a tablet and a phone mounted in the house running SmartTiles/ActiON, and also have both of those run this IP Camera, as they will be mounted where I need cameras. Thanks!

I’ve got it working with an old Droid Razr. Did you verify that you can get to the browser interface through the external IP (not using SmartThings)?

Thanks to @rob_a_landry for sharing.

I am totally guessing here that httpGet in the code below will run in the cloud and not on the hub. Thus the need for the external IP address.

httpGet("http://${username}:${password}@${url}:${port}/photo_save_only.jpg"){
	httpGet("http://${username}:${password}@${url}:${port}/photo.jpg"){
		response -> log.info("${device.label} image captured")
		parseCameraResponse(response)
	}
}

I tried to rewrite the code using hubActions, but I could not get the two requests to ever produce a picture. I tried doing a GET followed by a delayed hub action followed by the final GET.

The reason I would like this to use hubAction / parse() is that the code will then run on the local network and I can close the hole on the firewall. I don’t need live streaming for this application, and I don’t like to open up unnecessary holes in the firewall.

nevermind :slight_smile:


This is great thanks for taking the time and effort to do this.

I do have a question - when creating the device what do I out under “device network id”? I had the full address, what I can type into my browser to see the camera. Then in all I put the ip and the port separately. I’m not getting an image though, no connection it seems. I have it forwarded and working in a few different apps and devices so I know the forwarding is functining the way it should be.

Also, does it matter if my port forward is set to https rather than http?

If I understand this other post correctly, the network device id can be anything as long as its unique. The author says keep it short, sweet, and descriptive:

I’ve managed to get through step 3 successfully. I’ve never played with port forwarding, though, so I’m still muddling through this.

@Dan999 - I would love to see this option. Did you make any additional progress?

I gave up on using a phone. I needed a camera in the garage, which is not air-conditioned, and I think the phone kept rebooting when it got too hot. I replaced the phone with a “real” IP camera that I got at Costco, using another IP camera device available from the community.

hi
I was triying to install this app but I am getting erros
× Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script1442926809777964417830.groovy: 114: expecting ‘)’, found ‘backgroundColors’ @ line 114, column 8. 98 backgroundColors:[ ^ 1 error

please help me I am new to smartthings

Try installing it as a device not a smartapp.

success…thanks for the replay

How much of a problem is it to have the password exposed in the URL like that?
I mean…it’s a problem.

I know this is just experimental and all, and I really like the concept, but do you have a plan for making it more secure (or is there anything we can do on our end that I’m not thinking of) in the future?

Due to the way httpget works i think this is the only way. Honestly i havent used this setup in months, but i could try setting the username and pwd in a header and see the results. Hang tight and ill tinker.

Cool. Thanks, Rob.


Created a new device type with this code, and the ST device won’t open, get an error that says 'Sorry, but there was an unexpected error."

Like Toasty, I too am getting “Sorry, but there was an unexpected error” when I click on the device in my android app. I have the paid version and have ports properly forwarded. I can view the camera remotely using the ip address and forwarded port in a web browser. I have double checked that all info is correct in ST device settings and have already deleted and reinstalled the device type and the device.

UPDATE: I installed the record app and set up a rule to snap photos when my door opened…and it worked. I supposed this means that the device is properly configured. I still get an error and no control panel when I click on the device in the android app.

Any ideas would be greatly appreciated.

Exactly same problem here. I can access the camera though its ip address, so it’s properly configured ports and all. However I get the unexpected error message when I click on the device in the ST app. I am using ST v2 if that makes any difference.

Has anyone gotten this to work with the V2 hub? I get the same “Sorry, but there was an unexpected error” message.

I get the error too on Hub v2. If you click on the “Recently” tab under “Things” for your Camera you should see pictures it has taken. You can set it to take video, but you don’t see that under “Recently”. Videos and pictures are stored on the phones internal memory.

I tried this and get the error “Error loading tiles for %s”. Did I copy the code incorrectly?