ESP8266 Programming Using Arduino IDE (Mac OSX and Windows)

ESP8266 Programming Using Arduino IDE (Mac OSX and Windows)


[Intro Music] CISCO: Hi, I’m Cisco with Acrobotic. And today we’re gonna be talking about how to get started with the ESP8266 development board. We’re gonna be using the Arduino IDE to write custom firmware that is gonna be downloaded onto the board and execute. The materials that we’re gonna need for this tutorial are the development board itself. It’s optional, but nice to have a solderless breadboard and just a Micro B USB cable. We’ve taken the ESP-12E module, mounted it on our development board, in order to make things even easier. We include a few additional components like a USB to Serial UART translator chip by Silicon Labs. And a few other, like a voltage regulator a few other components, so that you can just plug it into your computer use the Arduino IDE and just get started with developing software or firmware that would run on the ESP8266 itself. There are a few different options that you can use for developing firmware that would run on the ESP8266. And we’re gonna be using today the Arduino IDE, but I wanted to mention the two more popular ones are using AT commands. This is where you hook up the ESP8266 to a micro-controller typically. That micro-controller will send these AT commands via serial aserial UART interface. And again you can read a little bit more in the links included in the description. But then the ESP8266 device is just listening to AT commands, and you tell it using an AT sequence “Hey, connect to Wi-Fi” “this is my SSID, etc. etc.”. We are not gonna be using that we are going to write custom firmware that will get uploaded to the ESP8266 and the ESP8266 is just going to run that custom firmware. The other one that is really really popular is the Node MCU firmware. That’s a little bit similar to the AT commands. You can actually use it a few different ways, but for the most part you end up using the Lua programing language to have this sort of live interaction with the ESP8266 itself. You can read more about it again in the links included in the description, but in order to get started with the Arduino IDE, we’re gonna jump to the Arduino.cc website. And we are gonna go to the download section. And this is in case you don’t have the Arduino IDE already installed. For those of you who are not familiar, IDE stands for Integrated Development Environment. So we are gonna look for the latest version, which is at the day of this recording 1.6.7. I’m gonna be using a Mac, so I’m gonna click on the link for Mac OSX. And then, you know, I encourage you to contribute to the project, they are really, they are doing really great work. I’m just for now gonna click just download. And it should take a few, a couple of minutes to download depending on your internet connection. The second piece of software that we gonna need is actually the drivers for talking to the IEC that is on our development board that does the USB to Serial UART translation. And for that we’re gonna go to the link from silabs, Silicon Labs included in the description of this video, and for me again, I am running this on a Mac. I am running OSX so I’m gonna scroll down and I’m gonna download the VCP drivers for Mac OSX. Depending on your operating system, you’ll need to download the corresponding drivers. Once you’ve downloaded the VCP drivers from the Silicon Labs website go ahead and double click on the file. Then go to the mounted image and double click on the package file to go through the installation process. Go ahead and click ‘Continue’. If you want to read the software license agreement, once you agree with it, then click ‘Agree’, if you agree. And then just click on the ‘Install’. It’ll ask you to enter your password as you are going through the process. This is again just installing the drivers that you’ll need in order to communicate with the development board. And it takes a few seconds to install. At the same time we can go through the process of installing the Arduino Development Environment. So I’m gonna go back to my downloads which is where I downloaded the file. I’m gonna go ahead and unzip it. And that process should take a little bit. Once the application is unzipped, go ahead and drag it to your Applications folder. I had a previous installation. I’m just gonna go ahead and replace that one. Once the VCP drivers are installed, you are pretty much ready to go. You can go ahead and open the Arduino IDE. Then we want to go through the file menu for Windows users and through the Preferences menu for Mac users. There’s gonna be an ‘Additional Boards Manager URL’s’ entry. Go ahead and enter the URL included in the description of this video. And if you already have URLs in there then just go ahead and add a comma and a space, before adding the one for the ESP8266 family of boards. You click OK. The reason we did that is in order to have the board recognized automatically by the IDE without installing anything additional. Then we can go through the ‘Tools’ menu. Go to Boards and ‘Boards Manager’ We wanna search for ESP8266. Click on the entry and click on ‘Install’. It’ll download a few things and install a few others, so it’ll take some time. Once that’s completed we want to close down the Arduino App, or the Arduino IDE App and restart it. Once all of this is done, you can go ahead and connect your development board, your ESP8266 development board to the USB port of your computer. From the ‘Tools’ menu, we are going to select Board and the Node MCU 1.0 entry. And for the port we’re going to select, for Mac, it looks like the one I’m showing on screen is forward slash dev, forward slash cu dot SLAB for Silicon Labs USB to UART. On Windows it would be COM and a number. So you just go ahead and select the entry and then finally we can go through the file menu. Examples, Basics, and we’re gonna open the program ‘Blink’. Then we’re gonna make a few modifications so that it works with the ESP8266 board. Instead of the number 13 for the pin that we’re going to be using, we’re gonna be changing it to pin number 16. Then we can go ahead and click the ‘Upload’ button. And your board should start blinking, once the program is uploaded to the ESP8266. So that’s it. You are ready to get started writing your own firmware to the ESP8266. Thank you for watching.

