Skip to content

Commit

Permalink
defaults, not personal settings (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
easytarget authored Aug 21, 2020
1 parent 15b3db5 commit ede61d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
24 changes: 16 additions & 8 deletions esp32-cam-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
// I keep my settings in a seperate header file
#include "myconfig.h"
#else
const char* ssid = "my-access-point-ssid";
const char* password = "my-access-point-password";
// used for wifi AP
const int wifichan = 5;
// Default Setup; an accesspoint
// SSID and Password for the accesspoint we want to join, or create
char* ssid = "ESP32-CAM-CONNECT";
const char* password = "InsecurePassword";
// Accesspoint mode: comment out to join an existing network
#define WIFI_AP
// Optional fixed channel for accesspoint
// #define AP_CHAN 5
#endif

// A Name for the Camera. (can be set in myconfig.h)
Expand All @@ -51,8 +55,9 @@

// This will be displayed to identify the firmware
char myVer[] PROGMEM = __DATE__ " @ " __TIME__;
char myRotation[5];

// current rotation direction
char myRotation[5];

#include "camera_pins.h"

Expand Down Expand Up @@ -89,8 +94,7 @@ void setup() {

// set the initialisation for image rotation
int n = snprintf(myRotation,sizeof(myRotation),"%d",CAM_ROTATION);
// Serial.printf("Config Rotation: \"%s\" size %d\n",myRotation,sizeof(myRotation));



#ifdef LED_PIN // If we have a notification LED set it to output
pinMode(LED_PIN, OUTPUT);
Expand Down Expand Up @@ -174,7 +178,11 @@ void setup() {

#ifdef WIFI_AP
Serial.println("Setting up AP");
WiFi.softAP(ssid, password, wifichan);
#ifdef AP_CHAN
WiFi.softAP(ssid, password, AP_CHAN);
# else
WiFi.softAP(ssid, password);
#endif
#else
WiFi.begin(ssid, password);

Expand Down
12 changes: 6 additions & 6 deletions myconfig.sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

const char* ssid = "my-access-point-ssid";
const char* password = "my-access-point-password";
const int wifichan = 5;

// Optionally give the camera a name for the web interface
// (nb: this is not the network hostname)
#define CAM_NAME "UltiCam"
#define CAM_NAME "my-awesome-webcam"

// Optional initial rotation
#define CAM_ROTATION 90

// Optional AP setup
#define WIFI_AP
// #define CAM_ROTATION 90

// Optional AccessPoint setup, uncomment to enable
// #define WIFI_AP
// Optionall accesspoint channel number
// #define AP_CHAN 5

0 comments on commit ede61d4

Please sign in to comment.