Skip to content

Commit e1a876e

Browse files
committed
Bug fixes
1 parent 8f39567 commit e1a876e

17 files changed

+72
-65
lines changed

API.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ the `<key>` parameter.
115115
* Reboot the camera
116116
* `http://<IP-ADDRESS>/control?var=reboot&val=0`
117117

118-
You can try these yourself in a browser address bar, from the commandline with `curl`
119-
and co. or use them programatically from your scripting language of choice.
118+
You can try these yourself in a browser address bar, from the command line with `curl`
119+
and co. or use them programmatically from your scripting language of choice.
120120

121121
## ESP32CAM WebSocket API
122-
This API is inteded for fast statefull communication between the server and the browser. You can think of a websocket as a state machine, which can be accessed and programmed from the client side, using JavaScript or any other language, which supports Webocket API.
122+
This API is intended for fast stateful communication between the server and the browser. You can think of a websocket as a state machine, which can be accessed and programmed from the client side, using JavaScript or any other language, which supports Websocket API.
123123

124124
In order to use the WebSocket API, you need to open the Websocket first. The url of the websocket is always
125-
`ws://<your-ip:your-port>/ws`. In Java Script, you simply need to add the followig lines to your page:
125+
`ws://<your-ip:your-port>/ws`. In Java Script, you simply need to add the following lines to your page:
126126

127127
```
128128
ws = new WebSocket(websocketURL);
@@ -156,26 +156,26 @@ Once the `ws` object is created successfully, you can handle its events on the p
156156
```
157157

158158
Once the websocket is open, you may also send commands and data to the server. Commands are sent with help of the `ws.send(command)` function where the `command` is to be a binary Uint8Array. The first byte of this
159-
array reflects the command code while the rest of bytes can host addtional parameters of the command.
159+
array reflects the command code while the rest of bytes can host additional parameters of the command.
160160

161161
The following commands are supported:
162162

163-
's' - starts the stream. Once the comamand is issued, the server will start pushing the frames to the client
164-
according to the camera settings. The server will switch to the video mode.
165-
'p' - similar to the previous command but there will be only one frame taken and pushed to the client. The
166-
server will swicth to the photo mode.
167-
'u' - similar to the previous two commands. The server will either start stream or take a still photo,
168-
depending on the current mode of the server.
169-
't' - terminates the stream. Only makes sense after 's' or 'u' commands.
170-
'c' - tells the server that this websocket will be used for PWM control commands.
171-
'w' - writes the PWM duty value to the pin. This command has additional parameters passed in the bytes of the
172-
`command` array, as follows:
163+
- 's' - starts the stream. Once the command is issued, the server will start pushing the frames to the client
164+
according to the camera settings. The server will switch to the video mode.
165+
- 'p' - similar to the previous command but there will be only one frame taken and pushed to the client. The
166+
server will switch to the photo mode.
167+
- 'u' - similar to the previous two commands. The server will either start stream or take a still photo,
168+
depending on the current mode of the server.
169+
- 't' - terminates the stream. Only makes sense after 's' or 'u' commands.
170+
- 'c' - tells the server that this websocket will be used for PWM control commands.
171+
- 'w' - writes the PWM duty value to the pin. This command has additional parameters passed in the bytes of the
172+
`command` array, as follows:
173173

174174
byte0 - 'w' - code of the command
175175
byte1 - pin number. If you use the ESP32CAM-DEV board, the available pins are usually limited to 4,
176176
12, 13 and 33. The 4th pin is connected to the flash lamp so you can control the lamp brightness
177177
by sending value to this pin via the websocket. Pin 33 is connected to the onboard LED. So, only
178-
12 and 13 are the ones you can use, provided taht you also use the SD card for storage.
178+
12 and 13 are the ones you can use, provided that you also use the SD card for storage.
179179
if you use the internal LittleFS for storage, you may be able to use other pins otherwise
180180
utilized by the SD card interface.
181181
byte2 - send 1 for servo mode and 2 for any other PWM.
@@ -205,10 +205,10 @@ GPIO pins used for PWM can be defined in the `/httpd.json`, in the `pwm` paramet
205205
The `pwm` parameter is defined as a JSON array where each object of the array is a definition of one PWM.
206206
Attributes of a pwm object are explained below:
207207