100 thoughts on “ESP8266 Programming Using Arduino IDE (Mac OSX and Windows)”

  1. Thank you for the video.  However, I cannot upload my sketch.  I receive the following error:warning: espcomm_sync failed
    error: espcomm_open failedI followed the instructions very carefully.  Any ideas?

  2. Im using the esp12e devkit v2. My Mac running Sierra says that the driver is installed. however it doesnt show up in arduino or the terminal screen. ls /dev/tty.* only /dev/cu.Bluetooth-Incoming-Port

  3. Hello, Cisco. First of all I want to say thanks for all the things that you post on this amazing channel, it's such a great knowledge repository.
    My question is:
    Is it possible to store data from, for example, a variable obtained by a textbox in html inside the flash memory of the ESP8266?
    Thanks in advance for your answer, and for everything that you've done for the ESP8266 community.

  4. Great tutorials.
    I'm trying to monitor temperature of hot water and have the esp8266 send me a message if the temp gets below a certain setpoint. can you steer me in the right direction?

  5. hey I'm pretty new to this and I wanted to know if you could help me out, when I try to compile onto my board it gives me this error:

    Arduino: 1.8.1 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"

    Sketch uses 198824 bytes (19%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 33034 bytes (40%) of dynamic memory, leaving 48886 bytes for local variables. Maximum is 81920 bytes.
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_open failed

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    I think I need it in bootload mode or something, like when you plugged your in the LED turned red while my LED blinks blue when plugged into power please help ASAP!

  6. Great video for making an ESP8266 blink. But no help for WiFi or anything beyond installing the IDE and getting blink to run.

  7. Savio Maschio Furtado

    Thank u sir.
    i had a problem=
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    i am using Node mcu esp 8266 12 e amica, and i followed this link to help me out with the problem (https://roboindia.com/tutorials/direct.php?route=nodemcu-amica-esp8266-board-installation) . I using windows 10,arduino 1.6.9,

  8. I installed the driver but i cant program the esp and in the divice manager the esp is an undetected divice. Can anybody help me pls?

  9. hello thanks for this vedio it was amazing!but can you please help i want to control 3 servo motors what i will add to the code ?

  10. Роман Бяков

    https://github.com/esp8266/Arduino/releases/download/2.1.0/package_esp8266com_index.json update url pls

  11. hi Mom I'm a bit new to this so I was just wondering if you could send me the link of your video cuz I think you really explain things very good because I would like connect my ESP8266 to my Amazon Echo

  12. Hi, great video, thanks for all the hard work. I followed the instruction and I have the Acrobatic esp8266 12-e but I can't see the USB port listed. I only see the bluetooth port. Is there any way I could fix this?

  13. my nodemcu specifically stated that i should download the cp2102 driver. i did so but it still doesn't recognize on my mac. i tried downloading different types of drivers too but none of them work.

  14. when I go to Boards Manager, I get the the following error

    Error downloading http://downloads.arduino.cc/packages/package_index.json

    Anyone help please, I am not able to fix this!

  15. Hey can you help me? The USB Driver is installed and everything but no serial port comes up.
    I have a 10.10 Mac Osx Yosemite Mac Mini.
    Please help, I've wasted too much time on this. Thanks.

  16. I had a NodeMCU v2 Amica lying around for more than a year and i did not knew programming it using the Arduino IDE was so easy. Thanks for this quick start guide it helped me get started. checking out other videos as well.

  17. siddhesh bhalerao

    hello,

    i am new to use node mcu. i am trying to write interrupt handler to receive data through uart.
    when node mcu receives any data on uart it shud go in the interrupt handler.
    please help me out with this.

    thanks in advance.

  18. I have downloaded Arduino and configured it, it detects the ESP8266 board, but when I try and upload code the “PWR” RED LED does not turn on, can someone please help thanks.
    I have done everything in this tutorial and still does not work: https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon

  19. I want to learn all the arduino IDE keywords syntax with operation required for programming NodeMCU ESP8266 for example WiFiclient.connect, EEPROM.commit
    and etc, these are only examplesif you can i would request you to please help me with all such keywords with details

  20. I have a problem with the serial port, I downloaded the drivers but doesn't work… someone can help me please?

  21. Hey! I am using the adafruit huzzah on a macbook (pro 2016 with sierra, and connecting it through an adapter to usb c) and can't get to upload any code to it, I'm instead getting errors such as "error: espcomm_upload_mem failed" and "an error occurred while uploading the sketch". Can somebody help me please?? I've installed everything said in this video btw.

  22. Google is preventing from using this Arduino never buy android phones that have Google on board. It will ruin FB and cause a Marriage split!

  23. Hi, I recently bought on of these ESP 8266 boards, and I have done everything in the video, and downloaded many different drivers, every one in these suggestions and more. I have a mac, and when I plug the board in it gets power and transmits its wifi signal that I can connect to, and if I go to "About This Mac" I can see it in the USB section. Everything seems to be working, the only thing is when I use the Arduino IDE I can't find it in the "port" section under the tools bar. I have a bunch of different drivers, and did all the things regarding downloading the board and copying and pasting the link into the preferences. I only get in the port section the bluetooth incoming port and the bluetooth modem. It's ok if nobody can help, but I would really like to start using this board. Thanks!

  24. Not sure if you entertain this type request on your channel if you prefer requests of this type are not made then please disregard this post.

    In need of a detailed video walking, no crawling, through the steps for several items related to the NodeMCU ESP8266.

    How to see what is loaded in the memory of the device.

    How to erase the contents of the memory.

    How to load different firmware, for example, MicorPython then back again to ESP8266 original firmware.

    List the tools for best carry out the listed items above.

    Discuss NodeMCU memory amounts used and why. Have seen discussion on 1Meg and 4Meg but not sure how they are implemented.

    Lastly, if you can dumb it down I am a hobbyist and started my journey down using IOTs a few months back and need all the hand holding I can get.

  25. Im using a Mac with my ESP8266 it worked fine (the instructions)until i got to 7:45,port mine is not showing anything just Bluetooth-incoming-Port,not the /dev/cu.SLAB_USBtoUART is not there what went wrong?Thank You for help and showing this Video.

  26. Hey Cisco I wrote you down below telling you I didn't see the USBtoUART line but one of the texts down below showed me another site to download another driver for Mac Sierra and restart my Computer and it worked so different drivers for different folks!Thanks for the Video Lesson it worked!

  27. http://download.makeblock.com/mblock/CH34x_Install_V1.3.pkg If you are using a Mac and don't see the board /dev/cu.SLAB_USBtoUART in Tools under Port,just the Bluetooth you need this driver for Mac Sierra

  28. Gabriel Androczky

    The board manager link to put into the Arduino IDE preferences is correctly: http://arduino.esp8266.com/staging/package_esp8266com_index.json
    When copied off the Video Description, YouTube adds a lot of junk to it and it won't work that way.

  29. hey! Arduino: 1.8.6 Hourly Build 2018/01/03 03:33 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

    Archiving built core (caching) in: C:UsersadminAppDataLocalTemparduino_cache_924032corecore_esp8266_esp8266_nodemcuv2_CpuFrequency_80,FlashSize_4M1M,LwIPVariant_v2mss536,Debug_Disabled,DebugLevel_None____,FlashErase_none,UploadSpeed_115200_5f03886daecb6caa97d15be6e5b3cbfc.a
    Sketch uses 246315 bytes (23%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 32272 bytes (39%) of dynamic memory, leaving 49648 bytes for local variables. Maximum is 81920 bytes.
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    error: failed reading byte
    warning: espcomm_send_command: can't receive slip payload data
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    got that error? Could you help?

  30. Good morning I can not use the wifi of esp8266e 12 to do all the procedure but only appears the ip of the microcontroller does not monitor serial but does not appear the wifi network both by the computer and by the cell in visible to the network any tips there?

  31. yashasvi muzumdar

    Thanx for uploading…really very helpful video!
    but i am having an issue while uploading the sketch it's throwing an error " espcomm_sync failed espcomm_upload_mem failed" in spite of following all the mentioned steps. Please help me resolving this issue. Thanx in advance 🙂

  32. Hi Cisco.
    Thank you mate. Great series of videos around the ESP8266. I've learned a lot. Thank you again.

    I want to get simpler. How would I go about sending and consuming normal telnet commands? I'm talking old school, like using the telnet <someadress> <someport> from the dos prompt.

  33. How can I change the SSID and the password? Come on! Are you gonna use it with the default open wifi network in public? You will be hacked in a minute.

  34. witch url do i copy and past into the bords manager? if you can, could you please incude a screenshot of the url that i have to copy, that would be grearly apperisated

  35. Couldn't get the correct port on my mac to show up, however on windows i was successful. My issue now is Arduino IDE takes forever to upload the simplest programs including blink. Any suggestions?

  36. Thanks alot brother . I was having a nightmare finding a correct driver to connect nodemcu. Your solution worked like a charme.

  37. I would pull this video and redo it since so many people are having problems with the instructions. I too could not see the Board in the com port and spent 3 hours trying to figure out if it was a hardware issue or driver issue. In the end I gave up until I read the comments section and saw there was something missing

  38. I got this error:

    Arduino: 1.8.7 Hourly Build 2018/09/28 12:01 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

    Sketch uses 247876 bytes (23%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 28012 bytes (34%) of dynamic memory, leaving 53908 bytes for local variables. Maximum is 81920 bytes.
    warning: espcomm_sync failed
    An error occurred while uploading the sketch
    error: espcomm_open failed
    error: espcomm_upload_mem failed

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  39. Unfortunately it is not showing me the right port (/dev/cu.SLAB_USBtoUART). That can I do to change that?
    Thanks in advance!

  40. Hey, I got the ESP8266 ESP-12E from your Amazon affiliate and can't seem to be able to install the driver so that my computer recognizes it in Ports within the Arduino IDE. Im running High Sierra OSX, do you know of any updated drivers that work for sure? I have installed several drivers and still see no options under System info->Harware->USB or any ports in arduino besides bluetooth. I made sure to allow 3rd party applications from system preferences

  41. Thanks so much for your video. I was having comm problems for an hour or two with my setup (mac, the USB driver, Arduino IDE). Then watched your video and when I set to the correct NodeMCU 12E board, all was groovy. Also it looks (from comments below) like you are a helpful/knowledgeable guy so you have a new subscriber. Thanks again!

  42. Thank you, great article. I'm working with a new board (MakerFocus ESP8266 WiFi Development Board) and the code doesn't work. I do understand it's a different configuration. Is there another place I can find documentation for the board?

  43. Hi. Good video. How would I go about deploying the code I test on the programmer's board, on an ESP8266-01 ?

  44. For the people that have the espcomm_sync error, this is really easy to fix. You just have to put the board in flash mode, so you can actually upload the program. You just have to hold the flash button while powering up the board and you should be good to go. NodeMCU dev kits do this automatically, hence why not everyone has to do this.

  45. For some reason, I cannot find the esp8266 in the board manager. Do you have an idea why that could be the case and how to solve it?

  46. Thank you for the video!! But there is no such a serial port in my choices in the Arduino IDE..i did something wrong? I have downloaded and installed the files. any suggestions?

  47. I almost gave up on these things, but ACROBOTIC's video got me going again. I could never find the USB port (under TOOLS | PORT)… but one of his comments said (paraphrased), 'A lot of the USB cables are just power cables, not data cables. They don't have all the wires and won't work'. Sure enough!!!!! I am not sure how to tell the difference between data/power and just power, but it took me trying 6 cables until I found one. I have 3 on order and will be putting a dot of green paint on them.

Leave a Reply

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