I use home-assistant which uses this project for supporting Foscam cameras. I have two cameras, a FI9816P and FI9821P+V3. On the FI9821P+V3 everything works properly, but on the FI9816P I have a broken image in home-assistant.
I directly tried to interact with the python library to figure out what is wrong.
I find on the FI9816P that the snap_picture_2() function is return an HTML page with the snapshot rather than the snapshot itself.
My test run:
from libpyfoscam import FoscamCamera
cam = FoscamCamera("192.168.2.33", 88, REDACTED, REDACTED)
>>> cam.snap_picture_2()
Send Foscam command: http://192.168.2.33:88/cgi-bin/CGIProxy.fcgi?usr=REDACTED&pwd=REDACTED&cmd=snapPicture2
Returning raw Foscam response: len=74
(0, b'<html><body><img src="../snapPic/Snap_20180715-194322.jpg"/></body></html>')
However trying this on a FI9821P+V3 I get actual image data in the response.
I also notice that the JPG URL referred by the FI9816P is not ephemeral however and expires very quickly. If I try to do this from my browser I can see the same thing happens and trying to open the image directly fails after it loaded the webpage and image together results in an HTTP 404.
I use home-assistant which uses this project for supporting Foscam cameras. I have two cameras, a
FI9816PandFI9821P+V3. On the FI9821P+V3 everything works properly, but on the FI9816P I have a broken image in home-assistant.I directly tried to interact with the python library to figure out what is wrong.
I find on the
FI9816Pthat thesnap_picture_2()function is return an HTML page with the snapshot rather than the snapshot itself.My test run:
However trying this on a
FI9821P+V3I get actual image data in the response.I also notice that the JPG URL referred by the
FI9816Pis not ephemeral however and expires very quickly. If I try to do this from my browser I can see the same thing happens and trying to open the image directly fails after it loaded the webpage and image together results in an HTTP 404.