Updating OTA is amazing

Just wondering if you had any issues with arduino 16.11? I had issues with going from 16.9 to 16.10 but should i be fine with the new one?

Usually itā€™s full of bugs, so Iā€™d keep a copy of a working version handy, other than that, itā€™s just a matter of trying, Iā€™m afraid :slight_smile:

@Dave1829 havenā€™t had any issues with it thus far :sunglasses:

1 Like

I could do my sketch with Blynk and OTA. I used your code by exemple! Thanks Roccod!

was your RTC widget OK?

Iā€™ll find out this weekend :wink:

OMG, I read almost everything but no clue what is happening :rolling_eyes: but if someone provide an instructables with pictures and video would be awesomeā€¦ Am I expecting too much? :upside_down:

@speed57 the secret is to read all, not almost everything. In answer to your question, yes.

Read, read again and then when you have read it again and tried everything tell us everything you have done, all the hardware and software you are using and what results you get.

We might then be able to point you in the right direction.

Thank you guys @Jamin, @Costas , @Lichtsignaal always good projects, sharing codes and support for community :pray:

1 Like

@Costas Yeap as you are saying I am reading again and again, tried couple projects and having fun with it, at least it makes me happy :relaxed: I will definitely share my humble projects.
I started with simple esp8266 led blink and continuing with couple relay switches, ultrasonic sensor, humidity and temperature sensors, servo motors up to bridge communications. Now I am interested in OTA updates. Trying to keep up and catch up with you.

@Costas Finally I did it with basic OTA and local/update.

I want to OTA my NodeMcu via 4g outside the country, I have mobile hotspot at home that Nodemcu connected to it, but problem is it hasnā€™t got a port forwarding. Is there an other way to do it or not. please help.

You could do it with a server update instead. You put a binary file on the server and have it check for updates and if one is present it will update itself. check out HTTP update. http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html#http-server

@Roccod Do you mean local server or blynk server, sorry for stupid question, I just today managed to do basic OTAs :sweat:

Can you put in basic code example something like that to clarifying the point ?
Would be appreciated

I use a local apache server which is also my Blynk server ran on a pi, but you could use an online server as well. This is the example in the arduino ota library

/**
 * httpUpdate.ino
 *
 *  Created on: 27.11.2015
 *
 */

#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>

#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

void setup() {

    USE_SERIAL.begin(115200);
    // USE_SERIAL.setDebugOutput(true);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    for(uint8_t t = 4; t > 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    WiFiMulti.addAP("SSID", "PASSWORD");

}

void loop() {
    // wait for WiFi connection
    if((WiFiMulti.run() == WL_CONNECTED)) {
//this is the bit that checks for the update. Note that if the file is in the home directory you don't need to put the location //Every time this is ran it will check for a new update.
    t_httpUpdate_return ret = ESPhttpUpdate.update("SERVER ADDRESS IP/LOCATION/BINARY FILE.bin"); //IMPORTANT: INCREMENT .bin FILE NAME BY 1 ON EACH UPDATE
        //t_httpUpdate_return  ret = ESPhttpUpdate.update("https://server/file.bin");

//this bit just returns some info. Is there and update? was the update successful? did it fail?
        switch(ret) {
            case HTTP_UPDATE_FAILED:
                USE_SERIAL.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
                break;

            case HTTP_UPDATE_NO_UPDATES:
                USE_SERIAL.println("HTTP_UPDATE_NO_UPDATES");
                break;

            case HTTP_UPDATE_OK:
                USE_SERIAL.println("HTTP_UPDATE_OK");
                break;
        }
    }
}
1 Like

hi I know that OTA on Uno is not possible, but if I made a project with Uno + ESP01 using these lib
#include < ESP8266_Lib.h>
#include < BlynkSimpleShieldEsp8266.h>

it could be possible use ArduinoOTA.h with that? Or it works only on ā€œpureā€ ESP8266?

I donā€™t think that would work.

For UNO you probably need a modified bootloader and a TFTP server from what I saw. I looked at it a couple days and gave up, itā€™s just too complicated and not worth the effort. Instead, use the ESP standalone (e.g. Wemos D1, very good product).

1 Like

@Roccod Thank you for code. :thumbsup:

I have been using it for a few months on my all D1 mini, but now it does not accept password.

@monaco if you have Serial Monitor open make sure you close it before trying the OTA update.