No video

#332

In this video, I would like to remind you of a handy ESP32 concept: Over the air or OTA update. A simple and efficient replacement of the Serial cable for devices which are not easily reachable, or for barebone ESP32 modules. And, as usual, I will add a few tricks and helpers.
In this video, we will:
- Learn how to use ESP32 OTA
- Create a basic sketch template for all our new projects
- I will show you some tricks like remote debugging
- If this simple OTA is not enough, I will show you other frameworks
- And, as usual, I included a “one last thing”
I am a proud Patreon of GreatScott!, Electroboom, Electronoobs, EEVblog, and others.
Links:
Sketches: github.com/Sen...
ESP32 Dev board: s.click.aliexp... and s.click.aliexp...
Standard ESP32 Dev board: amzn.to/2Axh24B
ESP32 barebone PCB: s.click.aliexp...
Telnetstream: github.com/jan...
WiFiManager for ESP32 (and ESP8266): github.com/tza...
IOTappstory.com: iotappstory.com/
The links above usually are affiliate links which support the channel (no additional cost for you).
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com...
My Patreon Page: / andreasspiess
Discord: / discord
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission (of your purchases the next 24 hours) to buy new stuff for the channel
My Amazon.com shop: www.amazon.com...
For Banggood bit.ly/2jAQEf4
For AliExpress: bit.ly/2B0yTLL
For Amazon.de: amzn.to/2r0ZCYI
For Amazon UK: amzn.to/2mxBaJf
For ebay.com: ebay.to/2DuYXBp
www.facebook.c...
/ spiessa
www.instructab...
Please do not try to Email me or invite me on LinkedIn. These communication channels are reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases

