Browse Source

Ota Conig

esp32ota
Patrizio Trinchini 3 weeks ago
parent
commit
f433a2c191
  1. 3
      platformio.ini
  2. 4
      src/credentials.h
  3. 12
      src/main.cpp

3
platformio.ini

@ -24,6 +24,7 @@ platform = espressif32
board = esp32dev board = esp32dev
framework = arduino framework = arduino
upload_protocol = espota upload_protocol = espota
upload_port = 192.168.1.235 upload_port = 192.168.1.167
upload_flags = --auth=P@ssw0rd
lib_deps = lib_deps =
knolleary/PubSubClient@^2.8 knolleary/PubSubClient@^2.8

4
src/credentials.h

@ -1,8 +1,8 @@
#define WLAN_SSID "TP-LINK-OUT" #define WLAN_SSID "TP-LINK-HOME"
#define WLAN_PASS "6JM54UG4EX" #define WLAN_PASS "6JM54UG4EX"
#define MQTT_USER "admin" #define MQTT_USER "admin"
#define MQTT_PASS "22pa0799" #define MQTT_PASS "22pa0799"
#define OTA_USER "admin" #define OTA_USER "admin"
#define OTA_PASS "Ut@meri$22" #define OTA_PASS "P@ssw0rd"

12
src/main.cpp

@ -109,7 +109,7 @@ void setup_http() {
void setup() { void setup() {
Serial.begin(115200); Serial.begin(9600);
while(!Serial) { while(!Serial) {
delay(100); delay(100);
} }
@ -122,17 +122,17 @@ void setup() {
setup_wifi(); setup_wifi();
setup_ota(); setup_ota();
setup_mqtt(); //setup_mqtt();
setup_http(); setup_http();
} }
void loop() { void loop() {
ArduinoOTA.handle(); ArduinoOTA.handle();
if (!client.connected()) { // if (!client.connected()) {
reconnect(); // reconnect();
} // }
client.loop(); // client.loop();
server.handleClient(); server.handleClient();

Loading…
Cancel
Save