208-
`pin` - GPIO pin number
209-
`frequency` - PWM frequency in Herz.
210-
`resolution` - precision of the PWM (number of bits).
211-
`default` - initial value of the PWM. if this attribute is not defined, 0 will be used for default.
208+
- `pin` - GPIO pin number
209+
- `frequency` - PWM frequency in Herz.
210+
- `resolution` - precision of the PWM (number of bits).
211+
- `default` - initial value of the PWM. if this attribute is not defined, 0 will be used for default.
212212

213213
if the `lamp` parameter in the httpd config is greater or equal to 0, the 1st element of the pwm array
214214
will be used for definition of flash lamp PWM. In the example above, the lamp PWM is configured for pin 4

Docs/html/app__cam_8h_source.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="class_c_l_app_cam.html#a27d4c05b87660b0e04b6a8902f0f173e"> 36</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_c_l_app_cam.html#a27d4c05b87660b0e04b6a8902f0f173e">setRotation</a>(<span class="keywordtype">int</span> val) {myRotation = val;};</div>
106106
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="class_c_l_app_cam.html#a65918dca872c1d5bdcb0bb556451127f"> 37</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="class_c_l_app_cam.html#a65918dca872c1d5bdcb0bb556451127f">getRotation</a>() {<span class="keywordflow">return</span> myRotation;};</div>
107107
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
108-
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">int</span> <a class="code hl_function" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">snapToBufer</a>();</div>
108+
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">int</span> <a class="code hl_function" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">snapToBuffer</a>();</div>
109109
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="class_c_l_app_cam.html#aac54409dcd9344abbbe434b237dc505f"> 40</a></span> uint8_t * <a class="code hl_function" href="class_c_l_app_cam.html#aac54409dcd9344abbbe434b237dc505f">getBuffer</a>() {<span class="keywordflow">return</span> fb-&gt;buf;};</div>
110110
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="class_c_l_app_cam.html#aa0f1c434be24055bab3abb459a071abd"> 41</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="class_c_l_app_cam.html#aa0f1c434be24055bab3abb459a071abd">getBufferSize</a>() {<span class="keywordflow">return</span> fb-&gt;len;};</div>
111111
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="class_c_l_app_cam.html#a1f01a309f73eb36142ab8b449c81a381"> 42</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_c_l_app_cam.html#a1f01a309f73eb36142ab8b449c81a381">isJPEGinBuffer</a>() {<span class="keywordflow">return</span> fb-&gt;format == PIXFORMAT_JPEG;};</div>
@@ -163,7 +163,7 @@
163163
<div class="ttc" id="aclass_c_l_app_cam_html_a6581e369883546817a1edaedf4af1734"><div class="ttname"><a href="class_c_l_app_cam.html#a6581e369883546817a1edaedf4af1734">CLAppCam::setFrameRate</a></div><div class="ttdeci">void setFrameRate(int newFrameRate)</div><div class="ttdef"><b>Definition:</b> app_cam.h:31</div></div>
164164
<div class="ttc" id="aclass_c_l_app_cam_html_a65918dca872c1d5bdcb0bb556451127f"><div class="ttname"><a href="class_c_l_app_cam.html#a65918dca872c1d5bdcb0bb556451127f">CLAppCam::getRotation</a></div><div class="ttdeci">int getRotation()</div><div class="ttdef"><b>Definition:</b> app_cam.h:37</div></div>
165165
<div class="ttc" id="aclass_c_l_app_cam_html_a790db89fdbe6524175ad6f447b863c26"><div class="ttname"><a href="class_c_l_app_cam.html#a790db89fdbe6524175ad6f447b863c26">CLAppCam::getFrameRate</a></div><div class="ttdeci">int getFrameRate()</div><div class="ttdef"><b>Definition:</b> app_cam.h:30</div></div>
166-
<div class="ttc" id="aclass_c_l_app_cam_html_a89a7a39bd89130cab06fd7139fc9b6d9"><div class="ttname"><a href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam::snapToBufer</a></div><div class="ttdeci">int snapToBufer()</div><div class="ttdef"><b>Definition:</b> app_cam.cpp:202</div></div>
166+
<div class="ttc" id="aclass_c_l_app_cam_html_a89a7a39bd89130cab06fd7139fc9b6d9"><div class="ttname"><a href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam::snapToBuffer</a></div><div class="ttdeci">int snapToBuffer()</div><div class="ttdef"><b>Definition:</b> app_cam.cpp:202</div></div>
167167
<div class="ttc" id="aclass_c_l_app_cam_html_a8e19e1d337c7d7406d713a42615005aa"><div class="ttname"><a href="class_c_l_app_cam.html#a8e19e1d337c7d7406d713a42615005aa">CLAppCam::getXclk</a></div><div class="ttdeci">int getXclk()</div><div class="ttdef"><b>Definition:</b> app_cam.h:34</div></div>
168168
<div class="ttc" id="aclass_c_l_app_cam_html_a8f1da94b3efb536a15419e5983fcac81"><div class="ttname"><a href="class_c_l_app_cam.html#a8f1da94b3efb536a15419e5983fcac81">CLAppCam::stop</a></div><div class="ttdeci">int stop()</div><div class="ttdef"><b>Definition:</b> app_cam.cpp:78</div></div>
169169
<div class="ttc" id="aclass_c_l_app_cam_html_a97ffe4ceb1fc0ae537d4e5f96cb7691e"><div class="ttname"><a href="class_c_l_app_cam.html#a97ffe4ceb1fc0ae537d4e5f96cb7691e">CLAppCam::getErr</a></div><div class="ttdeci">String getErr()</div><div class="ttdef"><b>Definition:</b> app_cam.h:28</div></div>

