I have a Foscam C2M Wifi camera and I’m trying to do something that I imagined would be simple: issue an HTML request to have the camera take a picture and record it on the SD card. That’s it. But all the camera seems to want to do is return the image to me in the response to the request.
Ok. From your description I had the impression that you would like to do it in different way - reading it again I see that I have slightly misinterpreted it.
This should be one option:
var String Status = executeCommandLine( Duration.ofSeconds(5), "/usr/bin/curl","http://xxx.xxx.xxx.xxx:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture", "-o", "/path/to/store/your.jpg" )
Sorry then I completely misunderstood your question.
I had a look into the Foscam users manual.
It offers two snapshot functions ( snapPicture, snapPicture2 ).
The first one should return a path to a picture.
The second one the image data itself.
which doesn’t correspond to an image on the SD card. It seems that you’re supposed to read this image and store it locally. It’s all oriented towards accessing the camera remotely. All I want is for it to store images on its SD card when I tell it to.
Quoting the main interesting part of content Ap15e’s link points to :
To answer your question, it appears that Foscam saves the image in /snapPic/ path just for the time required to serve your request, and then deletes it. This is why it returns a 404 when you try to use the link in HTML page.
I’m not familiar with Foscam cameras, but if it’s true that the snapshots aren’t saved, you’d have to use an FTP server (hoping that the camera actually uploads the snapshots …).
I’ve seen that, but that’s just one use case. What I find staggering is that they haven’t considered the other use case. If nobody has a better idea, I think the only way to hack this is to use setScheduleSnapConfig to take snapshots at the times you want. Those, apparently, do get saved on the SD card, providing that setSnapConfig is used to set that as the location.