Skip to content

Commit bd95125

Browse files
committed
iProdding and poking into a releasable form
1 parent d0a9071 commit bd95125

File tree

6 files changed

+75
-24
lines changed

6 files changed

+75
-24
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mywifi.h
1+
myconfig.h

camera_index_ov2640.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ const uint8_t index_ov2640_html[] PROGMEM = R"=====(
583583
</div>
584584
</section>
585585
</body>
586-
586+
587587
<script>
588588
document.addEventListener('DOMContentLoaded', function (event) {
589589
var baseHost = document.location.origin
@@ -725,6 +725,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
725725
stopStream()
726726
view.src = `${baseHost}/capture?_cb=${Date.now()}`
727727
show(viewContainer)
728+
view.scrollIntoView();
728729
}
729730

730731
closeButton.onclick = () => {

camera_index_ov3660.h

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ const uint8_t index_ov3660_html[] PROGMEM = R"=====(
258258
background: #363636
259259
}
260260

261+
input[type=text] {
262+
border: 1px solid #363636;
263+
font-size: 14px;
264+
height: 20px;
265+
margin: 1px;
266+
outline: 0;
267+
border-radius: 5px
268+
}
269+
261270
.switch {
262271
display: block;
263272
position: relative;
@@ -337,15 +346,6 @@ const uint8_t index_ov3660_html[] PROGMEM = R"=====(
337346
display: none
338347
}
339348

340-
input[type=text] {
341-
border: 1px solid #363636;
342-
font-size: 14px;
343-
height: 20px;
344-
margin: 1px;
345-
outline: 0;
346-
border-radius: 5px
347-
}
348-
349349
.inline-button {
350350
line-height: 20px;
351351
margin: 2px;
@@ -378,9 +378,9 @@ const uint8_t index_ov3660_html[] PROGMEM = R"=====(
378378
<option value="10">UXGA(1600x1200)</option>
379379
<option value="9">SXGA(1280x1024)</option>
380380
<option value="8">XGA(1024x768)</option>
381-
<option value="7">SVGA(800x600)</option>
381+
<option value="7" selected="selected">SVGA(800x600)</option>
382382
<option value="6">VGA(640x480)</option>
383-
<option value="5" selected="selected">CIF(400x296)</option>
383+
<option value="5">CIF(400x296)</option>
384384
<option value="4">QVGA(320x240)</option>
385385
<option value="3">HQVGA(240x176)</option>
386386
<option value="0">QQVGA(160x120)</option>
@@ -576,6 +576,15 @@ const uint8_t index_ov3660_html[] PROGMEM = R"=====(
576576
<section id="buttons">
577577
<button id="face_enroll" class="disabled" disabled="disabled">Enroll Face</button>
578578
</section>
579+
<div class="input-group" id="cam_name-group">
580+
<label for="cam_name">Name:</label>
581+
<div id="cam_name" class="default-action"></div>
582+
</div>
583+
<div class="input-group" id="code_ver-group">
584+
<label for="code_ver">Firmware:</label>
585+
<div id="code_ver" class="default-action"></div>
586+
</div>
587+
579588
</nav>
580589
</div>
581590
<figure>
@@ -586,7 +595,9 @@ const uint8_t index_ov3660_html[] PROGMEM = R"=====(
586595
</figure>
587596
</div>
588597
</section>
589-
<script>
598+
</body>
599+
600+
<script>
590601
document.addEventListener('DOMContentLoaded', function (event) {
591602
var baseHost = document.location.origin
592603
var streamUrl = baseHost + ':81'
@@ -621,6 +632,8 @@ document.addEventListener('DOMContentLoaded', function (event) {
621632
}
622633

623634
const lampGroup = document.getElementById('lamp-group')
635+
const camName = document.getElementById('cam_name')
636+
const codeVer = document.getElementById('code_ver')
624637

625638
if (updateRemote && initialValue !== value) {
626639
updateConfig(el);
@@ -643,6 +656,11 @@ document.addEventListener('DOMContentLoaded', function (event) {
643656
} else {
644657
show(lampGroup)
645658
}
659+
} else if(el.id === "cam_name"){
660+
camName.innerHTML = value;
661+
window.document.title = value;
662+
} else if(el.id === "code_ver"){
663+
codeVer.innerHTML = value;
646664
}
647665
}
648666
}
@@ -709,6 +727,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
709727
const startStream = () => {
710728
view.src = `${streamUrl}/stream`
711729
show(viewContainer)
730+
view.scrollIntoView();
712731
streamButton.innerHTML = 'Stop Stream'
713732
}
714733

@@ -717,6 +736,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
717736
stopStream()
718737
view.src = `${baseHost}/capture?_cb=${Date.now()}`
719738
show(viewContainer)
739+
view.scrollIntoView();
720740
}
721741

722742
closeButton.onclick = () => {
@@ -815,8 +835,8 @@ document.addEventListener('DOMContentLoaded', function (event) {
815835
}
816836
})
817837

818-
</script>
819-
</body>
838+
</script>
839+
820840
</html>
821841
)=====";
822842

camera_pins.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Pin definitions for soem common ESP-CAM modules
2+
3+
// ESP WROVER
4+
// https://dl.espressif.com/dl/schematics/ESP-WROVER-KIT_SCH-2.pdf
15

26
#if defined(CAMERA_MODEL_WROVER_KIT)
37
#define PWDN_GPIO_NUM -1
@@ -18,6 +22,15 @@
1822
#define HREF_GPIO_NUM 23
1923
#define PCLK_GPIO_NUM 22
2024

25+
#define LED_PIN 2 // A status led on the RGB; could also use pin 0 or 4
26+
#define LED_ON HIGH //
27+
#define LED_OFF LOW //
28+
//#define LAMP_PIN x // No LED FloodLamp.
29+
30+
31+
// ESP-EYE
32+
// https://twitter.com/esp32net/status/1085488403460882437
33+
2134
#elif defined(CAMERA_MODEL_ESP_EYE)
2235
#define PWDN_GPIO_NUM -1
2336
#define RESET_GPIO_NUM -1
@@ -37,6 +50,14 @@
3750
#define HREF_GPIO_NUM 27
3851
#define PCLK_GPIO_NUM 25
3952

53+
#define LED_PIN 21 // Status led
54+
#define LED_ON HIGH //
55+
#define LED_OFF LOW //
56+
//#define LAMP_PIN v x // No LED FloodLamp.
57+
58+
59+
// ESP32 M5STACK
60+
4061
#elif defined(CAMERA_MODEL_M5STACK_PSRAM)
4162
#define PWDN_GPIO_NUM -1
4263
#define RESET_GPIO_NUM 15
@@ -75,13 +96,22 @@
7596
#define HREF_GPIO_NUM 26
7697
#define PCLK_GPIO_NUM 21
7798

99+
// M5 Stack status/illumination LED details unknown/unclear
100+
//#define LED_PIN x // Status led
101+
//#define LED_ON HIGH //
102+
//#define LED_OFF LOW //
103+
//#define LAMP_PIN x // LED FloodLamp.
104+
105+
106+
// AI Thinker
107+
// https://github.com/SeeedDocument/forum_doc/raw/master/reg/ESP32_CAM_V1.6.pdf
108+
78109
#elif defined(CAMERA_MODEL_AI_THINKER)
79110
#define PWDN_GPIO_NUM 32
80111
#define RESET_GPIO_NUM -1
81112
#define XCLK_GPIO_NUM 0
82113
#define SIOD_GPIO_NUM 26
83114
#define SIOC_GPIO_NUM 27
84-
85115
#define Y9_GPIO_NUM 35
86116
#define Y8_GPIO_NUM 34
87117
#define Y7_GPIO_NUM 39

esp32-cam-webserver.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
#define CAMERA_MODULE_OV2640
3232
//#define CAMERA_MODULE_OV3660
3333

34-
#if __has_include("mywifi.h")
34+
#if __has_include("myconfig.h")
3535
// I keep my settings in a seperate header file
36-
#include "mywifi.h"
36+
#include "myconfig.h"
3737
#else
3838
const char* ssid = "my-access-point-ssid";
3939
const char* password = "my-access-point-password";
4040
#endif
4141

42-
// A Name for the Camera. (can be set in wifi.h)
42+
// A Name for the Camera. (can be set in myconfig.h)
4343
#ifdef CAM_NAME
4444
char myName[] = CAM_NAME;
4545
#else
@@ -50,7 +50,6 @@
5050
char myVer[] PROGMEM = __DATE__ " @ " __TIME__;
5151

5252

53-
5453
#include "camera_pins.h"
5554

5655
// Status and illumination LED's
@@ -76,7 +75,7 @@ void setup() {
7675
Serial.print("Code Built: ");
7776
Serial.println(myVer);
7877

79-
#ifdef LED_PIN // If we have notification LED, set it to output
78+
#ifdef LED_PIN // If we have a notification LED set it to output
8079
pinMode(LED_PIN, OUTPUT);
8180
digitalWrite(LED_PIN, LED_OFF);
8281
#endif

mywifi.sample.h renamed to myconfig.sample.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ const char* password = "my-access-point-password";
66

77

88
// Optionally give the camera a name for the web interface
9-
// (this is not a network hostname)
10-
// #define CAM_NAME "Chocolate Store"
9+
// (nb: this is not the network hostname)
10+
11+
#define CAM_NAME "my-awesome-webcam"

0 commit comments

Comments
 (0)