Docs/html/class_c_l_app_cam.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<tr class="separator:a27d4c05b87660b0e04b6a8902f0f173e"><td class="memSeparator" colspan="2">&#160;</td></tr>
115115
<tr class="memitem:a65918dca872c1d5bdcb0bb556451127f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_l_app_cam.html#a65918dca872c1d5bdcb0bb556451127f">getRotation</a> ()</td></tr>
116116
<tr class="separator:a65918dca872c1d5bdcb0bb556451127f"><td class="memSeparator" colspan="2">&#160;</td></tr>
117-
<tr class="memitem:a89a7a39bd89130cab06fd7139fc9b6d9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">snapToBufer</a> ()</td></tr>
117+
<tr class="memitem:a89a7a39bd89130cab06fd7139fc9b6d9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">snapToBuffer</a> ()</td></tr>
118118
<tr class="separator:a89a7a39bd89130cab06fd7139fc9b6d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
119119
<tr class="memitem:aac54409dcd9344abbbe434b237dc505f"><td class="memItemLeft" align="right" valign="top">uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_l_app_cam.html#aac54409dcd9344abbbe434b237dc505f">getBuffer</a> ()</td></tr>
120120
<tr class="separator:aac54409dcd9344abbbe434b237dc505f"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -535,13 +535,13 @@ <h2 class="memtitle"><span class="permalink"><a href="#a9ccd0763eb8eeb559b46e747
535535
</div>
536536
</div>
537537
<a id="a89a7a39bd89130cab06fd7139fc9b6d9" name="a89a7a39bd89130cab06fd7139fc9b6d9"></a>
538-
<h2 class="memtitle"><span class="permalink"><a href="#a89a7a39bd89130cab06fd7139fc9b6d9">&#9670;&nbsp;</a></span>snapToBufer()</h2>
538+
<h2 class="memtitle"><span class="permalink"><a href="#a89a7a39bd89130cab06fd7139fc9b6d9">&#9670;&nbsp;</a></span>snapToBuffer()</h2>
539539

