Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RoSchmi committed Dec 3, 2021
1 parent d09fb26 commit eb7c8f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
10 changes: 5 additions & 5 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

// Define other settings according to your needs

// The credentials of your WiFi router has to be set in the file config_secret.h
// The credentials of your WiFi router have to be set in the file config_secret.h


#define SERIAL_PRINT 1 // 1 = yes, 0 = no. Select if Serial.print messages are printed

#define TRANSPORT_PROTOCOL 0 // 0 = http, 1 = https

// not yet implemented
#define WORK_WITH_WATCHDOG 1 // 1 = yes, 0 = no, Watchdog is used (1) or not used (0)
#define TRANSPORT_PROTOCOL 0 // 0 = http, 1 = https
// should be 1 for normal operation and 0 for testing

#define WORK_WITH_WATCHDOG 0 // 1 = yes, 0 = no, Watchdog is used (1) or not used (0)
// should be 1 for normal operation and 0 for testing
// not tested if it works
#define USE_STATIC_IP 0 // 1 = use static IpAddress, 0 = use DHCP
Expand Down
19 changes: 3 additions & 16 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ platform = espressif32
board = esp32dev
framework = arduino




[env]
; ============================================================
; Serial configuration
Expand All @@ -34,8 +31,8 @@ upload_port = COM10
monitor_speed = 115200
monitor_port = COM10

debug_tool = esp-prog
debug_init_break = tbreak setup
;debug_tool = esp-prog
;debug_init_break = tbreak setup

build_flags =
; set your debug output (default=Serial)
Expand All @@ -52,27 +49,17 @@ lib_extra_dirs =
lib/RoSchmi
lib


lib_deps =
SPI
Sinricpro/SinricPro@^2.9.10
;/~https://github.com/khoih-prog/WiFiWebServer#v1.4.2

;/~https://github.com/khoih-prog/ESPAsync_WiFiManager
;/~https://github.com/khoih-prog/WiFiNINA_Generic@=1.8.13
/~https://github.com/khoih-prog/WiFiNINA_Generic
/~https://github.com/khoih-prog/WebSockets_Generic#v2.10.1

/~https://github.com/tzikis/ArduinoMD5/

;/~https://github.com/sinricpro/esp8266-esp32-sdk?utm_source=platformio&utm_medium=piohome

;/~https://github.com/khoih-prog/NTPClient_Generic






lib_ignore =
WiFiNINA_Generic
WiFi101
Expand Down
10 changes: 3 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ std::map<String, deviceConfig_t> devices =
uint32_t millisAtLastAction;
uint32_t millisBetweenActions = 10000;

//X509Certificate myX509Certificate = baltimore_root_ca;
X509Certificate myX509Certificate = myfritzbox_root_ca;

#if TRANSPORT_PROTOCOL == 1
Expand Down Expand Up @@ -173,8 +172,7 @@ void setup() {
Serial.print(BOARD_NAME);
Serial.print(F(" with "));
Serial.println(SHIELD_TYPE);
//Serial.println(WIFI_WEBSERVER_VERSION);


// Wait some time (3000 ms)
start = millis();
while ((millis() - start) < 3000)
Expand Down Expand Up @@ -283,7 +281,7 @@ if (!WiFi.enableSTA(true))
SinricProSwitch& mySwitch = SinricPro[SWITCH_ID_1];
// send powerstate event
mySwitch.sendPowerStateEvent(actualSocketState); // send the actual powerState to SinricPro server
Serial.println("State from Fritz!Dect was transmitted to server");
Serial.println("PowerState from Fritz!Dect was transmitted to server");
}

// Set time interval for repeating commands
Expand Down Expand Up @@ -318,9 +316,7 @@ void loop()
delay(10 * 1000); // 10 seconds
ESP.restart();
}
}
//String switchname = fritz.getSwitchName(FRITZ_DEVICE_AIN_01);
//Serial.printf("Name of device is: %s", switchname.c_str());
}
}
SinricPro.handle();
handleButtonPress();
Expand Down

0 comments on commit eb7c8f2

Please sign in to comment.