Oddly enough,after making those changes, when I pointed the device config back to the LAN IP of the foscam, maintaining the (arbitrarily chosen) port I changed it to, the snapshots still worked.
Subsequently, I had it work and sometimes not work -- especially if I tried taking a few shots quickly in a row.
When it works, the Live event logs for the camera device look something like this:
**Executing hubaction on 172.16.20.2:578
Parsing 'index:01, mac:DEADBEEFAAAA, ip:1BC1AF3, port:7A69, bucket:smartthings-device-conn-temp, key:123456-7890-1d34-beef-3445dddddddab'**
When it doesn't work, you never get to the Parsing line.
In further testing it shouldn't matter whether you use an internal or external IP as the hub itself is making the http request to the camera to pull the image (I believe RBoy mentioned this at some point).
For security purposes, be aware that requesting the image from over the internet in clear http (e.g. in using an external IP for smartthings access) could easily expose your username and password for the camera. That said, so can using the foscam at all over the internet without proxying the connection. But it's fine for playing around or testing -- just make sure you use a throwaway u/p and are aware of the risk.
In any case, here are the things to try if it doesn't work.
- Try setting it up with the public IP -- note that if your firewall doesn't support loopback connections from the LAN, this probably won't work.
- Try changing to a port other than 80.
- Restart your hub via the web graph interface
- Restart the app -- Make sure it's dead -- you can do a force stop in applications if you have android.
- Restart the camera -- As mentioned above by RBoy, sometimes the camera doesn't respond correctly -- though you can rule this out by attempting to browse to the Camera picture fetch URL directly from your web browser - http://IP address here:port/snapshot.cgi?user=alias&pwd=fakepassword
OK so once the app is working, there are a few other oddities. Sometimes the pictures just disappear out of the app. If you go back to the Event logs for the device you can find some names for the pictures it has taken. I'm not sure if these are accessible from somewhere else -- maybe somewhere out on s3 storage. But once they've disappeared from the app, I haven't been able to find them.
Also, it looks like the dns lookup function may be broken, as it wasn't able to lookup a couple different dns names I pointed it to.
When it doesn't work, I'm not sure if I should be blaming the android app, or slowness on the smart things side, but something is a bit screwy with that if the same settings cause different results. I've ruled out the code itself, my network connection and camera as the culprits when it happens, so have to find something else to blame.
In any case despite all that, I think it's coming along nicely.