540540
<div class="memitem">
541541
<div class="memproto">
542542
<table class="memname">
543543
<tr>
544-
<td class="memname">int CLAppCam::snapToBufer </td>
544+
<td class="memname">int CLAppCam::snapToBuffer </td>
545545
<td>(</td>
546546
<td class="paramname"></td><td>)</td>
547547
<td></td>

Docs/html/functions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ <h3><a id="index_s" name="index_s"></a>- s -</h3><ul>
259259
<li>setTag()&#160;:&#160;<a class="el" href="class_c_l_app_component.html#a75a706c37e31c3083c845d304e3a519b">CLAppComponent</a></li>
260260
<li>setup()&#160;:&#160;<a class="el" href="class_e_s_p32_p_w_m.html#a2be6068904d3bec84211221148b21310">ESP32PWM</a></li>
261261
<li>setXclk()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a9ccd0763eb8eeb559b46e747df25d268">CLAppCam</a></li>
262-
<li>snapToBufer()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam</a></li>
262+
<li>snapToBuffer()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam</a></li>
263263
<li>snapToStream()&#160;:&#160;<a class="el" href="class_c_l_app_httpd.html#a4e52f72c1d20cf6420e2f17b0b521da4">CLAppHttpd</a></li>
264264
<li>ssid&#160;:&#160;<a class="el" href="struct_station.html#ad635bfe5333139b2596ace399fe5054e">Station</a></li>
265265
<li>start()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#af277f42041c7c0a561bd8c8b087f4b3a">CLAppCam</a>, <a class="el" href="class_c_l_app_component.html#a7e64a4c55bd1f3216c507101835392b5">CLAppComponent</a>, <a class="el" href="class_c_l_app_conn.html#a75a0c8c0ab160691ecf58e3c4ad58951">CLAppConn</a>, <a class="el" href="class_c_l_app_httpd.html#aaf8a95884768b7ac3e1c04ea041ee514">CLAppHttpd</a></li>

Docs/html/functions_func.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ <h3><a id="index_s" name="index_s"></a>- s -</h3><ul>
248248
<li>setTag()&#160;:&#160;<a class="el" href="class_c_l_app_component.html#a75a706c37e31c3083c845d304e3a519b">CLAppComponent</a></li>
249249
<li>setup()&#160;:&#160;<a class="el" href="class_e_s_p32_p_w_m.html#a2be6068904d3bec84211221148b21310">ESP32PWM</a></li>
250250
<li>setXclk()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a9ccd0763eb8eeb559b46e747df25d268">CLAppCam</a></li>
251-
<li>snapToBufer()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam</a></li>
251+
<li>snapToBuffer()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#a89a7a39bd89130cab06fd7139fc9b6d9">CLAppCam</a></li>
252252
<li>snapToStream()&#160;:&#160;<a class="el" href="class_c_l_app_httpd.html#a4e52f72c1d20cf6420e2f17b0b521da4">CLAppHttpd</a></li>
253253
<li>start()&#160;:&#160;<a class="el" href="class_c_l_app_cam.html#af277f42041c7c0a561bd8c8b087f4b3a">CLAppCam</a>, <a class="el" href="class_c_l_app_component.html#a7e64a4c55bd1f3216c507101835392b5">CLAppComponent</a>, <a class="el" href="class_c_l_app_conn.html#a75a0c8c0ab160691ecf58e3c4ad58951">CLAppConn</a>, <a class="el" href="class_c_l_app_httpd.html#aaf8a95884768b7ac3e1c04ea041ee514">CLAppHttpd</a></li>
254254
<li>startOTA()&#160;:&#160;<a class="el" href="class_c_l_app_conn.html#a8d0720ee6abfd427ed8a0d109490a286">CLAppConn</a></li>

Docs/html/search/all_f.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Docs/html/search/functions_d.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)