OTA on local Blynk server

I was wondering. I haven’t tested this yet but if I move all the modules (ESP8266) to a local (RPI) Blynk server can I still do OTA updates? And if so, how?
Currently all the IP addresses of the modules are directly exposed on my LAN and Arduino IDE can find these. But if I move the lot to a local Blynk server (which would still run on my LAN) then these IP’s would be accessible only through the server and no longer be present on the LAN, right?. So how can I OTA the modules when they’re on a local server?

ok by now I finally got the Blynk server running. The ESP is connected, the IP address does show up in the arduino IDE, but when I start uploading the compilation I get:

20:28:02 [ERROR]: No Answer
20:28:02 [ERROR]: No Answer

anyone got an Idea how to solve this? or how to send updates OTA ?

Make sure to reset or repower all ESPs after initial sketch upload from USB, then it should work with OTA.

yup, they have been updated and reset many times. but i still get that issue. Do I need to reset them after EVERY update?

No, just after the initial USB flash.

But I also only use basic OTA, pushed via the IDE and not specific to Blynk, so if you are doing that supposed “Device reads/pulls update from Blynk Server” method, then there may be some other issue??

Are your devices on the same network as the server?

AFAIK Im using the default OTA (the functions all start with ArduinoOTA.etc. and the included lib is also ArduinoOTA) and yes everything is on the same network…

@wolph42, Arduino OTA just works (for everyone? :stuck_out_tongue: ). If t is visible in network, it works (mostly). Are you sure you put all the necessary “blocks” into the code? It happened to me (I forgot to add just a simple, yet important ArduinoOTA.handle();) so I guess it may happen to everyone :wink:

Here is a basic template I use…

And aside from its needed presence in the void loop() I have found that a sufficient “blocking” function or long processing routine can interfere with its ability to ‘answer’ the call from the IDE.

I have been able to mitigate that in situations like RGB lighting routines by adding a few ArduinoOTA.handle(); commands in strategic places of long running functions.

thnx. ill check it out.

@marvin7: given the fact that I updated it over the air and THEN I got the ‘no answer’ I’m fairly certain that I have the OTA setup correctly.

the remaining possibility is that as @Gunner pointed out, perhaps I need to add some handles in the code.
I have to say though that there’s not much going on in the code, so I’m not sure thats the issue.

But ill get back on this after further testing

Ok 've been able to solve this. Basically it boils down to ‘try several times’ and lower the overal poweroutput of the ESP’s. They are WAY too strong and cause too much interference which is one of the reasons this failure happened.

@Gunner: preferably I would like to update the ArduinoOTA.handle() routine to increase the signal strengths when an OTA request happens. The weird thing is tough: I can’t find it in my libraries. Do you know where I should look?

Look for ArduinoOTA.h… although since I believe it is part of the ESP Arduino Core libraries, it might be in the core install folders? Just run a PC search for that file.

EDIT, yep… for me it is here:
D:\Users\Gunner\Documents\Arduino\hardware\espressif\esp32\libraries\ArduinoOTA\src

But consider that since the command needs to sit in the void loop() anyhow… you would be adjusting the signal strength thousands of times a second.

thnx! I’ll need to check that when I’m home.

not quite, I’ve looked it up on github and it concerns this routine:

void ArduinoOTAClass::handle() {
  if (_state == OTA_RUNUPDATE) {
    _runUpdate();
    _state = OTA_IDLE;
  }
}

which I can easily change in:

void ArduinoOTAClass::handle() {
  if (_state == OTA_RUNUPDATE) {
    setOutputPower(20);
    _runUpdate();
    _state = OTA_IDLE;
    setOutputPower(0); //or something close to 0
  }
}

The only problem is that I can’t find any routine that shows you the current poweroutput. Its possible that different esps will have different outputs depending on their position, so I need to know that value before I change it to max.

Well, interesting concept… let us know how it works.

Meanwhile I have like five ESP8266 & ESP32 modules all running 24/7 in a 1x2 square foot space (30.5x61cm) of my little workbench, all updatable with OTA without any notable issues, so I am unsure that WiFi power is necessarily tissue.

But interference between them and the router… yes, that I have ran into that… neighbor’s WiFi on same channel and testing old WiFi cameras in close proximity.

well there are 2 concerns.

  1. I have not 5 but 11 ESP’s and during one test setup i turned them all on (while on the table so in real close proximity of eachother) and a couple started to have communication issues
  2. the sensor in the thermostats is infuenced by the heat generated from the ESP’s. I’ve placed it as far away as possible with a couple of barriers between, but its still influenced. Hence i want the ESP’s a ‘quiet’ as possible.

That and I’ve heard that they’re actually ‘badly’ engineered such that they generate WAY too much power and can cover a range of 350 yards (didn’t test this,but it does sound way over the top for my purpose).

are you saying you are trying to change the power output just so your sensor is less influenced by the temperature of the hardware?

if your ESP’s are getting hot - you actually have some weird issues!

I recall giving two reasons…

indeed it would, but they don’t get ‘hot’ they get ‘warm’, more exactly the combination of the ESP8266 (wemos D1) and an OLED shield gets 30C (with infrared measurement), I believe the OLED gets the ‘hottest’ of the two, but I recall that the ESP also goes between 25 and 30C I don’t think these values are cause for any alarm, but in an ambient T of 20 they ARE of influence on my sensor. (somewhere between 0.5C and 3C, depending on the type of box I use)

I’ve noticed, ESP may get hotter while some connections issues appears. But it never got “hot” actually - I was always able to touch it without any harm. Under normal conditions it is just slightly warm (ESP01) or barely noticeable (metal-shielded ESP’s) but I assume network activity influenced by our code play a major role here too.
I wouldn’t also go that far stating that they are ‘badly engineered’, @wolph42 . I can’t say they aren’t, but hey: look at their antenna interface - there is mostly ONLY single capacitor! Now look at any properly designed antenna interface inside some branded AP or WiFi router. With its output power (relatively high, as for WiFi) and ONLY a capacitor as an antenna interface there might be some interferences, although I’ve never met any trouble.

well, as said, they don’t get hot, they get warm, but warm enough to be of influence

after reading A LOT about them, this is what I came across, so not my words. Point is that they have a HUGE range, so you could argue that they’re greatly engineered, but as they’re mainly used for IoT, which usually is ‘short’ range: 10-50m, 350m range is a bit much.

Certainly I’m not in a position to argue, but as long as they are allowed to sell all over the world, I must assume the chip is properly designed. This doesn’t necessarily count for modules using ESP - this is totally different world.

Can’t say anything about a range (in my case at most 100m - the most distant sensor) but I’m happy they have enough power to handle “difficult” places with weak wifi.

Wemos has a psu, so wil produce more heat than a standalone ESP8266