Server OTA support for ESP8266

Not exactly. OTA is ready. However, at the moment we are focused on web UI. Blynk app was developed for 3 years already. You can imagine how many work we have to do on web :slight_smile:.

Any estimated release date?

no :slight_smile:

Iā€™m having errors uploading the OTA.h with the #include OTA.h command written into my sketch.

There is an error in the IDE when I write BLYNK_WRITE(InternalPinOTA)

The error says: expected constructor, destructor, or type conversion before ā€˜(ā€™ token

Any thoughts? Iā€™ve built my own local Blynk Server and other sketches work great on it. Just getting this OTA into my original sketch and then onto the NodeMCU is proving quite difficult. I have all the updated libraries, I believe (though that was a bit of an issue too).

could you paste your code here? Probably you are making a syntax error.

Yeahereā€™s the cod. It works itself but the problem is with the OTA.h file when I include it. Connecting to Blynk on my own local server worked perfectly. Just the inclusion of this OTA isnā€™t working, and itā€™s absolutely essential to to project.

The project is essentially having buzzers places all around the facility and from Blynk I am able to push start a melody of my choice.

Updating the melodies OTA will be important because there will probably be up to 40 NodeMCUā€™s

Any help would be really really appreciated! Thanks.


#include "OTA.h"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = ".";
char pass[] = "";
String BlynkState;


// notes in the melody:
int melody1[] = {
  NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5, NOTE_C6
};

int melody2[] = {
  NOTE_C5, NOTE_C5, NOTE_C5, NOTE_F5, NOTE_E5, NOTE_A5, NOTE_E5, NOTE_G6
};

int duration = 500;  // 500 miliseconds
void MelodyOne(){
 for(int i=0; i <= 15; i++){
    for (int thisNote = 0; thisNote < 8; thisNote++) {
    // pin8 output the voice, every scale is 0.5 sencond
    tone(D1, melody1[thisNote], duration);
     tone(D6, melody1[thisNote], duration);
    // Output the voice after several minutes
    delay(1000);
}
}}

void MelodyTwo(){
  for(int i=0; i <= 15; i++){
    for (int thisNote = 0; thisNote < 8; thisNote++) {
    // pin8 output the voice, every scale is 0.5 sencond
    tone(D1, melody2[thisNote], duration);
     tone(D6, melody2[thisNote], duration);
    // Output the voice after several minutes
    delay(1000);
  
}}}





BLYNK_WRITE(V1){
int i = param.asInt();

if(i==1){
  MelodyOne();
}
else{return;}
  
}

BLYNK_WRITE(V2){
int i = param.asInt();

if(i==1){
  MelodyTwo();
}
else{return;}
  
}
 
void setup() {
   Serial.begin(9600);

  Blynk.begin(auth, ssid, pass, "isblynk.isbologna.com", 8080);
}
 
void loop() {  
  Blynk.run();
}

I have deployed a blynk-server on my cloud server with docker.
I have added my droplet ip in the server.properties.
But the error is Firmware update URL: http://"159.89.20.XXX":8080/static/ota/FUp_10783858033040037488_upload.bin Firmware update failed (error -1): HTTP error: connection refused
The server ip is correct.
Can someone give me some hints how to fix this? Thanks

@Iotfun OK, this is just a WAG as I have never tried this method of OTA (just the bog standard Arduino Core method over my internal network).

But I see what looks like a public IP in your URLā€¦ and if I understand some references in posts way above, in order to use the update over the Public side of your network you need to set a host name in your server.propertiesā€¦ and use that in your URLā€¦ and by host name it means exactly that, not just an IP but a registered host address.

Hi there. I have done the OTA update through a raspberry pi running Blynk server and it worked great. Now I want to try it on AWS but now realizing the curl commands may be specifically for the Blynk server. Is this true?

How can I do the update on my AWS ec2 ubuntu server?

What do u mean?

I realized what was wrong there. I never actually downloaded the Blynk server into my EC2 instance. but now I have and I am getting the error

[189735] RUNNING => OTA_UPGRADE
[190236] Firmware update URL: http://172.31.22.100:8080/static/ota/FUp_23436541120134483_upload.bin
[198380] Firmware update failed (error -1): HTTP error: connection refused
[198380] OTA_UPGRADE => ERROR

as I see a lot of others have been through. When you say to go into server.properties and add server.host, do you mean the public IP of my AWS EC2 instance? other than that, were there other fixes for this problem or do you think that will work?

well, it is working now. I looked at the app again and it had disconnected so I logged back into it and my project was completely goneā€¦ I created a new project and auth token and when I tried this new auth token in the curl after connecting the device to wifi with the new auth token and it worked fine. thanks