From 86c4a1bb484a06a8d18895a34cb0a6f60ee37818 Mon Sep 17 00:00:00 2001 From: Simon Schmidt Date: Thu, 10 Jun 2021 18:47:55 +0200 Subject: [PATCH] added template --- README.md | 2 ++ include/template.h | 10 ++++++++++ platformio.ini | 7 +++++++ src/main.cpp | 10 ++++------ 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 README.md create mode 100644 include/template.h diff --git a/README.md b/README.md new file mode 100644 index 0000000..84cc79c --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# wifi credentials +need to create wifi_credentials.h from template.h \ No newline at end of file diff --git a/include/template.h b/include/template.h new file mode 100644 index 0000000..c33ff69 --- /dev/null +++ b/include/template.h @@ -0,0 +1,10 @@ + +#ifndef __WIFI_CREDENTIALS_H +#define __WIFI_CREDENTIALS_H + +#ifndef STASSID +#define STASSID "ssid" +#define STAPSK "key" +#endif + +#endif // __WIFI_CREDENTIALS_H \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 94f4f92..a20109c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,4 +13,11 @@ platform = espressif8266 board = esp01_1m framework = arduino +; stuff for OTA +; https://docs.platformio.org/en/latest/platforms/espressif8266.html#over-the-air-ota-update +upload_protocol = espota +upload_port = 192.168.10.94 +upload_flags = + --port=8266 + --auth=admin diff --git a/src/main.cpp b/src/main.cpp index 7b06521..15c0443 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -110,14 +110,12 @@ void setup() { ESP.restart(); } - // Port defaults to 8266 - // ArduinoOTA.setPort(8266); - - // Hostname defaults to esp8266-[ChipID] - ArduinoOTA.setHostname("myesp8266"); + // setup OTA + ArduinoOTA.setPort(8266); + ArduinoOTA.setHostname("ESP_Treppenlicht"); // No authentication by default - // ArduinoOTA.setPassword("admin"); + ArduinoOTA.setPassword("admin"); // Password can be set with it's md5 value as well // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3