Hello! i am currently using blynk for a couple of relays some temperature and what not.But my NodeMCU board stays in the basement and in order to upload some new code i need to go to the basement with my laptop which is a pain in the ass.So i was wondering if i could implement ArduinoOTA into my code in order to upload over WiFi.
Heres my code:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define Temp_Kotel D3
#define Temp_Trapezaria D4
#define COLOR_RED "#ff0000"
#define COLOR_YELLOW "#ffff00"
#define COLOR_GREEN "#00ff00"
OneWire Kotel(Temp_Kotel);
OneWire Trapezaria(Temp_Trapezaria);
DallasTemperature KotelS(&Kotel);
DallasTemperature TrapezariaS(&Trapezaria);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "top secret";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "notgonnatellya";
char pass[] = "notgonnatellya";
// Select your pin with physical button
const int garageLED1 = D1;
const int garageLED2 = D2;
WidgetLED LED1(V1);
WidgetLED LED2(V2);
const int kotel = D7;
const int garage = D6;
SimpleTimer timer;
// V3 LED Widget represents the physical button state
void buttonLedWidget()
{
// Read button
if ((digitalRead(garageLED1) == 0) && (digitalRead(garageLED2) == 1)) {
LED1.on();
LED1.setColor(COLOR_RED);
}
if ((digitalRead(garageLED1) == 1) && (digitalRead(garageLED2) == 1)) {
LED1.on();
LED1.setColor(COLOR_YELLOW);
}
if ((digitalRead(garageLED1) == 1) && (digitalRead(garageLED2) == 0)) {
LED1.on();
LED1.setColor(COLOR_GREEN);
}
KotelS.requestTemperatures();
TrapezariaS.requestTemperatures();
float K = KotelS.getTempCByIndex(0);
float S = TrapezariaS.getTempCByIndex(0);
Blynk.virtualWrite(V3, K);
Blynk.virtualWrite(V4, S);
}
void setup()
{
pinMode(kotel, OUTPUT);
pinMode(garage, OUTPUT);
digitalWrite(kotel, HIGH);
digitalWrite(garage, HIGH);
// Debug console
Serial.begin(9600);
KotelS.begin();
TrapezariaS.begin();
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
// Setup physical button pin (active low)
pinMode(garageLED1, INPUT_PULLUP);
pinMode(garageLED2, INPUT_PULLUP);
timer.setInterval(500L, buttonLedWidget);
}
void loop()
{
Blynk.run();
timer.run();
}
(Basically i’m asking if you can do the work for me and add the ArduinoOTA)