jameszah / ESP32-CAM-Video-Recorder

Video Recorder for ESP32-CAM with http server for config and ftp (or http) server to download video
GNU General Public License v3.0
443 stars 101 forks source link

Settings.h changes ignored #43

Closed fsaberi closed 2 years ago

fsaberi commented 3 years ago

Hi. Thank you so much for your program. using V98. My problem is that changes to settings.h seem to be ignored. I want the ESP32-CAM to boot in PIR Sensor mode. But it always boots up starting to record and HTTP server enabled.

I want it to start in a "stopped mode" so that it is only activated by PIR. Right now what I have to do is manually use the HTTP page to stop the recording. Only then it works with my PIR sensor. How do I automate this? Don't record after booting, stop and wait for PIR Sensor on GPIO 13? thanks

I printout the DeepSleepPir value in loop():

void loop()
{
  if (first) {
    Serial.print("the loop, core ");  Serial.print(xPortGetCoreID());
    Serial.print(", priority = "); Serial.println(uxTaskPriorityGet(NULL));
    //vTaskPrioritySet( NULL, 2 );
    //print_ram();
    first = 0;
  }

#ifdef include_pir_and_touch
  Serial.print(" **** DeepSleepPir="); Serial.println(DeepSleepPir);

  if (DeepSleepPir) {
    if (recording == 0 && PIRenabled == 1) {

Although in settings.h DeepSleepPir = 1; , in the code it is always 0. DeepSleepPir=0 DeepSleepPir=0 ...

And we can see in boot messages that settings.h config is not reflected in TimeLapseAvi98x.ino. DeepSleepPir is 0, but should be 1.

-------------------------------------
ESP-CAM Video Recorder v98
 http://desklens.local - to access `the` camera
-------------------------------------
Boot number: 1
Wakeup was not caused by deep sleep: 0
Get took 1
Good settings in the EPROM 
Internet_Enabled 1
DeepSleepPir 0
record_on_reboot 1
PIRpin 13
PIRenabled 1
framesize 7
repeat_config 100
xspeed 1
gray 0
quality 10

my settings.h:

static const char devname[] = "desklens";  // name of your camera for mDNS, Router, and filenames

#define include_telegram
#define include_pir_and_touch
#define include_ftp
#define include_streaming
#define get_rid_of_touch

int delete_old_files = 1; 
#define TIMEZONE "PST8PDT,M3.2.0,M11.1.0"             // your timezone  -  this is Pacific
#define BlinkWithWrite 1

// EDIT ssid and password
const char* ssid = "----";
const char* password = "----";

// reboot startup parameters here
int Internet_Enabled = 0;      // set to 0 to shut off all internet activities - wifi, time, http, ftp, telegram
int DeepSleepPir  = 1;           // set to 1 to deepsleep between pir videos
int record_on_reboot = 0;     // set to 1 to record, or 0 to NOT record on reboot
int PIRpin = 13;                   // for active high pir or microwave etc
int PIRenabled = 1;                // 1 is PIR is enable on reboot, will only work if you are not recording

int MagicNumber = 011;         
int stream_interval = 333;

 // SVGA
int  framesize = 7;                //  10 UXGA, 7 SVGA, 6 VGA, 5 CIF
int  repeat_config = 900;      
int  xspeed = 2;                    
int  gray = 0;                  
int  quality = 12;          
int  capture_interval = 200;     
volatile int  total_frames_config = 3600; 
fsaberi commented 3 years ago

Never mind, it seems that changing the MagicNumber in settings picks up new settings values. :-|