hyttysmyrkky / foscam_cgi_api_html

Simple browser-based way to communicate with Foscam CGI API compatible IP cameras.
Apache License 2.0
3 stars 0 forks source link
foscam foscam-camera foscam-hd-cameras foscam-ip-camera foscamapi opticam

foscam_cgi_api_html

A simple browser-based way to communicate with Foscam CGI API compatible HD IP cameras (incl. for example the Opticam brand).

Features:

This tool does not

How to use

Download the index.html and open it (with a browser). In practice that can be done at least by 'saving as' the raw view of the index.html. Please read the "Security notes" below. Further instructions are in the tool itself.

Alternatively, you can preview the page by using htmlpreview.github.io, but saving the camera address etc. may not work, or if it does, note that any other *.github.io page can probably read all saved data, including camera credentials as clear-text.

NOTE 2024-10

If you are loading the index.html from a local hard drive, or from the Github preview or some other HTTPS source, you may have to manually allow mixed content (e.g. images over HTTP on an HTML page loaded from a local hard drive or HTTPS) in your browser settings. For example by default Firefox no longer supports mixed content since June 2024.

Especially the Operate and Viewer views require images usually over HTTP.

To allow mixed content images in Firefox, open about:config and search and set security.mixed_content.upgrade_display_content.image to false. This way Firefox no longer forces images to be fetched via HTTPS which the IP cameras don't support.

Other ways to make this tool work properly are:

Security notes

How this was developed

  1. The contents (chapters 2 and 3) of the Foscam PDF were copy pasted into a text file.
  2. A Python script was created to parse the API into a JSON.
  3. Everything else was written into the HTML template file. The Python script reads the template file, inserts the parsed JSON into it, and writes the result as the index.html.

Design choices & goals

How to contribute (and areas for improvement)

License

Apache-2.0 (c) hyttysmyrkky

Disclaimer

This project is not related to Foscam or any other manufacturer, but is fully 3rd-party-contributed. If this repository contains the original API PDF documentation, it shouldn't be considered as a part of this repository in terms of license etc. You should get the latest version of the PDF from the Foscam website. Use at your own risk. I take no responsibility if your IP camera explodes.

Acknowledgements & related