From 458ffc83c553470dd99354970da13ec71ccda072 Mon Sep 17 00:00:00 2001 From: jameszah <36938190+jameszah@users.noreply.github.com> Date: Sat, 22 Jan 2022 19:21:07 -0700 Subject: [PATCH] Jan 12, 2022 - ver 58.8 --- v58/ESP32-CAM-Video-Recorder-junior-58x.ino | 367 +- ...> ESP32-CAM-Video-Recorder-junior-58x.xxx} | 4555 ++++++++--------- 2 files changed, 2461 insertions(+), 2461 deletions(-) rename v58/{ESP32-CAM-Video-Recorder-junior-58x.8.ino => ESP32-CAM-Video-Recorder-junior-58x.xxx} (76%) diff --git a/v58/ESP32-CAM-Video-Recorder-junior-58x.ino b/v58/ESP32-CAM-Video-Recorder-junior-58x.ino index a54ba54..4171239 100644 --- a/v58/ESP32-CAM-Video-Recorder-junior-58x.ino +++ b/v58/ESP32-CAM-Video-Recorder-junior-58x.ino @@ -33,7 +33,9 @@ - add esp32 sd filemanager to download files - v57 dec 28, 2021 - final changes to https://github.com/jameszah/ESPxWebFlMgr/tree/master/esp32_sd_file_manager - v58 dec 30, 2021 - changes for Arduino 1.8.19 and esp32 Board Library 2.0.2 - + jan 12, 2022 - add dates to file manager + - add simple version of config.txt configuration + https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior jameszah/ESP32-CAM-Video-Recorder-junior is licensed under the @@ -45,14 +47,14 @@ - or with AI Thinker ESP32-CAM Needs these libraries or better: - + ArduinoJson 6.18.5 by Benoit Blanchon WiFiManager 2.05-beat by tablatronix - - Compiled with Arduino 1.8.19, and esp32-arduino core version 2.0.2, on Dec 30, 2021. + + Compiled with Arduino 1.8.19, and esp32-arduino core version 2.0.2, on Jan 12, 2022 -Using library FS at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\FS + Using library FS at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\FS Using library SD_MMC at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\SD_MMC Using library EEPROM at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\EEPROM Using library WiFi at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\WiFi @@ -63,10 +65,10 @@ Using library DNSServer at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1 Using library ESPmDNS at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\ESPmDNS Using library HTTPClient at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\HTTPClient Using library WiFiClientSecure at version 2.0.0 in folder: C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2\libraries\WiFiClientSecure -"C:\\ArduinoPortable\\arduino-1.8.19\\portable\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\gcc8_4_0-esp-2021r2/bin/xtensa-esp32-elf-size" -A "C:\\Users\\James\\AppData\\Local\\Temp\\arduino_build_895714/ESP32-CAM-Video-Recorder-junior-58x.ino.elf" -Sketch uses 1056201 bytes (33%) of program storage space. Maximum is 3145728 bytes. +"C:\\ArduinoPortable\\arduino-1.8.19\\portable\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\gcc8_4_0-esp-2021r2/bin/xtensa-esp32-elf-size" -A "C:\\Users\\James\\AppData\\Local\\Temp\\arduino_build_568185/ESP32-CAM-Video-Recorder-junior-58x.8.ino.elf" +Sketch uses 1060501 bytes (33%) of program storage space. Maximum is 3145728 bytes. Global variables use 59268 bytes (18%) of dynamic memory, leaving 268412 bytes for local variables. Maximum is 327680 bytes. -C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\tools\esptool_py\3.1.0/esptool.exe --chip esp32 --port COM7 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0xe000 C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2/tools/partitions/boot_app0.bin 0x1000 C:\Users\James\AppData\Local\Temp\arduino_build_895714/ESP32-CAM-Video-Recorder-junior-58x.ino.bootloader.bin 0x10000 C:\Users\James\AppData\Local\Temp\arduino_build_895714/ESP32-CAM-Video-Recorder-junior-58x.ino.bin 0x8000 C:\Users\James\AppData\Local\Temp\arduino_build_895714/ESP32-CAM-Video-Recorder-junior-58x.ino.partitions.bin +C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\tools\esptool_py\3.1.0/esptool.exe --chip esp32 --port COM7 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0xe000 C:\ArduinoPortable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.2/tools/partitions/boot_app0.bin 0x1000 C:\Users\James\AppData\Local\Temp\arduino_build_568185/ESP32-CAM-Video-Recorder-junior-58x.8.ino.bootloader.bin 0x10000 C:\Users\James\AppData\Local\Temp\arduino_build_568185/ESP32-CAM-Video-Recorder-junior-58x.8.ino.bin 0x8000 C:\Users\James\AppData\Local\Temp\arduino_build_568185/ESP32-CAM-Video-Recorder-junior-58x.8.ino.partitions.bin */ @@ -509,11 +511,167 @@ static esp_err_t init_sdcard() return ESP_OK; } +//File: simple.txt, Size: 2330 +#define simple_txt_len 2330 +//const uint8_t simple_txt[] PROGMEM = { +const char simple_txt[] PROGMEM = { + 0x64, 0x65, 0x73, 0x6B, 0x6C, 0x65, 0x6E, 0x73, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x63, 0x61, 0x6D, + 0x65, 0x72, 0x61, 0x20, 0x6E, 0x61, 0x6D, 0x65, 0x0D, 0x0A, 0x31, 0x31, 0x20, 0x20, 0x2F, 0x2F, + 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x73, 0x69, 0x7A, 0x65, 0x20, 0x20, 0x31, 0x31, 0x3D, 0x68, + 0x64, 0x0D, 0x0A, 0x31, 0x38, 0x30, 0x30, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x6C, 0x65, 0x6E, 0x67, + 0x74, 0x68, 0x20, 0x6F, 0x66, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x20, 0x69, 0x6E, 0x20, 0x73, + 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x73, 0x0D, 0x0A, 0x30, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x69, 0x6E, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6C, 0x20, 0x2D, 0x20, 0x6D, 0x73, 0x20, 0x62, 0x65, 0x74, 0x77, + 0x65, 0x65, 0x6E, 0x20, 0x72, 0x65, 0x63, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x67, 0x20, 0x66, 0x72, + 0x61, 0x6D, 0x65, 0x73, 0x20, 0x0D, 0x0A, 0x31, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x73, 0x70, 0x65, + 0x65, 0x64, 0x75, 0x70, 0x20, 0x2D, 0x20, 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x70, 0x6C, 0x79, 0x20, + 0x66, 0x72, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x0D, 0x0A, 0x30, 0x20, 0x20, 0x2F, + 0x2F, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x64, 0x65, 0x6C, 0x61, 0x79, 0x20, 0x2D, 0x20, + 0x6D, 0x73, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6E, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6D, 0x69, 0x6E, 0x67, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x73, 0x0D, 0x0A, 0x47, 0x4D, 0x54, + 0x20, 0x2F, 0x2F, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x7A, 0x6F, 0x6E, 0x65, 0x0D, 0x0A, 0x73, 0x73, + 0x69, 0x64, 0x31, 0x32, 0x33, 0x34, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x73, 0x73, 0x69, 0x64, 0x20, + 0x77, 0x69, 0x66, 0x69, 0x20, 0x6E, 0x61, 0x6D, 0x65, 0x0D, 0x0A, 0x6D, 0x72, 0x70, 0x65, 0x61, + 0x6E, 0x75, 0x74, 0x20, 0x20, 0x2F, 0x2F, 0x20, 0x73, 0x73, 0x69, 0x64, 0x20, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6F, 0x72, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, + 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, + 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, + 0x7E, 0x7E, 0x7E, 0x0D, 0x0A, 0x41, 0x62, 0x6F, 0x76, 0x65, 0x20, 0x6C, 0x69, 0x6E, 0x65, 0x73, + 0x20, 0x2D, 0x20, 0x31, 0x20, 0x69, 0x74, 0x65, 0x6D, 0x20, 0x70, 0x65, 0x72, 0x20, 0x6C, 0x69, + 0x6E, 0x65, 0x20, 0x66, 0x6F, 0x6C, 0x6C, 0x6F, 0x77, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x32, + 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x0D, 0x0A, 0x0D, 0x0A, 0x64, 0x65, 0x73, 0x6B, 0x6C, + 0x65, 0x6E, 0x73, 0x20, 0x2D, 0x20, 0x63, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x20, 0x6E, 0x61, 0x6D, + 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x2C, 0x20, 0x6D, 0x64, 0x6E, + 0x73, 0x2C, 0x20, 0x65, 0x74, 0x63, 0x0D, 0x0A, 0x31, 0x31, 0x20, 0x2D, 0x20, 0x66, 0x72, 0x61, + 0x6D, 0x65, 0x73, 0x69, 0x7A, 0x65, 0x20, 0x31, 0x31, 0x20, 0x69, 0x73, 0x20, 0x68, 0x64, 0x20, + 0x37, 0x32, 0x30, 0x70, 0x20, 0x31, 0x32, 0x38, 0x30, 0x78, 0x37, 0x32, 0x30, 0x0D, 0x0A, 0x20, + 0x2D, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x6F, 0x76, 0x32, 0x36, 0x34, 0x30, 0x20, 0x63, 0x61, 0x6D, + 0x65, 0x72, 0x61, 0x20, 0x38, 0x3D, 0x76, 0x67, 0x61, 0x2C, 0x20, 0x39, 0x3D, 0x73, 0x76, 0x67, + 0x61, 0x2C, 0x20, 0x31, 0x30, 0x3D, 0x78, 0x67, 0x61, 0x2C, 0x20, 0x31, 0x31, 0x3D, 0x68, 0x64, + 0x2C, 0x20, 0x31, 0x32, 0x3D, 0x73, 0x78, 0x67, 0x61, 0x2C, 0x20, 0x31, 0x33, 0x3D, 0x75, 0x78, + 0x67, 0x61, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x6F, 0x76, 0x35, 0x36, 0x34, + 0x30, 0x20, 0x63, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x20, 0x61, 0x64, 0x64, 0x20, 0x31, 0x34, 0x3D, + 0x66, 0x68, 0x64, 0x2C, 0x20, 0x31, 0x37, 0x3D, 0x71, 0x78, 0x67, 0x61, 0x2C, 0x20, 0x31, 0x38, + 0x3D, 0x71, 0x68, 0x64, 0x2C, 0x20, 0x32, 0x31, 0x3D, 0x71, 0x73, 0x78, 0x67, 0x61, 0x0D, 0x0A, + 0x31, 0x38, 0x30, 0x30, 0x20, 0x2D, 0x20, 0x6C, 0x65, 0x6E, 0x67, 0x74, 0x68, 0x20, 0x6F, 0x66, + 0x20, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x20, 0x69, 0x6E, 0x20, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, + 0x73, 0x0D, 0x0A, 0x30, 0x20, 0x2D, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6C, 0x20, + 0x2D, 0x20, 0x6D, 0x69, 0x6C, 0x6C, 0x69, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x20, 0x62, 0x65, + 0x74, 0x77, 0x65, 0x65, 0x6E, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x73, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x67, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x30, + 0x20, 0x69, 0x73, 0x20, 0x61, 0x73, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x61, 0x73, 0x20, 0x70, + 0x6F, 0x73, 0x73, 0x69, 0x62, 0x6C, 0x65, 0x20, 0x62, 0x6F, 0x75, 0x6E, 0x64, 0x20, 0x62, 0x79, + 0x20, 0x63, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x20, 0x6F, 0x72, + 0x20, 0x73, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x69, 0x6E, 0x67, 0x20, 0x73, 0x70, 0x65, 0x65, + 0x64, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x35, 0x30, 0x30, 0x20, 0x69, 0x73, 0x20, 0x32, 0x20, 0x66, + 0x72, 0x61, 0x6D, 0x65, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, + 0x20, 0x28, 0x73, 0x75, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6F, 0x20, 0x62, 0x6F, 0x75, + 0x6E, 0x64, 0x73, 0x29, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x20, 0x69, + 0x73, 0x20, 0x30, 0x2E, 0x31, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x73, 0x20, 0x70, 0x65, 0x72, + 0x20, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x20, 0x6F, 0x72, 0x20, 0x31, 0x30, 0x20, 0x73, 0x65, + 0x63, 0x6F, 0x6E, 0x64, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x0D, + 0x0A, 0x20, 0x2D, 0x20, 0x76, 0x67, 0x61, 0x20, 0x69, 0x73, 0x20, 0x6D, 0x61, 0x78, 0x20, 0x32, + 0x35, 0x20, 0x66, 0x70, 0x73, 0x2C, 0x20, 0x68, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6D, 0x61, 0x78, + 0x20, 0x31, 0x32, 0x2E, 0x35, 0x20, 0x66, 0x70, 0x73, 0x2C, 0x20, 0x75, 0x78, 0x67, 0x61, 0x20, + 0x61, 0x74, 0x20, 0x31, 0x32, 0x2E, 0x35, 0x20, 0x66, 0x70, 0x73, 0x20, 0x65, 0x74, 0x63, 0x0D, + 0x0A, 0x31, 0x20, 0x2D, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x75, 0x70, 0x20, 0x2D, 0x20, 0x6D, + 0x75, 0x6C, 0x74, 0x69, 0x70, 0x6C, 0x79, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x20, 0x74, 0x6F, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x20, 0x75, 0x70, 0x20, 0x70, 0x6C, + 0x61, 0x79, 0x62, 0x61, 0x63, 0x6B, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x31, 0x20, 0x69, 0x73, + 0x20, 0x72, 0x65, 0x61, 0x6C, 0x74, 0x69, 0x6D, 0x65, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x32, + 0x34, 0x20, 0x77, 0x69, 0x6C, 0x6C, 0x20, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x61, 0x20, 0x31, 0x20, + 0x66, 0x70, 0x73, 0x20, 0x72, 0x65, 0x63, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x67, 0x20, 0x61, 0x74, + 0x20, 0x32, 0x34, 0x20, 0x66, 0x70, 0x73, 0x20, 0x6F, 0x6E, 0x20, 0x79, 0x6F, 0x75, 0x72, 0x20, + 0x63, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x72, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x33, 0x30, + 0x30, 0x20, 0x77, 0x69, 0x6C, 0x6C, 0x20, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x31, 0x30, 0x20, 0x73, + 0x65, 0x63, 0x20, 0x70, 0x65, 0x72, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x20, 0x61, 0x74, 0x20, + 0x33, 0x30, 0x20, 0x66, 0x70, 0x73, 0x20, 0x6F, 0x6E, 0x20, 0x79, 0x6F, 0x75, 0x72, 0x20, 0x63, + 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x72, 0x0D, 0x0A, 0x30, 0x20, 0x2D, 0x20, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6D, 0x64, 0x65, 0x6C, 0x61, 0x79, 0x20, 0x2D, 0x20, 0x6D, 0x69, 0x6C, 0x6C, 0x69, + 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x73, 0x20, 0x6F, 0x66, 0x20, 0x64, 0x65, 0x6C, 0x61, 0x79, + 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6E, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x69, + 0x6E, 0x67, 0x20, 0x66, 0x72, 0x61, 0x6D, 0x65, 0x73, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x61, 0x6C, 0x6C, 0x6F, 0x77, 0x73, 0x20, 0x79, 0x6F, 0x75, 0x20, 0x74, 0x6F, + 0x20, 0x73, 0x6C, 0x6F, 0x77, 0x20, 0x64, 0x6F, 0x77, 0x6E, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6D, 0x69, 0x6E, 0x67, 0x20, 0x74, 0x6F, 0x20, 0x73, 0x61, 0x76, 0x65, 0x20, 0x62, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x20, 0x70, 0x6F, 0x77, 0x65, 0x72, 0x20, 0x0D, 0x0A, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6E, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x6B, 0x20, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x61, 0x6C, 0x73, 0x6F, 0x20, 0x61, 0x6C, 0x6C, + 0x6F, 0x77, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x20, 0x72, 0x61, 0x74, 0x65, + 0x20, 0x69, 0x66, 0x20, 0x79, 0x6F, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x63, 0x6F, + 0x72, 0x64, 0x69, 0x6E, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, + 0x20, 0x61, 0x74, 0x20, 0x79, 0x6F, 0x75, 0x72, 0x20, 0x63, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, + 0x72, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x76, 0x67, 0x61, 0x20, 0x77, 0x69, 0x6C, 0x6C, 0x20, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6D, 0x20, 0x61, 0x62, 0x6F, 0x75, 0x74, 0x20, 0x33, 0x30, 0x2D, 0x33, + 0x33, 0x20, 0x66, 0x70, 0x73, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6E, 0x64, 0x69, 0x6E, 0x67, 0x20, + 0x6F, 0x6E, 0x20, 0x77, 0x69, 0x66, 0x69, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x62, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x6E, 0x65, 0x73, 0x73, 0x20, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x73, 0x20, 0x0D, 0x0A, + 0x20, 0x20, 0x20, 0x20, 0x69, 0x6E, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6A, 0x70, 0x65, 0x67, 0x0D, + 0x0A, 0x20, 0x2D, 0x20, 0x68, 0x64, 0x20, 0x77, 0x69, 0x6C, 0x6C, 0x20, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6D, 0x20, 0x61, 0x62, 0x6F, 0x75, 0x74, 0x20, 0x31, 0x30, 0x2D, 0x31, 0x32, 0x20, 0x66, + 0x70, 0x73, 0x20, 0x0D, 0x0A, 0x20, 0x2D, 0x20, 0x75, 0x78, 0x67, 0x61, 0x20, 0x77, 0x69, 0x6C, + 0x6C, 0x20, 0x6F, 0x6E, 0x6C, 0x79, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x20, 0x61, 0x74, + 0x20, 0x33, 0x20, 0x66, 0x70, 0x73, 0x20, 0x0D, 0x0A, 0x47, 0x4D, 0x54, 0x20, 0x2D, 0x20, 0x74, + 0x69, 0x6D, 0x65, 0x7A, 0x6F, 0x6E, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x73, 0x20, 0x6F, 0x6E, 0x20, 0x79, + 0x6F, 0x75, 0x72, 0x20, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x6D, + 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x3A, 0x20, 0x4D, 0x53, 0x54, 0x37, 0x4D, 0x44, 0x54, + 0x2C, 0x4D, 0x33, 0x2E, 0x32, 0x2E, 0x30, 0x2F, 0x32, 0x3A, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x2C, + 0x4D, 0x31, 0x31, 0x2E, 0x31, 0x2E, 0x30, 0x2F, 0x32, 0x3A, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x0D, + 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x65, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x3A, 0x20, 0x45, 0x53, + 0x54, 0x35, 0x45, 0x44, 0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x32, 0x2E, 0x30, 0x2C, 0x4D, 0x31, 0x31, + 0x2E, 0x31, 0x2E, 0x30, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, + 0x6C, 0x20, 0x65, 0x75, 0x72, 0x6F, 0x70, 0x65, 0x3A, 0x20, 0x43, 0x45, 0x54, 0x2D, 0x31, 0x43, + 0x45, 0x53, 0x54, 0x2D, 0x32, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x32, 0x3A, + 0x30, 0x30, 0x3A, 0x30, 0x30, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x33, + 0x3A, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x55, 0x6C, 0x61, 0x61, + 0x6E, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x2C, 0x20, 0x4D, 0x6F, 0x6E, 0x67, 0x6F, 0x6C, 0x69, + 0x61, 0x3A, 0x20, 0x55, 0x4C, 0x41, 0x54, 0x2D, 0x38, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x2C, 0x4D, + 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x32, 0x2C, 0x4D, 0x39, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x32, + 0x20, 0x0D, 0x0A, 0x20, 0x20, 0x2D, 0x20, 0x66, 0x69, 0x6E, 0x64, 0x20, 0x74, 0x69, 0x6D, 0x65, + 0x7A, 0x6F, 0x6E, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x3A, 0x20, 0x0D, 0x0A, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x73, 0x69, 0x74, 0x65, 0x73, 0x2E, + 0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x61, 0x2F, 0x75, 0x73, 0x61, + 0x70, 0x69, 0x65, 0x6E, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x6F, 0x70, 0x6E, 0x6F, 0x64, 0x65, + 0x2F, 0x74, 0x69, 0x6D, 0x65, 0x2D, 0x7A, 0x6F, 0x6E, 0x65, 0x73, 0x0D, 0x0A, 0x73, 0x73, 0x69, + 0x64, 0x31, 0x32, 0x33, 0x34, 0x20, 0x2D, 0x20, 0x79, 0x6F, 0x75, 0x72, 0x20, 0x77, 0x69, 0x66, + 0x69, 0x20, 0x73, 0x73, 0x69, 0x64, 0x20, 0x75, 0x73, 0x65, 0x72, 0x6E, 0x61, 0x6D, 0x65, 0x0D, + 0x0A, 0x20, 0x2D, 0x20, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6B, 0x65, + 0x79, 0x77, 0x6F, 0x72, 0x64, 0x20, 0x22, 0x77, 0x69, 0x66, 0x69, 0x6D, 0x61, 0x6E, 0x22, 0x20, + 0x74, 0x6F, 0x20, 0x6C, 0x61, 0x75, 0x6E, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x57, 0x69, + 0x46, 0x69, 0x4D, 0x61, 0x6E, 0x61, 0x67, 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6F, 0x6E, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x20, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x79, 0x6F, + 0x75, 0x72, 0x20, 0x73, 0x73, 0x69, 0x64, 0x2F, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, + 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x62, 0x20, 0x70, 0x6F, 0x72, 0x74, + 0x61, 0x6C, 0x20, 0x31, 0x39, 0x32, 0x2E, 0x31, 0x36, 0x38, 0x2E, 0x34, 0x2E, 0x31, 0x20, 0x6F, + 0x72, 0x20, 0x45, 0x53, 0x50, 0x33, 0x32, 0x2D, 0x43, 0x41, 0x4D, 0x0D, 0x0A, 0x20, 0x2D, 0x20, + 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x6B, 0x65, 0x79, 0x77, 0x6F, 0x72, 0x64, 0x20, 0x22, 0x73, + 0x73, 0x69, 0x64, 0x31, 0x32, 0x33, 0x34, 0x22, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x6E, 0x6F, 0x20, + 0x77, 0x69, 0x66, 0x69, 0x0D, 0x0A, 0x6D, 0x72, 0x70, 0x65, 0x61, 0x6E, 0x75, 0x74, 0x20, 0x2D, + 0x20, 0x79, 0x6F, 0x75, 0x72, 0x20, 0x77, 0x69, 0x66, 0x69, 0x20, 0x73, 0x73, 0x69, 0x64, 0x20, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x53, 0x6F, 0x75, 0x72, + 0x63, 0x65, 0x43, 0x6F, 0x64, 0x65, 0x3A, 0x20, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, + 0x2F, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x6A, 0x61, 0x6D, 0x65, + 0x73, 0x7A, 0x61, 0x68, 0x2F, 0x45, 0x53, 0x50, 0x33, 0x32, 0x2D, 0x43, 0x41, 0x4D, 0x2D, 0x56, + 0x69, 0x64, 0x65, 0x6F, 0x2D, 0x52, 0x65, 0x63, 0x6F, 0x72, 0x64, 0x65, 0x72, 0x2D, 0x6A, 0x75, + 0x6E, 0x69, 0x6F, 0x72, 0x0D, 0x0A, 0x4F, 0x6E, 0x65, 0x2D, 0x43, 0x6C, 0x69, 0x63, 0x6B, 0x20, + 0x49, 0x6E, 0x73, 0x74, 0x61, 0x6C, 0x6C, 0x65, 0x72, 0x3A, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3A, 0x2F, 0x2F, 0x6A, 0x61, 0x6D, 0x65, 0x73, 0x7A, 0x61, 0x68, 0x2E, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2E, 0x69, 0x6F, 0x2F, 0x45, 0x53, 0x50, 0x33, 0x32, 0x2D, 0x43, 0x41, 0x4D, 0x2D, + 0x56, 0x69, 0x64, 0x65, 0x6F, 0x43, 0x61, 0x6D, 0x2F, 0x0D, 0x0A, 0x4A, 0x61, 0x6D, 0x65, 0x73, + 0x20, 0x5A, 0x61, 0x68, 0x61, 0x72, 0x79, 0x20, 0x2D, 0x20, 0x4A, 0x61, 0x6E, 0x20, 0x31, 0x31, + 0x2C, 0x20, 0x32, 0x30, 0x32, 0x32, 0x0D, 0x0A, 0x0D, 0x0A +}; + void read_config_file() { + // if there is a config.txt, use it plus defaults + // else use defaults, and create a config.txt + // put a file "config.txt" onto SD card, to set parameters different from your hardcoded parameters // it should look like this - one paramter per line, in the correct order, followed by 2 spaces, and any comments you choose /* + ~~~ old config.txt file ~~~ desklens // camera name for files, mdns, etc 11 // framesize 9=svga, 10=xga, 11=hd, 12=sxga, 13=uxga, 14=fhd, 17=qxga, 18=qhd, 21=qsxga 8 // quality 0-63, lower the better, 10 good start, must be higher than "quality config" @@ -529,40 +687,56 @@ void read_config_file() { ssid1234 // ssid mrpeanut // ssid password + ~~~ new config.txt file ~~~ + desklens // camera name + 11 // framesize 11=hd + 1800 // length of video in seconds + 0 // interval - ms between recording frames + 1 // speedup - multiply framerate + 0 // streamdelay - ms between streaming frames + GMT // timezone + ssid1234 // ssid wifi name + mrpeanut // ssid password + ~~~ + Lines above are rigid - do not delete lines, must have 2 spaces after the number or string */ + String junk; + + String cname = "desklens"; + int cframesize = 11; + int cquality = 12; + int cframesizeconfig = 13; + int cqualityconfig = 5; + int cbuffersconfig = 3; + int clength = 1800; + int cinterval = 0; + int cspeedup = 1; + int cstreamdelay = 0; + int cinternet = 0; + String czone = "GMT"; + cssid = "ssid1234"; + cpass = "mrpeanut"; + File config_file = SD_MMC.open("/config.txt", "r"); - if (!config_file) { - Serial.println("Failed to open config_file for reading"); - } else { - String junk; - Serial.println("Reading config.txt"); - String cname = config_file.readStringUntil(' '); + if (config_file) { + + Serial.println("Reading simple.txt"); + cname = config_file.readStringUntil(' '); junk = config_file.readStringUntil('\n'); - int cframesize = config_file.parseInt(); - junk = config_file.readStringUntil('\n'); - int cquality = config_file.parseInt(); + cframesize = config_file.parseInt(); junk = config_file.readStringUntil('\n'); - int cframesizeconfig = config_file.parseInt(); + clength = config_file.parseInt(); junk = config_file.readStringUntil('\n'); - int cqualityconfig = config_file.parseInt(); + cinterval = config_file.parseInt(); junk = config_file.readStringUntil('\n'); - int cbuffersconfig = config_file.parseInt(); + cspeedup = config_file.parseInt(); junk = config_file.readStringUntil('\n'); - - int clength = config_file.parseInt(); + cstreamdelay = config_file.parseInt(); junk = config_file.readStringUntil('\n'); - int cinterval = config_file.parseInt(); - junk = config_file.readStringUntil('\n'); - int cspeedup = config_file.parseInt(); - junk = config_file.readStringUntil('\n'); - int cstreamdelay = config_file.parseInt(); - junk = config_file.readStringUntil('\n'); - int cinternet = config_file.parseInt(); - junk = config_file.readStringUntil('\n'); - String czone = config_file.readStringUntil(' '); + czone = config_file.readStringUntil(' '); junk = config_file.readStringUntil('\n'); cssid = config_file.readStringUntil(' '); junk = config_file.readStringUntil('\n'); @@ -570,39 +744,55 @@ void read_config_file() { junk = config_file.readStringUntil('\n'); config_file.close(); - Serial.printf("========= Data fram config.txt =========\n"); - Serial.printf("Name %s\n", cname); logfile.printf("Name %s\n", cname); - Serial.printf("Framesize %d\n", cframesize); logfile.printf("Framesize %d\n", cframesize); - Serial.printf("Quality %d\n", cquality); logfile.printf("Quality %d\n", cquality); - Serial.printf("Framesize config %d\n", cframesizeconfig); logfile.printf("Framesize config%d\n", cframesizeconfig); - Serial.printf("Quality config %d\n", cqualityconfig); logfile.printf("Quality config%d\n", cqualityconfig); - Serial.printf("Buffers config %d\n", cbuffersconfig); logfile.printf("Buffers config %d\n", cbuffersconfig); - Serial.printf("Length %d\n", clength); logfile.printf("Length %d\n", clength); - Serial.printf("Interval %d\n", cinterval); logfile.printf("Interval %d\n", cinterval); - Serial.printf("Speedup %d\n", cspeedup); logfile.printf("Speedup %d\n", cspeedup); - Serial.printf("Streamdelay %d\n", cstreamdelay); logfile.printf("Streamdelay %d\n", cstreamdelay); - Serial.printf("Internet %d\n", cinternet); logfile.printf("Internet %d\n", cinternet); - //Serial.printf("Zone len %d, %s\n", czone.length(), czone); //logfile.printf("Zone len %d, %s\n", czone.length(), czone); - Serial.printf("Zone len %d\n", czone.length()); logfile.printf("Zone len %d\n", czone.length()); - Serial.printf("ssid %s\n", cssid); logfile.printf("ssid %s\n", cssid); - Serial.printf("pass %s\n", cpass); logfile.printf("pass %s\n", cpass); + if (String(cssid) == "ssid1234") { + cinternet = 0; + } else if (String(cssid) == "wifiman") { + cinternet = 2; + } else { + cinternet = 4; + } + } else { + Serial.println("Failed to open config.txt - writing a default"); + // lets make a simple.txt config file + File new_simple = SD_MMC.open("/config.txt", "w"); + new_simple.print(simple_txt); + new_simple.close(); - framesize = cframesize; - quality = cquality; - framesizeconfig = cframesizeconfig; - qualityconfig = cqualityconfig; - buffersconfig = cbuffersconfig; - avi_length = clength; - frame_interval = cinterval; - speed_up_factor = cspeedup; - stream_delay = cstreamdelay; - IncludeInternet = cinternet; - configfile = true; - TIMEZONE = czone; - - cname.toCharArray(devname, cname.length() + 1); } + + Serial.printf("========= Data fram config.txt and defaults =========\n"); + Serial.printf("Name %s\n", cname); logfile.printf("Name %s\n", cname); + Serial.printf("Framesize %d\n", cframesize); logfile.printf("Framesize %d\n", cframesize); + Serial.printf("Quality %d\n", cquality); logfile.printf("Quality %d\n", cquality); + Serial.printf("Framesize config %d\n", cframesizeconfig); logfile.printf("Framesize config%d\n", cframesizeconfig); + Serial.printf("Quality config %d\n", cqualityconfig); logfile.printf("Quality config%d\n", cqualityconfig); + Serial.printf("Buffers config %d\n", cbuffersconfig); logfile.printf("Buffers config %d\n", cbuffersconfig); + Serial.printf("Length %d\n", clength); logfile.printf("Length %d\n", clength); + Serial.printf("Interval %d\n", cinterval); logfile.printf("Interval %d\n", cinterval); + Serial.printf("Speedup %d\n", cspeedup); logfile.printf("Speedup %d\n", cspeedup); + Serial.printf("Streamdelay %d\n", cstreamdelay); logfile.printf("Streamdelay %d\n", cstreamdelay); + Serial.printf("Internet %d\n", cinternet); logfile.printf("Internet %d\n", cinternet); + Serial.printf("Zone len %d, %s\n", czone.length(), czone.c_str()); //logfile.printf("Zone len %d, %s\n", czone.length(), czone); + Serial.printf("ssid %s\n", cssid); logfile.printf("ssid %s\n", cssid); + Serial.printf("pass %s\n", cpass); logfile.printf("pass %s\n", cpass); + + + framesize = cframesize; + quality = cquality; + framesizeconfig = cframesizeconfig; + qualityconfig = cqualityconfig; + buffersconfig = cbuffersconfig; + avi_length = clength; + frame_interval = cinterval; + speed_up_factor = cspeedup; + stream_delay = cstreamdelay; + IncludeInternet = cinternet; + configfile = true; + TIMEZONE = czone; + + cname.toCharArray(devname, cname.length() + 1); + } @@ -1279,9 +1469,9 @@ bool init_wifi() if (IncludeInternet >= 3) { WiFi.disconnect(true, true); - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); // https://github.com/espressif/arduino-esp32/issues/6086 WiFi.setHostname(devname); - + WiFi.mode(WIFI_STA); char ssidch[20]; char passch[20]; cssid.toCharArray(ssidch, cssid.length() + 1); @@ -1329,7 +1519,7 @@ bool init_wifi() }); } else { - + WiFi.mode(WIFI_STA); // https://github.com/espressif/arduino-esp32/issues/6086 WiFiManager wm; bool res; wm.setHostname(devname); @@ -1487,6 +1677,7 @@ static esp_err_t index_handler(httpd_req_t *req) {