Wish Add OTA update networking, that would be nice

Peter Simpson

Expert
Licensed User
Longtime User
I can update OTA over my WiFI but it's a bit of a pain, but it does work.
I create my B4R program as usual and then I include the OTA update code using Inline C in B4R with no issues whatsoever, once ran the OTA will start. The problem is (well, not really a problem) that when it comes OTA I have to use the Arduino IDE to update my code. I first have to update and run my code in B4R connected to a physical ESP8266 via a com port. Once I have updated my code in B4R I then have go into the Arduino IDE and open the src.ino in the src folder under the B4R project and run that src.ino. It does work but it's very long winded and cumbersome.

Basically my wish would be that it would be nice to have the option to update OTA directly from B4R, the problem is that B4R does not see the network ports in the port settings. Please look at the screens below.

Just a suggestion, thank you.

In B4A there's no B4A OTA netwark ports available
NoOTA.jpg


In Arduino IDE I can use B4A network ports
ota.jpg


BTW, in the image above it should actually read 'b4a-ota' and not 'B4A OTA', that is a typo as I didn't retake the screen shots once I updated the code.

Enjoy...
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
How do you configure OTA in Arduino IDE?

Good morning @Erel, sorry for the typo's in the first post, they have been rectified now.

Directions:
  1. You need to make sure that you have 'bonjour printer service' installed and running, that's important.
  2. You need to have 'Python 2.7.x' installed (not Python 3.x as parts have been removed in 3.x), I'm using Python 2.7.13.
  3. When installing Python 2.7.x make sure that you select 'Add Python .exe to Path', I selected 'Entire feature installed.
  4. Start Arduino IDE, go to File > Examples > ArduinoOTA > and select BasicOTA (I use this file).
  5. There may also be a sketch under File > Examples > ESP8266mDNS > OTA-mDNS-SPIFFS (I don't use this file). There are other OTA examples on the internet that also work that I've tested but I do not use.
  6. Fill in your ssid and password details and then upload the sketch to an ESP8266 based Microcontroller board, I'll test with an ESP32 when I get the time to do so.
  7. Wait about 30 seconds to a minute for the OTA network port to appear in the Arduino IDE, you may need to restart the Arduino IDE but the OTA network port will appear sooner or later.
  8. You will also need to disable your computer firewall while doing the OTA updates or add ports 3927, 5353, 5354, 7679, 8266 and 61617 to your firewall exceptions list, I personally disable my firewall got 10 minutes while I update my IoT devices.
I add an OTA timer routine in my B4R projects specifically for updating OTA. The OTA update routine is in Inline C.

I was going to write a tutorial about how to do it all, but swapping to the Arduino IDE to use OTA updating to uploaded the B4R generated code to devices kind of defeats the object to me, so I didn't write the tutorial.

I will admit it though, I was really happy to learn that the src.ino under the B4R src folder runs perfect in the Arduino IDE, that's what makes this possible. Adjusting and recompiling in B4R (on a physical COM port connected via USB to an ESP8266) and then running the src.ino in Arduino IDE using OTA works perfect, but it's a bit of a pain to do. The Arduino IDE screen shot is using my second network, when connected to my main network the OTA network list is populated with 7 live OTA capable devices.
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
I was board watching TV as it's just reruns, so I decided to make a quick video @Cableguy.
  1. I start B4R and load a modified test MQTT file to upload into an NodeMCU. Once it says 'connected to broker' both the OTA and MQTT are up and running.
  2. I close B4R and then open the Arduino IDE.
  3. First I incorrectly load the blink program, once I realise what I did I then load the correct src.ino file from the B4R Objects\src folder.
  4. I make sure that the Arduino IDE is pointing to the correct wireless NodeMCU device with the Hostname of 'b4a-ota', the ip address is irrelevant.
  5. I wirelessly upload the B4R generated Arduino IDE sketch to the NodeMCU device via OTA to 'b4a-ota', I DID NOT USE COM3 even though it's clearly visible.
  6. Just for fun I opened B4R which connected to the COM3 port and you can clearly see in the B4R logs the OTA sketch upload progress.
  7. Once the Arduino sketch is uploaded, you can see in the B4R logs the NodeMCU device resetting and logging back into the web based MQTT broker.
  8. That's it, OTA wireless update completed.
So that's my test MQTT code with OTA inserted using Inline C, originally created and uploaded and then updated in B4R, using the code under the B4R Objects\src folder the NodeMCU device is updated wirelessly using OTA updating via the Arduino IDE, phew.

The programming process in video with no sound ;) Please change the video quality setting to 1080p.

I quickly got some spare ESP's together and used B4R to give them unique hostnames on my spare network, I then plugged them into a six way USB charger.
Untitled-2.png


Goodnight...
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Thanks for the detailed process description...
The video seems unavailable...
 

Laurent95

Active Member
Licensed User
Longtime User
Hello,
@ Peter
I know it's a very old thread but just to inform you, even i'm not connected on the forum i can watch your subcalled "private" video.
To be honest, i'm really not confident in the "gafam" and their security process šŸ˜‚
And indeed it seems on the "F", that the private or public videos have the same rules šŸ˜œ
Have a nice day
 
Top