Eclipse for Arduino and Node MCU project



Arduino IDE is open source tool to develop embedded system or IoT (Internet Of Things) based project. It is very easy to learn and develop. Any newbie having background of C/C++ language can start development using Arduino IDE. More ever installation and setup is quite simple as well. But when you are working on medium or large project with complex functionality having multiple classes, then you will need more sophisticated IDE like Eclipse or Intellij. In this blog, I am going to explain you setup of Eclipse IDE with Arduino for NodeMCU based project. NodeMCU is Open Source IoT platform and now days used in many IoT projects. It runs on ESP8266 WIFI SOC(System On Chip).

Eclipse Arduino IDE NodeMCU IoT


  • Download and Install Eclipse: Download the Eclipse Photon C++ IDE. Extract the zip file on your computer hard drive. Go to extracted folder and open the eclipse.exe file.
  • Install Sloeber: Eclipse photon has Eclipse C++ IDE for Arduino 3.0 pre-installed. We will be using the Sloeber plugin in our example. So, Go to Help->Eclipse Marketplace and search for the Sloeber plugin and select the plugin and click Install. If you receive security warning, click on "Install Anyway". After installation, Eclipse will show message to restart. Make sure you accept pop up message and restart the Eclipse.


  • Configure the ESP8266 hardware: In order to add ESP8266 hardware, go to Windows->Preferences->Arduino. Select the select New button from Private hardware path section at right hand side pane and select ESP8266 hardware folder in your system. 
    • NOTE:ESP8266 hardware path can be as below C:\Users<<Username>>\AppData\Local\Arduino15\packages\esp8266\hardware
  • Platform and Board Selection: Go to Windows->Preferences->Arduino->Platform and Board. Select esp8266 from the list and apply and close the window.

  • Create the project: Go to File->New->Other->Arduino(Create Arduino Sketch)

  •  While creating project select values as below,
    • Platform folder: ESP8266 hardware folder from drop down list
    • Board: NodeMCU 1.0 (ESP-12E Module)
    • Upload Protocol: Default
    • Port: COM port values.  
    • CPU Frequency: 80 Hhz
    • Debug Port: Serial
    • Debug Level: Select value from drop down list 
    • Flash Size: 4M (3M SPIFFS) 
    • IwIP variant: v2 Lower Memory
    • Upload Speed: 115200
NOTE: Port will only appear in drop down when you have connected the NodeMCU to your computer through USB cable. Also, Make sure to select 115200 speed. Incorrect speed may gives error during sketch upload.

  • Once project is created, there may be some error. In order to fix the error, Right click on project, go to Properties->C/C++ Go to General ->Preprocessor Include Paths, Macros etc.
    • Apply the CDT Cross GCC Built-in Compiler Settings and close the window. 
    • Clean and Build the project.
            

    • Testing the Setup: Refer the sample program from Arduino examples. In our example, we have Real Time Clock (RTC) module which will use the RTClib library. You need to download the RTClib library from Arduino manage library. In order to add this external library, Go to Window->Preferences-Arduino and add private library path. Edit the Private Library path and add external library.
    • Build the project. Project->Build Project or you can use navigation mentioned as below.


    • Once you upload the sketch then console will show below output.
    • Serial monitor output can be show as below, Go to Serial Monitor View->Click on + button and add the port. 
      • Select Port from drop down & Baud Rate: 115200


    No comments:

    Post a Comment

    SD Card and 74HC595

    In my previous blog, I explained usage of Shift register using  Node MCU and  shown how to extend the additional digital input and output...