Пікірлер: 640

  • @georglinde3910
    @georglinde39104 жыл бұрын

    "It always sits in the in the first row!" - brilliant! :-D

  • @PranavSharma2504

    @PranavSharma2504

    4 жыл бұрын

    @@nutsandguts2871 Maybe 17 other people (including me) get impressed easily too, then. Edit: 31 now

  • @gerdkah6064

    @gerdkah6064

    4 жыл бұрын

    5:44 so OTA is also a subscriber ^v^

  • @systemofapwne

    @systemofapwne

    4 жыл бұрын

    Or you just sort your projects differently and use a better IDE (like MS Visual Studio Code + Platform.io) instead of the limited Arduino IDE. Yet, I like his videos for being "always straight and basic" (which unfortunately implies to also fallback to arduino IDE)

  • @WistrelChianti

    @WistrelChianti

    3 жыл бұрын

    @@PranavSharma2504 it was a great joke! (made me laugh anyhow =D)

  • @bowiejudah1617

    @bowiejudah1617

    3 жыл бұрын

    i guess Im asking randomly but does anyone know a trick to get back into an Instagram account..? I was stupid lost my password. I appreciate any tricks you can offer me!

  • @tonyp4894
    @tonyp48944 ай бұрын

    Andreas, I spent over a week trying to get OTA Basic from the Examples to work with my ESP32 Cam. Finally, I gave up and used your OTA template and it worked the first time and every time since. I can't thank you enough for taking the time to help me and those less fortunate in electronics knowledge. You're a HERO. :))

  • @AndreasSpiess

    @AndreasSpiess

    4 ай бұрын

    Glad I could help!

  • @pcost
    @pcost4 жыл бұрын

    Hello Andreas! I always wait anxiously for new videos from you, no matter the subject, I know that I will learn lots of things! Greetings from Canada! 🙌

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    During the last weeks you did not have to wait for too long ;-) It must be late in Canada...

  • @PranavSharma2504

    @PranavSharma2504

    4 жыл бұрын

    Same here! Of all the KZreadrs, @Andreas Spiess is my all-time favorite! A perfect mix of information, experimentation, and humor!

  • @MArifinDobson
    @MArifinDobson4 жыл бұрын

    I am proud to say that I am enrolling in an IoT program from ASIT (Andreas-Spiess-Institute-of-Technology). and "ASIT" in the first row. Love it, awesome as always~

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you think so! ASIT - I love it!

  • @MArifinDobson

    @MArifinDobson

    4 жыл бұрын

    @@AndreasSpiess Thank you prof :D

  • @VildanAkchurin
    @VildanAkchurin Жыл бұрын

    Copying and pasting from sketch example works right away! PuTTY debugging works as a charm. Thank you for the clear explanation and extended OTA debugging.

  • @AndreasSpiess

    @AndreasSpiess

    Жыл бұрын

    Glad it helped!

  • @listerdave1240
    @listerdave12404 жыл бұрын

    Thanks a lot for this tutorial. I had been wanting (and needing) to do OTA for a long time but always wrongly assumed it would be very difficult and had in fact tried a few times without success but after watching your video I got it working in a few minutes in one of my projects.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad I could help!

  • @AndrewDanne
    @AndrewDanne4 жыл бұрын

    This is so cool. 1. I am just starting to learn morse code. 2. I am just getting my head around ESZP32 and 8266. 3. I am working on a battery-powered automation controlled relay and am searching for information on very very low power devices (which you have previously covered). I really enjoy your ideas and how you go about explaining them. OTA will really help with all these projects.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    If you want to learn morse you have to have a look at my first videos. And if you are interested I have an updated version for the ESP32...

  • @krishnanov21
    @krishnanov214 жыл бұрын

    Just when I needed it! Thank you🙌

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Perfect!

  • @Marc_Miller

    @Marc_Miller

    4 жыл бұрын

    ​@@AndreasSpiess I'm having trouble finding your video shown at 6:19 talking about using the FTDI board to read the serial connection. Which video was that in?

  • @PeterAlbronda
    @PeterAlbronda4 жыл бұрын

    Again a wonderful presentation with much practical information in a short time. Each Sunday morning I am looking forward to your high value information, thank you!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are welcome! And thank you for your nice words.

  • @hygri
    @hygri4 жыл бұрын

    Cool. I'd certainly like to see your take on RTOS, I've been using parts of it in my sketches and it looks incredibly powerful... A video from the guy with the Swiss accent would probably help many of us to get off the ground. Thanks!!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Maybe in the future, as I said...

  • @hygri

    @hygri

    4 жыл бұрын

    @@AndreasSpiess Fingers crossed ;)

  • @DaddyBusAdventures
    @DaddyBusAdventures4 жыл бұрын

    Danka viel mohl Andreas. I've played around with OTA but the debugging trick I was not aware off. Time to do some testing on my RV project where I have 8266's deployed to handle various tasks in the RV.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I am not sure if everything works the same on the ESP8266. But you can try

  • @teddavis1840
    @teddavis18404 жыл бұрын

    Grüezi Andreas, thanks for the many hours you devote to your viewers. I appreciate your dry humour very much. I tried to find if you have created any videos on motors and actuators without success. Monitoring & control systems would seem a natural progression to your sensor projects - LoRa especially. Hopp Schwiiz!

  • @santopino2546
    @santopino25464 жыл бұрын

    Excellent, finally something that I will surely personally use. Thank you.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad it was helpful!

  • @leadeddeveloper9575
    @leadeddeveloper95754 жыл бұрын

    Thank you for your video, I like those ESP videos so much. Also, I'm planning to use ESP in my new project on my channel. It is a very exciting controller!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Go for it!

  • @isilverboy
    @isilverboy3 жыл бұрын

    I'm seeing and seeing again your videos. They are very useful and help me to speed up my projects. Thank you very much for your work here, really!

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    Glad you like them! And they help you in saving your valuable time.

  • @gaanpagla8417
    @gaanpagla84173 жыл бұрын

    Brilliant video. Now I don't have to find my data cable which has a tendency to disappear whenever I need it . Thanks so much !

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    And you even do not have to find your ESP as long as it has Wi-Fi connection ;-)

  • @WacKEDmaN
    @WacKEDmaN4 жыл бұрын

    funny that.. i was just setting up OTA on my ESP8266!... Great minds think alike!! :P nice info..as usual..Thanks Andreas :)

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    My pleasure!

  • @Retrocomputernerd

    @Retrocomputernerd

    4 жыл бұрын

    @@AndreasSpiess This is awesome, will the example sketch work with an ESP8266 though? The video indicated it would need someone to contribute a compatible version. I am still working through how to include the #include libraries

  • @WacKEDmaN

    @WacKEDmaN

    4 жыл бұрын

    @@Retrocomputernerd try this one i setup after watching.... i was using a version already in ESP_AsyncFSBrowser.. i just added esp8266s needed libs wrapped in #ifdef. the ArduinoOTA calls would complain during compile on esp8266 so i fixed them too.. github.com/WacKEDmaN/ESP32-OTA/blob/master/0TA_Template_Sketch/OTA.h

  • @stonecoldcnc

    @stonecoldcnc

    4 жыл бұрын

    @@WacKEDmaN Thanks for that, seems to work fine on the Wemos D1 board but not on the ESP-07, [ERROR]: Bad Answer: ERR: ERROR[4]: Not Enough Space

  • @WacKEDmaN

    @WacKEDmaN

    4 жыл бұрын

    @@stonecoldcnc make sure the partitions are set correct... im also guessing the low flash memory ESP (eg 512k/1Mb) chips wont be able to support OTA

  • @starlingwatch3921
    @starlingwatch3921 Жыл бұрын

    Greutzi Andreas, I'm back in Zürich 18 Aug to 21, part of my older son's wedding. I'm even planning to do the Limmat swim! I hope you are having a great holiday. Thanks for this video. I am writing a BLE-based logger for ESP32 devices and will post it to the Reflections repository on Github in the coming weeks. It will support multiple devices logging to what looks like local Serial, and a central logger will display the logs. It will also work over an Internet connection to a central log server. If you already have seen something like this please let me know, so I don't waste my time re-inventing the wheel. -Frank

  • @AndreasSpiess

    @AndreasSpiess

    Жыл бұрын

    There are loggers like github.com/jandrassy/TelnetStream (I even made a video about it, if I remember right). But all go via WiFi. I wish you a pleasant stay in Switzerland and hope the weather will be fine for the wedding! At the moment, we have quite a lot of rain (which is suitable for nature, of course).

  • @starlingwatch3921

    @starlingwatch3921

    Жыл бұрын

    @@AndreasSpiess merci!

  • @bombenlps7950
    @bombenlps79504 жыл бұрын

    Thank you so much, i was just thinking of a way to upload code onto a smart bulb in the future without having to resolder all the connections. But i didnt know about OTA, you are a life saver. Thank you!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad it helped!

  • @jeffbornes3986
    @jeffbornes39862 жыл бұрын

    I love the way that you did this... You made this so user friendly THANK YOU.

  • @AndreasSpiess

    @AndreasSpiess

    2 жыл бұрын

    You're welcome!

  • @borishruby7131
    @borishruby71314 жыл бұрын

    Hello Andreas! I really love your videos and can't wait for another one. I like the way you do it. I didn't know something like this is possible in ESP32 at all! By the way, it works also on ESP8266 as I've just found out. Thanks a lot and keep up the great work! Greetings from Slovakia!

  • @kallereunanen1575
    @kallereunanen15754 жыл бұрын

    This video was useful! Thanks a lot for a very dense set of excellent tips!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you can use it!

  • @tonysfun
    @tonysfun4 жыл бұрын

    Just in nick of time for me Andreas! Thanks for several tips that will make our lives easier! You are just a machine that keeps going and going further than the battery commercial!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I just have a schedule ;-) And you never know how long you live in my age...

  • @tonysfun

    @tonysfun

    4 жыл бұрын

    @@AndreasSpiess I agree! I'm not the youngest either, but I have plans too.... I just admire you and the amount of work you can do!!! Wishing you health - the rest can be purchased.

  • @Sean_Cockrell
    @Sean_Cockrell4 жыл бұрын

    Thanks for this video, will most defiantly be testing OTA and remote debugging on my next project.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Great!

  • @michaeldreher1372
    @michaeldreher13724 жыл бұрын

    You really nail it down in 10 minutes, that's great

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thank you!

  • @DanielLopez-kt1xt
    @DanielLopez-kt1xt4 жыл бұрын

    And just by the work of your magic, i can program my esp32 ota... thank you very much! Your videos couldn't be easier to understand. This capability is perfect for an mqtt smart house.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad it worked!

  • @santorcuato
    @santorcuato4 жыл бұрын

    Useful and necessary if you have sensors not on your workshop table but somewhere in the roof...

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Exactly!

  • @mattmanandeddie
    @mattmanandeddie4 жыл бұрын

    Oh Thank You! I never knew you could debug over WiFi, that will make things easier. I've done an OTA update before where I forgot to add OTA code block to new sketch. I did a Face Palm, back when you could touch your face. :) Can't wait to see more on the long range 2.4Ghz radio.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    If you refer to the satellite project I assume I will continue this or next week.

  • @toddpichler8578
    @toddpichler85784 жыл бұрын

    Hello Andreas, Thank you for another great example. I finally got it working but I struggled a bit because I decided to use VSCode and PlatformIO (one of your other awesome videos). The part that stumped me was the way PlatformIO automatically selects the upload connection. Normally that is a good thing but I wanted to test the OTA connection. It turns out I needed to add a line to the platform.ini file like this "upload_port = " where "" is the value printed to the serial monitor. Maybe that will help someone else. Thanks again!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    There were a few other comments about the same fact. So you are not the only ;-)

  • @peerappel2012
    @peerappel20124 жыл бұрын

    Thanks very much! More information about RTOS would be great imo. Also cant the otahandle function be called every once in a while by a timer interrupt? Especially as it doesnt take to much time anyways.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Try it, maybe it will work. I do would not like this structure.

  • @michaeldreher1372

    @michaeldreher1372

    4 жыл бұрын

    ​@@AndreasSpiess Use another thread, not an interrupt.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Another task did not work :-(

  • @michaeldreher1372

    @michaeldreher1372

    4 жыл бұрын

    ​@Andreas Spiess : I tried it and also and had some problems, but I was able to fix them: 1. I had to reduce the sleep time between the calls to 5ms (10ms is too long) 2. I had to increase the stack size to at least 1900 byte, (1800 byte is not enough) call this in setup(): TaskHandle_t xOTATaskHandle = NULL; xTaskCreate( vOTATaskCode, "OTA", 2048, NULL, 1, &xOTATaskHandle); define the task function and remove the 'ArduinoOTA.handle()' call from loop(): void vOTATaskCode( void * pvParameters ) { for(;;) { sleep(5); ArduinoOTA.handle(); } }

  • @WistrelChianti

    @WistrelChianti

    3 жыл бұрын

    @@michaeldreher1372 @Andreas Spiess I've managed to get this working slightly differently to Michael but had to change a few things. Mind if I send a pull request with the updates? (I'll have to do them in a tidy way first, currently code is full of debug prints)

  • @OldCurmudgeon3DP
    @OldCurmudgeon3DP4 жыл бұрын

    Very useful video, sir. I'm happy to see more code taking advantage of the ESP32. Dev boards are close enough to the 8266 in price that it's worth using the 32s even for simple projects. The extra uart is nice for Nextion screens. ITead just needs to rework their editor to be a little more user friendly.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    The ESP32 has many advantages. So there is no real benefit in investing into ESP8266.

  • @robertnickels1527
    @robertnickels15273 жыл бұрын

    Thank you for this great tutorial, subscribed immediately - although I suspect it's getting crowded in the first row! I have Telnet remote debugging working on the ESP-01, all that's needed is to add "#include TelnetStream" and add "TelnetStream.begin();" in Setup. And I've only been playing with ESP-01 for a few days ;-)

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    Welcome aboard of the channel!

  • @Thorathome
    @Thorathome3 жыл бұрын

    This tutorial got me quickly onto OTA for my ESP8266 & 32s, thanks. Your helpful piece of #include code makes OTA smooth for both 8266 and ESP32s. I especially like the RTOS ESP32 twist. It works. Onward to TelNet for debugging OTA and to see how this all works with Blynk, which I use all the time. Thanks, Andreas. Much appreciated.

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    You're welcome!

  • @Thorathome

    @Thorathome

    3 жыл бұрын

    @@AndreasSpiess This quickstart into OTA is fabulous. Your code made it easy to get my Blynk-enabled ESP32s and 8266s updating OTA with little/no problems. All very quickly, thank you. (Change the 7 to an 8 in OTA.h line 23, and it's PERFECT!) Good intro to TelNet and PuTTY as well. So simple with your guidance. Thank you once again. Most helpful.

  • @AJMansfield1
    @AJMansfield14 жыл бұрын

    Instead of putting `ArduinoOTA.handle()` in your main loop, you should be able to set up an independant timer interrupt and have it run from there, as extra insurance in case `loop` (or for that matter, the rest of `setup`) crashes or delays or gets stuck in some way. edit: Actually you do address this briefly with your comment about setting up an RTOS task, which is probably a "more proper" way to do it than a raw interrupt.

  • @paulrichard8912
    @paulrichard89124 жыл бұрын

    Always enjoy your tutorials and your github contributions. Thanks for the time and effort you put into these.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    My pleasure!

  • @ivanlogghe90
    @ivanlogghe903 жыл бұрын

    Very helpful tutorial! This opens so many "ports" ;-) for new projects !!

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    Thank you!

  • @drmocm
    @drmocm4 жыл бұрын

    Very interesting. I also have a trick for when you use a battery driven device that sleeps a lot, e.g. a sensor like the bme680. In that case loop is never reached and the device goes to sleep very fast. So, I use a loop in the setup that looks for the bme680 and in that loop I add the OTA handle. All I have to do is disconnect the sensor and the device keeps looping and I can connect via OTA. You could use a switch or button to disconnect the sensor.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Great tip! Thanks!

  • @massimomalesci352
    @massimomalesci3524 жыл бұрын

    Great video, Andreas, and very well explained!!!! Greetings from Italy! And I always sit in the first row!!!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thank you!

  • @ClementsProjects
    @ClementsProjects4 жыл бұрын

    Thanks Andreas for the explainations. I worked with this beast during the last weeks and you complete informations i needed. Thank you !

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad it helped!

  • @VladimirErmakov
    @VladimirErmakov4 жыл бұрын

    Actually there are two versions of OTA: 1. Arduino OTA, where initiator is Arduino IDE, so you should be in the same network; 2. HTTP OTA, where you have to code trigger, but then device downloads image from http server (may be served as a static file, but better to use something that adds checksum headers, like mine esp-ota-server). That method used by Tasmota and TasmoAdmin to update devices.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I did not cover webOTA, because, if you need that, it is better to use IOTappstoy.com.

  • @WistrelChianti

    @WistrelChianti

    4 жыл бұрын

    ah good to know this is there. I was wondering if there would be a way to dump an update somewhere online and have the board check/fetch from time to time. Will have a look. (although will maybe check Andreas' IOTappstory.com as an option)

  • @WistrelChianti

    @WistrelChianti

    4 жыл бұрын

    feels like stage 2 though. Stage 1 is definitely just "avoidance of USB" for initial development work (as I'm getting close to "burying" the board)

  • @mr.anonymous298
    @mr.anonymous2983 жыл бұрын

    I always learn something new or interesting from your great videos! Thank you very much.

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    Glad to hear that!

  • @VladimirErmakov
    @VladimirErmakov4 жыл бұрын

    Also small note about upload: image was uploaded to one of two partitions (free one), then if all ok and md5 match, bootloader would be told to switch to use that partition. So nothing to memmove. (i may be not accurate, digging into the code a few years ago to check what's wrong with http ota, and i don't know what is used for SPIFFS, because i only use it to store config.json).

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I think you are right.

  • @bobpaydar
    @bobpaydar4 жыл бұрын

    thanks for your all’s videos you provided to us, very helpful for me and thank again 👍🏻

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad to hear that!

  • @Zalo29
    @Zalo294 жыл бұрын

    Good tricks Andreas. Creating a mock-up sketch with OTA&credentials , so smart I've been using remoteDebug to get a serial port when deployed, but recently I've got some troubles with websockets. I'll try your telnet suggestion. Thank you so much! BTW, I encourage you to dig into FreeRTOS as it gives you a lot more possibilities to manage many tasks concurrently

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I also had problems with other remote debugging libraries together with OTA. This one worked.

  • 4 жыл бұрын

    This video already helped me at 2:50... i never thought there are different partitioning schemes on ESP32s, since i had only 4 option in that menu by using a Lolin32 option. I am writing thing with lots of libraries and i run out of space. I will try these, i think it will help already.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Available partitions depend on the board you select.

  • @DDBerlin
    @DDBerlin4 жыл бұрын

    Andreas, thanksfor the video. I'm sure you already know, but just for the records: OTA also works absolutelyflawless with ESP8266

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are right.

  • @kevinfine9303
    @kevinfine93034 жыл бұрын

    Hi Andreas, very useful video, as always. You've helped me a lot with my projects! I wanted to mention a correction to your description of OTA. It appears that the ESP32 maintains two areas of memory, OTA1 and OTA2. The Esspressif OTA mechanism always loads the new firmware in the unused portion, and, if successful, switches over the boot pointer to the new area of memory. Thus the previous firmware is not written over as implied in the video, and is available for a rollback. This from docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html Again, thanks for all your help, and also, Grüezi from Yverdon!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are right. Because it happens on the background I did not want to make it more complicated than necessary.

  • @graffygerry
    @graffygerry4 жыл бұрын

    You could use a timer interrupt to execute the OTA handler

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You can try it. I will not do it.

  • @andreaswinter1400
    @andreaswinter14004 жыл бұрын

    Great stuff, as always. But one little remark: Usually you don't put any executable code into .h files. In almost all cases they only contain types, macros, defines, and function prototypes. But I'm not so familiar with the Arduino IDE so maybe this is the only way to split code into several files.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I also do not know. I assume you can give it another name if you want ;-)

  • @JustinShaedo

    @JustinShaedo

    Жыл бұрын

    (a bit late but...) .h files are headers eg for storing constant variables. .cpp are used for declarations (functions, classes, etc) This is just convention and 99% of the time the compiler won't care what you use BUT might add well do it 'properly'.

  • @phinok.m.628
    @phinok.m.6282 ай бұрын

    I may be a little late to the party. But (5:39) well played... ;-)

  • @AndreasSpiess

    @AndreasSpiess

    2 ай бұрын

    Thank you!

  • @ZookeeperJohnG
    @ZookeeperJohnG5 ай бұрын

    Super helpful, thank you!🥸

  • @AndreasSpiess

    @AndreasSpiess

    5 ай бұрын

    You are welcome!

  • @raguaviva
    @raguaviva4 жыл бұрын

    I know it is Sunday when I see a new video From Andreas! So good!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    :-)

  • @PetRatty
    @PetRatty4 жыл бұрын

    yes setting up ArduinoOTA.handle(); on core 0 is pretty simple, you then need nothing in loop, same goes for the basic udp example, use netcat for the debugger as it doesn't disconnect like putty, minicom is another but haven't tried it

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I have tried it and it crashed. On both cores :-(

  • @Taran72
    @Taran724 жыл бұрын

    Wow! I had no idea it was possibile to update the Arduino this way. Thank you for getting us know.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    It is not for the Arduino, it is for the Esp32

  • @Taran72

    @Taran72

    4 жыл бұрын

    @@AndreasSpiess , ohhhhh...ok. got it as you can see I'm not familiar with the different processors. :) thank you for the clarification.

  • @HimalayanPathik
    @HimalayanPathik2 жыл бұрын

    Thank you so much for this awesome tute. I am now able to solve my year-old problem. Very accurate and informative tutorial. God bless you.

  • @AndreasSpiess

    @AndreasSpiess

    2 жыл бұрын

    Glad it helped!

  • @sergeykorzukhin2132
    @sergeykorzukhin21324 жыл бұрын

    So it is time for some refactoring in my projects :) Thank you Andreas!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are welcome!

  • @B4x4
    @B4x44 жыл бұрын

    Thank you for another great episode. Please make the RTOS episode.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    We will see...

  • @Jungmin_Seo
    @Jungmin_Seo4 жыл бұрын

    wow.. The code works flawlessly. Thanks!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You're welcome!

  • @harrytsang1501
    @harrytsang15013 жыл бұрын

    The use of delay() inside a task will cause busy waititng and makes your system less real-time. The task will not yield to lower priority tasks so vTaskDelay() is preferred over delay(). However, your time will delay in increments of 15 ms so you may want to also use millis() to make it tighter

  • @AndreasSpiess

    @AndreasSpiess

    2 жыл бұрын

    You are right. I read somewhere that delay() is replaced with vTaskDelay() by the compiler (which would make sense). All my tests with RTOS showed that the ESP32 is way too fast for all tasks I created and had to wait most of the time anyway.

  • @DerTou
    @DerTou4 жыл бұрын

    Thank you, I have learned a lot of useful things from your videos. Looking forward to more ESP32 content :)

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    More to come!

  • @katers5319
    @katers53194 жыл бұрын

    Just 2 suggestions for improvement: 1- incorporate the ArduinoOTA.setHostname() call into the setupOTA() function (which has then to be called with a hostname parameter), 2- append the lower 3 bytes of the MAC address to the OTA hostname. This will help identifying devices if you happen to have more than one device running the same sketch in your network.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Good ideas. Maybe you create a pull request?

  • @katers5319

    @katers5319

    4 жыл бұрын

    @@AndreasSpiess Here you go… :-)

  • @wjhoogervorst
    @wjhoogervorst4 жыл бұрын

    Thanks, just what I needed. With my ESP8266 I use ESP8266HTTPUpdateServer, but on my ESP32 I could not get the ESP32 version of this functionality working properly. Now I will switch to this way of OTA update, until I get the Webupdate working.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Good plan!

  • @SandeepSolankis
    @SandeepSolankis4 жыл бұрын

    Thanks for sharing. You resolve my broken microUSB problem. Appreciate it. One quick question - Why don't you make videos of development using ESP-IDF because i believe that building a production ready is more safer in esp-idf than arduino. Please comment.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Because only a few people use theeIDF and my channel would crash...

  • @electronic7979
    @electronic79794 жыл бұрын

    It was a video with useful information. I liked it

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad to hear that

  • @saeedkizzy
    @saeedkizzy4 жыл бұрын

    thanks for sharing.RTOS is a great tool in such systems.can't wait to see more about that :)

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Maybe...

  • @user-xp6ms4wq2v
    @user-xp6ms4wq2v4 жыл бұрын

    Thanks for tutorial! Also one note - better to disable all interrupts right in begining of on ArduinoOTA.onStart function. As I see on my sketch with Ticker library - OTA not likes if someone interrupts it while transmission ) So I called .detach commands in begining of OTA.onStart

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    If you do not attach interrupts it should not be a problem, I assume. But disabling them is for sure not wrong.

  • @JulioSalim
    @JulioSalim4 жыл бұрын

    Andreas, you are "The Man". Thanks!

  • @Thorathome
    @Thorathome4 жыл бұрын

    Thanks, Andreas. Just the two hints on creating your own sketch templates and #include "MY_WIFI_CREDENTIALS.h" made my day. Brilliant time-savers.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad it helped!

  • @necrodrucifver
    @necrodrucifver11 ай бұрын

    I am going to experiment setting the handler on the setup, expecting been able to upload code only when the bard is rebooted, thank you! Very nice videos, please consider a video to code read protection on esp32

  • @AndreasSpiess

    @AndreasSpiess

    11 ай бұрын

    As I like open source I have no need for code protection ;-)

  • @Joachim_S
    @Joachim_S4 жыл бұрын

    I got the ESP-32 ota running on VSC. Unlike the Arduino IDE the port has to be defined differently. In VNC you can see the ports under platformio, home (bottom left the little house), Devices and then the tab Multicast DNS. Or you can search e.g. in your router for the IP of ESP. To use them you have to change the platformio.ini. Enter the current IP address of the ESP here. Example: upload_port = 192.168.10.119 If you want to use usb again, just put a in front of the upload_port.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thanks for the explanation!

  • @jstro-hobbytech
    @jstro-hobbytech2 жыл бұрын

    This is a great video. Best explanation on how to do it. I know I'm a little late but credit where credit is due. I use the wemos d1 and have never had to reset after an ota update. My only complaint is that espressif should've released a more powerful board by now. They're the best other than a pi zero or whatever the new wifi mini pi is called. Anything pi related in Canada that isn't a Pico is at least 115 dollars where as an esp32 is about 20 now. More program memory and a faster cpu like the teensy has been doing for years but the teensy is 60cad.

  • @AndreasSpiess

    @AndreasSpiess

    2 жыл бұрын

    I most of the time use the ESP32 which is much stronger than the ESP8266 and not much more expensive...

  • @jstro-hobbytech

    @jstro-hobbytech

    2 жыл бұрын

    @@AndreasSpiess the chip shortage has affected esp32 modules. Where you used to get 5 for 30 dollars, 2 for 30 is the going rate while the 8266 is now 5 for 50. It's made me realize (which is somewhat contradictory to what I said previously) the 8266 can do alot of the same things I need without any appreciable notice in lag for some of the devices I make. They're nothing special, just iot devices that do simple things usually lighting related. Haha. I've been doing alot more circuit stuff recently, like learning more about passive component along with digital logic ics, respectively. I have more of a software background than hardware and I find that more interesting learning wise.

  • @patrickm9953
    @patrickm99533 жыл бұрын

    You made it very easy. Great tutorial

  • @AndreasSpiess

    @AndreasSpiess

    3 жыл бұрын

    Glad to hear that!

  • @PranavSharma2504
    @PranavSharma25044 жыл бұрын

    Hey The Guy With The Swiss Accent! It would be great to expand the template sketch to incorporate Access Point and Captive Portal for setting the credentials, instead of hardcoding them. Then they will survive network changes too! On the side, would you like to take a look at Rust for ESP32? It seems to be gaining some traction and aims to be a production-focused language.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    As I said: WiFiManager does that, if you need it

  • @PranavSharma2504

    @PranavSharma2504

    4 жыл бұрын

    @@AndreasSpiess ooh! I didn't notice wifimanager was already in place 😅

  • @alanesq1
    @alanesq14 жыл бұрын

    I have been very impressed using the OTA option to upload the bin file from a web browser rather than via the Arduino IDE. This is very handy if you have created a ESP project for someone else as you can send them the bin file and they can update it themselves. You can see how I use it here: github.com/alanesq/BasicWebserver

  • @Retrocomputernerd

    @Retrocomputernerd

    4 жыл бұрын

    this also looks like a very cools solution, however Arduino IDE is rejecting the library zip file, even after renaming the subfolder. Any advise, or a tutorial link?

  • @alanesq1

    @alanesq1

    4 жыл бұрын

    ​@@Retrocomputernerd Hi, You need to manually unzip the file and copy the files to your arduino library folder. BTW - I have just noticed I give the wrong password in the instructions, it should be 12345678 I have just uploaded a newer version of the sketch which asks for a password to access OTA (Not very secure but a lot better than nothing)

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    @alanesq: This is where IOTappstory began...

  • @EXMattix
    @EXMattix4 жыл бұрын

    Thanks for all of your videos, you are going to be my favorite youtuber about microcontroller. But I recommended that if you call another video for more details, you could link in a box that video in the video. Thanks anyways for the good stuff.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are welcome! Usually I place a card in the upper right corner if I mention another video.But maybe I forgot one or the other :-(

  • @EXMattix

    @EXMattix

    4 жыл бұрын

    @@AndreasSpiess yeah, maybe there is a issue with cards, but it's easy to find the video because of the numbering of your videos.

  • @jorgwende6314
    @jorgwende63144 жыл бұрын

    BTW - congrats to your 100th github project ....

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I did not know. Thanks for mentioning!

  • @meinsda5983
    @meinsda59834 жыл бұрын

    Great Work Andreas! What would we do without you ;)

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Just drink a Sunday beer in a sunny Beergarden ? ;-)

  • @meinsda5983

    @meinsda5983

    4 жыл бұрын

    @@AndreasSpiess Yes! I hope if you stay next time in vienna we have time together to do this and talking about technical news...

  • @dogastus
    @dogastus4 жыл бұрын

    Another excellent and useful video - thank you!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you enjoyed it!

  • @ronproveniers3655
    @ronproveniers36554 жыл бұрын

    Nice, i can use this for the solar weatherstation ( with bme280 and pms50003) which i develop now One Question: how can we OTA the esp32 when we use deepsleep? Yes, RTOS is also very interesting subject , special when to use or not to use? Maybe just use a scheduler?? Maybe you should explain about lockups and not putting watchdog triggers in a seperate task! Thanks for your good work Ron

  • @DO7DH

    @DO7DH

    4 жыл бұрын

    You could add a switch to manually switch off deepsleep mode, if you have access to the weather station. Otherwise configure 15 min. each day for flashing e.g. 12:00 to 12:15.

  • @ronproveniers3655

    @ronproveniers3655

    4 жыл бұрын

    DO7H, good suggestion. It makes the program a bit more complicated, need exact time and have no internet connection? The idea is that weatherunit hangs somewhere remote at a pole.

  • @erwinkooi6669
    @erwinkooi66694 жыл бұрын

    Hi Andreas, great video as always! Do you know if this is also possible with VS Code and platformio? I completely switched over from the Arduino ide (which is great for starters, but not so much when you have large and diverse projects.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I think it is possible, too

  • @MasseyLee

    @MasseyLee

    4 жыл бұрын

    @@AndreasSpiess Did you stop using PlatformIO and go back to Arduino IDE ?

  • @MennoLauwerens

    @MennoLauwerens

    4 жыл бұрын

    Yes, it also works from platformIO. I use it all the time.

  • @ulwur

    @ulwur

    4 жыл бұрын

    @@MennoLauwerens do you mind showing or explaining how you did the template stuff and how to do the wireless uploading?

  • @MennoLauwerens

    @MennoLauwerens

    4 жыл бұрын

    @@ulwur Just set these options in platformio.ini: board_build.partitions = min_spiffs.csv ; See:github.com/espressif/arduino-esp32/tree/master/tools/partitions ;upload_port = COM5 upload_protocol = espota upload_port = 192.168.0.35 ; IP of the ESP32 The rest is identical to this video.

  • @avieleliyahu6199
    @avieleliyahu61994 жыл бұрын

    Thank you, an educational and fun video as usual 😄

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you enjoyed it!

  • @Beatfreak19831
    @Beatfreak198314 жыл бұрын

    A great and useful video! Thanks Andreas!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    My pleasure!

  • @stupossibleify
    @stupossibleify4 жыл бұрын

    Thanks Andreas, your chosen topics are always interesting and very relevant. OTA is simpler than I thought. By the way, at the start of your videos are you saying "Greeting KZreadrs" or "Pretty KZreadrs"? Either is fine 😁

  • @nkronert

    @nkronert

    4 жыл бұрын

    He says "Grüezi KZreadrs", which is Swiss for "Hello KZreadrs" :-)

  • @stupossibleify

    @stupossibleify

    4 жыл бұрын

    @@nkronert thank you!

  • @WistrelChianti

    @WistrelChianti

    3 жыл бұрын

    haha I always wondered too :D now I know :D

  • @djayers
    @djayers4 жыл бұрын

    Very helpful, thanks Andreas.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are welcome.

  • @jamesgoacher1606
    @jamesgoacher16064 жыл бұрын

    Very interesting but above my familiararity ? level at the moment. Will need to get back to this when I have done more.

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    This seems to be a good plan!

  • @muriloteixeira4430
    @muriloteixeira44304 жыл бұрын

    Thanks Andreas for not only being succinct, organized and creating very useful content. You are also fun and your videos are pleasurable. Now in addition to being a channel subscriber, I’ll put a zero at the beginning of my youtube username lol

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Good practice if you want to be first!

  • @avejst
    @avejst4 жыл бұрын

    Great walkthrough 👍 Thanks for sharing 👍😀

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thanks for the visit

  • @justinmorrow2932
    @justinmorrow2932 Жыл бұрын

    Great instructional, worked fantastic. FYI mine still required "admin" as default password

  • @AndreasSpiess

    @AndreasSpiess

    Жыл бұрын

    Glad it helped!

  • @caiopedreira6643
    @caiopedreira66434 жыл бұрын

    Hello Professor Spiess: How about using MQTT, CoAP or even raw UDP instead of Telnet, so we can debug anywhere on the world? It would be nice to see a video of you comparing the performance and latency between TCP and UDP debugging to some broker or even a remote CoAP server. It will be great for those people who don't want to do port forwarding on their routers to access the Telnet server over the Internet. Congratulations for your great master classes! Best Regards!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    I am no network specialist. So somebody else has to do that :-(

  • @souzamce
    @souzamce4 жыл бұрын

    Always very good classes

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thank you! 😃

  • @JBoek30
    @JBoek304 жыл бұрын

    Wow vielen Dank ! nice Erweiterung/Erleichterung Klasse Zusammenstellung ! klappt auf anhieb : 7

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Sollte eigentlich ;-) Vielen Dank für's Feedback.

  • @miguelestrada2011
    @miguelestrada20114 жыл бұрын

    I would like you make a video of RTOS in esp32, I think that it would be an interesting video!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Maybe. Not decided yet...

  • @miguelestrada2011

    @miguelestrada2011

    4 жыл бұрын

    @@AndreasSpiess I think that a introductory video only talking about RTOS would achieve a better approach without touching strong esp32 topics, by the way, I have loved this video, thanks for your great work! Greetings from Mexico:)

  • @vivekchauhan7468
    @vivekchauhan74684 жыл бұрын

    As always great video...

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Thank you!

  • @temyraverdana6421
    @temyraverdana64214 жыл бұрын

    Mr. Andreas thanks, this video is amazing! Thanks!

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    You are welcome!

  • @eugenijusm
    @eugenijusm4 жыл бұрын

    There are many issues with this. It's ok if you are learning stuff or playing around. If you want a real device running 24/7 it's good idea to put OTA stuff into separate code flow (e.g. enabled only if jumper/button is active on power up). What this gives you is that you don't litter your main code with ArduinoOTA.handle() and some security (accidental overwrite and/or resistance to malware abusing devices like this).

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    If you need more functionality maybe you have a look at IOTappstory.com?

  • @chahilpatel2993
    @chahilpatel29934 жыл бұрын

    Perfect Timing 👌

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you think so!

  • @pascallongpre7797
    @pascallongpre77974 жыл бұрын

    Awesome content! Thanks a lot!

  • @McTroyd
    @McTroyd4 жыл бұрын

    And here I was, wondering if something like a watchdog timer could be used to call the OTA handler. You beat me to it; I forgot about the RTOS aspect of the ESP32. It seems natural to run that as its own periodic task. I'd be worried about copying the call throughout my code -- later wonder "What's this doing here?" and delete it, in the name of "optimizing." 😁

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    If you always use the same template to start with, the chance that you delete it is small ;-)

  • @McTroyd

    @McTroyd

    4 жыл бұрын

    @@AndreasSpiess But that requires too much thinking ahead!! I'm American, I'm not supposed to make sense. 😉

  • @sblantipodi
    @sblantipodi4 жыл бұрын

    Wonderful videos, as always

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    Glad you like them!

  • @JohnJCouture
    @JohnJCouture4 жыл бұрын

    Andreas, great job! Works like a charm. is there a way to SET the upload IP address? The IPAddress command doesn't seem to work. I suspect it has to do with the placement of the IPAddress command?

  • @AndreasSpiess

    @AndreasSpiess

    4 жыл бұрын

    The IP address is usually given by your network.