Arduino Tutorial: WeMOS D1 ESP8266 Over the Air (OTA) from!

Arduino Tutorial: WeMOS D1 ESP8266 Over the Air (OTA) from!

Dear friends welcome back! This is Nick from and today we are going to see how to use a very interesting feature of the ESP8266
based Wemos D1 board. We are going to load programs to the board wirelessly, using the
Over The Air feature it offers. Without any further delay, let’s get started! A few weeks ago, we took a first look at the very promising new board, the WeMos D1. You
can watch that video by clicking in the card here. The Wemos D1 is an ESP8266 based board
which resembles the Arduino Uno board but it offers a lot more. Huge processing power,
large memory and WiFi at a very low cost, less the 8$! You can find a link for the board
in the description of the video. Among the other features one thing caught
my eye recently! We can load programs to this board not only using the usb cable, but also
wirelessly! Check this out: I have loaded the standard blink program to the board. The
led turns on and off every second. I have now modified the Blink program to flash the
LED quicker, every 200ms. I am now going to press upload and load the new program to the
board wirelessly. The board is not attached to the computer, it is powered by this powerbank.
We wait for a few seconds and as you can see, the new program is loaded. The LED flashes
very fast! We managed to program the Wemos D1 board wirelessly! Cool, isn’t it? I think
this feature is very useful as well. But now let’s see how to achieve that.
First of all we have to download and install Python 2.7 in our computer. Next we load the
Arduino IDE. Please use the latest version of it. If you haven’t already set-up the
Wemos Board in your Arduino IDE, please watch my previous tutorial in order to see how to
do it. Next we load the BasicOTA program which is available Under File ->Examples ->ArduinoOTA.
We then update the SSID and password inside the program so the board can join our WiFi
network. Then we select our board and we upload the program to it using the Serial port and
the usb cable. After that, we open the Serial monitor, and we can see that the board is
connected to the WiFi network. Only if the module is connected to the network, after
a couple of seconds, the esp8266-ota port will show up in the Arduino IDE. If the port
does not show up, restart your Arduino IDE and it will appear. Now we can load any program
to the board wirelessly if we set the port to the OTA port. I load the Blink program
and I press upload. After a few seconds the program will be loaded to the board. That’s
it! But what if we want to upload a new program to the board. We can’t do it any more since
the BasicOTA program in not loaded anymore and the Arduino IDE can’t connect to the
board wirelessly. In order to update the program over and over again wirelessly, we have to
enter the commands from the BasicOTA program to our programs. So, I updated the blink program
and it now uses the OTA commands. If we upload the program again to Arduino, we can now update
it wirelessly as many times as we want, as the program will connect the WiFi network
at startup. That’s it! If you need to update your programs wirelessly from now on, just
add a few lines of code to it and you are ready. You can find the code of the project
in a link in the description of the video. As you can see with some simple step we can
enable the wireless update feature to our projects. Such functionality is extremely
useful in case of limited or no physical access to the board. I am going to use this feature
a lot in the feature. I can deploy a project to its final position and then update the
code and add new functionality to it without touching the project at all. It will be very
easy and practical. What do you think about this feature? Do you find it useful? Please
post any comments or ideas in the comments section below. Thank you!
If you are new to the channel you may not know that my day is job is developing Android
games and four months ago I published a new game on Google Play Store. It is called Quiz
of Knowledge and it is a quiz game that supports 5 languages and it is completely free. If
you like quiz games I am sure you are going to enjoy this one. If you wish you can download
it by clicking here or in a link in the description of the video. Thanks!
If this is your first time here, I would love to have you subscribed. In this channel I
post videos about DIY projects every Saturday. I love making things and I believe that anyone
can make things, anyone can become a maker. That’s why I created this channel, in order
to share my knowledge with the community and learn from the community. I hope you will
join us. Until next Saturday, Watch, Learn, Build! [ Translating these subtitles? Add your name here! ]

