Updating OTA is amazing

I tried using your code but it didn`t work. In arduino Ide after compiling I get:

Authenticating…OK
20:49:49 [ERROR]: No response from device

Insteads of using Serial output… why not set up a terminal widget and output everything to that instead… then yo uare truely working remotly.

1 Like

@Jamin indeed, using terminal widget would work :slight_smile:

I also recall someone figured out how to re-router all native Serial comms to the terminal widget. Have a search :slight_smile:

Post number 134 (2 being the status when your ESP is not connected to a PC).

@Costas - thanks Costas I realize you also provided the same advice yesterday. Thank you all for your help on this topic, much appreciated.

so i got literally to the point of uploading this to one of my battery outside sensor nodes and realised it has ESP.sleep in it…

there’s no way this can work with a sleeping ESP is there? can i wake it up or are they ‘dead to the world’ until it finishes counting? or is there?

Hi @Dave1829,
Maybe you could add an if statment using a virtual pin so if the Vpin is “On” the Esp won’t enter into deep sleep till Vpin is “Off”
Do you know what I mean?

ok, so if i activate the vpin, then wait the 15 mins sleep cycle - then i can light a virtual LED to show it is ready to receive… then run OTA, then it will reset and vpin will reset to off.

yep, i think i know what you mean - so it is all software resolved, not in hardware :slight_smile:

thanks!

Yes, that’s the idea!! :relaxed:

Or you can go the httpupdate route like I did and have it check for an update every time it wakes.

What’s that like on the battery life?

No clue. It is just checking a server to see if the file exists for update then moves on. I imagine it wouldn’t impact it much.

Would this work with wemos d1 mini? What about arduino nano with ethernet shield?

Certainly works for WeMos D1 Mini. It would be a different library, if one exists, for ethernet “OTA”.

Can anyone help me with code and library for ENC28J60 with arduino nano? OTA works great on my WeMos D1 (old version), but for me it will be more important to be able to upload sketch without physically accessing my board that is connected to ethernet.

I am using this code:

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 *
 * This example shows how to use ENC28J60 (UIPEthernet library)
 * to connect your project to Blynk.
 *
 * For this example you need UIPEthernet library:
 *   https://github.com/ntruchsess/arduino_uip
 *
 * Typical wiring would be:
 *  VCC -- 5V
 *  GND -- GND
 *  CS  -- D10
 *  SI  -- D11
 *  SCK -- D13
 *  SO  -- D12
 *  INT -- D2
 *
 * Feel free to apply it to any other example. It's simple!
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxf19";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
  // You can also specify server.
  // For more options, see BoardsAndShields/Arduino_Ethernet_Manual example
  //Blynk.begin(auth, "blynk-cloud.com", 8442);
  Blynk.begin(auth, IPAddress(192,168,1,78), 8888);
}

void loop()
{
  Blynk.run();
}

@monaco take a look at this very, very, very long page that details updating Arduino’s over a network, not OTA as Arduino’s don’t have “air” access http://www.freetronics.com.au/pages/how-to-upload-a-sketch-to-your-arduino-via-a-network#.V8yBCvl9600

A word of caution, it’s very complex. I’ve been trying for a couple days and I gave up, lol. It’s just easier to get a Wemos :wink:

1 Like

Uf, complicated :slight_frown: From network perspective it is not important if connection is ethernet or wi-fi, so this “air” should not be considered literally :wink: IP address is IP addresss. That’s why there is idea to use this option. But I have no idea what would need to be changed. Probably different library…

I just want to say thank you to everyone who contributed to this awesome thread. OTA update + Blynk is working perfectly on my NodeMCU v2 + Arduino IDE 1.6.11 (and esp library 2.3.0)

1 Like