Skip to content

Commit

Permalink
version 5.0 beta 2
Browse files Browse the repository at this point in the history
  • Loading branch information
abratchik committed Dec 2, 2022
1 parent cbf96d1 commit 2e98e1f
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 136 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.pio
.vscode
.DS_Store
.idea
*.code-workspace
/data/conn.json
/data/cam.json
Expand Down
44 changes: 20 additions & 24 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# Basic HTTP Commands;
The WebUI and camera server communicate entirely via HTTP requests and responses; this makes controlling all functions of the camera via GET requests possible.
The WebUI and camera server communicate entirely via HTTP requests and responses;
this makes controlling all functions of the camera via GET requests possible.

## URI's
### Http Port
* `/` - Default index (portal)
### Web UI pages
* `/` or `/portal` - Default index (portal)
* `/view?mode=full|simple|stream|still` - Go direct to specific page:
* - full: taking still and video with complete set of camera controls
* - simple: taking still and video with limited set of camera controls
* - stream: starting video capture with full screen mode
* - still: taking a still image with full screen mode
* `/status` - Returns a JSON string with all camera status <key>/<value> pairs listed
* `/control?var=<key>&val=<val>` - Set `<key>` to `<val>`
* `/dump` - Status page
* `/stop` - End all active streams
* `/dump` - Status page (automatically refreshed every 5 sec)

### Special *key / val* settings and commands

## *key / val* settings and commands
* `/control?var=<key>&val=<val>` - Set a Control Variable specified by `<key>` to `<val>`
* `/status` - JSON response containing camera settings
* `/system` - JSON response containing all parameters displayed on the `/dump` page

Call the `/status` URI to recieve a JSON response containing all the available settings and current value.

Call `/control?var=<key>&val=<val>` with a settings key and value to set camera properties or trigger actions.

#### Settings
#### Supported Control Variables:
```
lamp - Lamp value in percent; integer, 0 - 100 (-1 = disabled)
framesize - See below
Expand Down Expand Up @@ -56,13 +53,7 @@ colorbar - Overlays a color test pattern on the stream; integer, 1 = enab
face_detect - Face Detection; 1 = enabled, Only settable if framesize <= 4 (CIF)
face_recognize - Face recognition; 1 = enabled, only settable if Face detection is already enabled
```
#### Read Only
These values are returned in the `/status` JSON response, but cannot be set via the `/control` URI.
```
cam_name - Camera Name; String
code_ver - Code compile date and time; String
stream_url - Raw stream URL; string
```

##### Framesize values
These may vary between different ESP framework releases
```
Expand All @@ -82,13 +73,16 @@ Only for 3Mp+ camera modules:
14 - FHD (1920x1080)
17 - QXGA (2048x1536)
```

#### Commands
These are commands; they can be sent by calling the `/control` URI with them as the `<key>` *(a `<val>` must also be supplied, but can be any value and is ignored)*.
These are commands; they can be sent by calling the `/control` URI with them as
the `<key>` *(a `<val>` must also be supplied, but can be any value and is ignored)*.
```
save_prefs - Saves preferences file
clear_prefs - Deletes the preferences file
reboot - Reboots the camera
reboot - Reboots the board
```

## Examples
* Flash light: on/mid/off
* `http://<IP-ADDRESS>/control?var=lamp&val=100`
Expand All @@ -97,11 +91,13 @@ reboot - Reboots the camera
* Set resolution to VGA
* `http://<IP-ADDRESS>/control?var=framesize&val=8`
* Show camera details and settings
* All settings are returned via single `status` call in [JSON](https://www.json.org/) format.
* All settings are returned via single `status` call in [JSON](https://www.json.org/)
format.
* `http://<IP-ADDRESS>/status`
* Returns:
``` {"lamp":0,"autolamp":0,"frame_rate":0,"framesize":9,"quality":10,"xclk":8,"brightness":0,"contrast":0,"saturation":0,"sharpness":0,"special_effect":0,"wb_mode":0,"awb":1,"awb_gain":1,"aec":1,"aec2":0,"ae_level":0,"aec_value":204,"agc":1,"agc_gain":0,"gainceiling":0,"bpc":0,"wpc":1,"raw_gma":1,"lenc":1,"vflip":1,"hmirror":1,"dcw":1,"colorbar":0,"cam_name":"ESP32 test camera","code_ver":"Mar 10 2022 @ 14:00:45","rotate":"0","stream_url":"ws://<IP-ADDRESS>/ws"}```
* Reboot the camera
* `http://<IP-ADDRESS>/control?var=reboot&val=0`

You can try these yourself in a browser address bar, from the commandline with `curl` and co. or use them programatically from your scripting language of choice.
You can try these yourself in a browser address bar, from the commandline with `curl`
and co. or use them programatically from your scripting language of choice.
31 changes: 19 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Contributing to ESP32-CAM revisited
I love your input! and want to make contributing to this project as easy and transparent as possible, whether it's:
We love your input and want to make contributing to this project as easy and transparent
as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## I Develop with Github
I use github to host code, to track issues and feature requests, as well as accept pull requests.
## We Develop with Github
We use github to host code, to track issues and feature requests, as well as accept pull
requests.

## I Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (I use [Github Flow](https://guides.github.com/introduction/flow/index.html)). I actively welcome your pull requests:
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html)
So All Code Changes Happen Through Pull Requests. Pull requests are the best way to
propose changes to the codebase (use [Github Flow](https://guides.github.com/introduction/flow/index.html)).
We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
2. Give your branch a clear descriptive name and do your changes there.
Expand All @@ -20,10 +24,12 @@ Pull requests are the best way to propose changes to the codebase (I use [Github
5. Clearly describe your changes and the reason for them in the pull request.

## Any contributions you make will be under the GNU Lesser General Public License v2.1
In short, when you submit code changes, your submissions are understood to be under the same [License](./LICENSE) that covers the project.
In short, when you submit code changes, your submissions are understood to be under
the same [License](./LICENSE) that covers the project.

## Report bugs using Github's [issues](https://github.com/abratchik/esp32-cam-webserver/issues)
We use GitHub issues to track public bugs. Report a bug by opening a new issue; it's that easy!
## Report bugs using Github's issues
We use GitHub issues to track public bugs. Report a bug by opening a new issue; it's that
easy!

## Write bug reports with detail, background, and sample code

Expand All @@ -34,15 +40,16 @@ We use GitHub issues to track public bugs. Report a bug by opening a new issue;
- Be specific!
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People *love* thorough bug reports. I'm not even kidding.
- Notes (possibly including why you think this might be happening, or stuff you
tried that didn't work)

## Use a Consistent Coding Style
* 4 spaces for indentation rather than tabs in the main code

## License
By contributing, you agree that your contributions will be licensed under its GNU Lesser General Public License v2.1
By contributing, you agree that your contributions will be licensed under its GNU
Lesser General Public License v2.1



Loading

0 comments on commit 2e98e1f

Please sign in to comment.