53 thoughts on “Arduino Tutorial: WeMOS D1 ESP8266 Over the Air (OTA) from!”

  1. we were searching a lot to upload program wirelessly,now we got it,thank you very much,please keep making informative videos like this,thank you once again!

  2. finally a very clear explaination of the few steps needed to use OTA with esp8266!
    do you think it's usable with standard esp8266, too? And with the wemos d1 mini?

  3. What will be power consumption of OTA feature within these boadrs? If it is too much, OTA will be useless in battery powered projects…

  4. unfortunately my arduinIDE1.6.8 doesn't show any network port, code was uploaded successfully, have you any idea what need to be fixed to make your example run?

  5. This is exactly what i was looking for, thank you so much.
    I just have a question i got the wemos D1r2 and the wemos D1 mini, is it possible to communicate both of them wirelessly ? I would like to have lets say 5 wemos mini reporting status of sensors to the wemos D1 as main controller it is possible? could you please guide me in this challenge.
    Thanks for your help

  6. Hi Nick : why do you request to install Python ? I've installed it, but when I try to upload the sketch, the 1.6.9 IDE answers errors and they begin with : Cannot run program "python.exe": CreateProcess error=2,
    should I declare the path to python somewhere ?
    I have tried this but it doesn't seem to help.
    thanks !

  7. Which version of python should I download brother? There are two versions here on the link or website you shared. 3.5.1 or 2.7.11??

  8. I am able to connect well etc. i even get the onboard led blinking. However when I use the external LED it doesnt work with your code. I get an error stating that "D10 was not declared in this scope." I am using exactly your code from the OTA Blink example download link you shared. All that I have changes is the passord and wife name which is for my network. Please help. I need to make a relay work remotely over the web to turn a camera and this is the most basic step I should be able to achieve. Even the ESP port shows up in ports. Ive come that far but an external led through a resistor would not work.

  9. Hello, I am using the Wemos D1 mini. I followed the steps you showed us and after uploading the OTA_LED sketch I opened the serial monitor and it showed it was connected to my network, so far so good, but when I loaded the blink sketch like you said and changed the port to the network port after compiling the upload just keeps saying uploading when I open the serial monitor it "type board password to access its console" I have tried all the passwords I can think of but in the Arduino IDE it says " wrong password". Any suggestions of what I am doing wrong.

  10. Hello, thank you it's working, but when i want to open serial monitor is asking for password, when i type correct password it is saing "the connection is not established: wrong password" what could be the problem here ? .

  11. Dear,

    I have a project of controlling multiple wifi enabled devices, or multiple motors, relay boards though wifi.

    In simple, can we control multiple relay board though one arduino wireless/or wifi ?
    awaiting for your suggestions.


  12. Hello I need to know what is the difference between WeMos CH340 WiFi D1 and D1 WeMOS ESP8266.
    I apologize for the mistakes I had Bohemia.

  13. pesta dike moy !
    δεν μας λες ομως πως γινεται η αναθεση στην πορτα μεσα απο το περιβαλον προγραμματισμου του arduino που λες οτι το εχει εξηγησει σε προηγουμενο βιντεο που εγω ομως δεν μπορω να το βρω , για να μπορεσω να δοκιμασω το ota .

  14. I want to use this board to open my garage door at certain times of day do you have project that you made like that thanks

  15. i am using WEMOS D1 board as client with Matlab server through TCP/IP but communication is very slow….. can we speed it up ?

  16. I've followed your directions exactly (several times). After uploading, this appears at the bottom:

    Archiving built core (caching) in: C:UsersmrleaAppDataLocalTemparduino_cache_520244corecore_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadSpeed_921600,FlashSize_4M3M_2ee084d81ae7235267cf4b9f721f3e15.a
    Sketch uses 243575 bytes (23%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 33132 bytes (40%) of dynamic memory, leaving 48788 bytes for local variables. Maximum is 81920 bytes.
    Uploading 247728 bytes from C:UsersmrleaAppDataLocalTemparduino_build_449970/BasicOTA.ino.bin to flash at 0x00000000
    …………………………………………………………………….. [ 33% ]
    …………………………………………………………………….. [ 66% ]
    …………………………………………………………………….. [ 99% ]
    .. [ 100% ]

    I then go to Serial Monitor but it is blank.
    Also, no other ports are showing up except COM4.


  17. I have the same board and setup but on Arduino IDE the Port is not highlighted but the board is blinking on using USB cable. How do I get the driver for the serial port to work with my D1 board?

  18. ..if anybody still have trouble uploading sketches to their WEMOS D1R1 or similar after CH341SER driver install & even with latest arduino ide with the ESP8266 PLATFORM downloaded connected to proper port in device manager Windows Xp or higher, with error message cxxabi_tweaks.h not present do this….copy cxxabi_tweaks.h from{ your drive]C:Documents and Settings{your pc name}Local SettingsApplication DataArduino15packagesesp8266toolsxtensa-lx106-elf-gcc1.20.0-26-gb404fb9-2xtensa-lx106-elfincludec++4.8.2xtensa-lx106-elfbits to C:Documents and Settings{your pc name}Local SettingsApplication DataArduino15packagesesp8266toolsxtensa-lx106-elf-gcc1.20.0-26-gb404fb9-2xtensa-lx106-elfincludec++4.8.2bits ….it took me a week to figure it out…finally the blink sketches worked…so i have a renewed my spirit for debugging my ambitious WEB RADIO project…hehehe

Leave a Reply

Your email address will not be published. Required fields are marked *