-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathota_basic.ino
More file actions
35 lines (29 loc) · 854 Bytes
/
Copy pathota_basic.ino
File metadata and controls
35 lines (29 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <Arduino.h>
#include "include/config.h"
#include "include/ota.h"
#include "include/version.h"
const char* ssid = "Airtel_amish_4535";
const char* password = "Amish@123";
constexpr uint8_t IN_BUILT_LED = 2;
void setup() {
Serial.begin(115200);
Serial.println("Booting firmware " FIRMWARE_VERSION);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
otaSetup(IN_BUILT_LED, "visiosphereai-esp32", password);
}
void loop() {
otaHandle();
if (!otaInProgress && millis() - lastBlinkTime > 1000) {
ledState = ledState == LOW ? HIGH : LOW;
digitalWrite(otaLedPin, ledState);
Serial.println(otaInProgress);
Serial.println(ledState);
lastBlinkTime = millis();
}
}