Archives

ESP8266 NodeMCU Interface – DSB1820

Code

 

ESP8266 NodeMCU Module – HTTP

 

 


ESP8266 NodeMCU HTTP Module functions

http.delete() Executes a HTTP DELETE request.
http.get() Executes a HTTP GET request.
http.post() Executes a HTTP POST request.
http.put() Executes a HTTP PUT request.
http.request() Execute a custom HTTP request for any HTTP method.

 

http.delete()

  • Executes a HTTP DELETE request. Note that concurrent requests are not supported.
  • Syntax : http.delete(url, headers, body, callback
  • Parameters
    • url The URL to fetch, including the http:// or https:// prefix
    • headers Optional additional headers to append, including \r\n; may be nil
    • body The body to post; must already be encoded in the appropriate format, but may be empty
    • callback The callback function to be invoked when the response has been received or an error occurred; it is invoked with the arguments status_code, body and headers. In case of an error status_code is set to -1.
  • Returns : nil

 

 


HTTP Get Example

  • Read your thing-speak text file from below code

Code

 


 

HTTP Post Example

Post Data to thinkspeak website

Code

 

Post Data to aruneworld Website

code

 

 

 


 

ESP8266 NodeMCU Module – GPIO

 

ESP8266 NodeMCU Devkit GPIO Pin Map

 

 

IO index ESP8266 pin IO index ESP8266 pin
0 [*] GPIO16 7 GPIO13
1 GPIO5 8 GPIO15
2 GPIO4 9 GPIO3
3 GPIO0 10 GPIO1
4 GPIO2 11 GPIO9
5 GPIO14 12 GPIO10
6 GPIO12

 

 


 ESP8266 NodeMCU Module GPIO Functions

gpio.mode() Initialize pin to GPIO mode, set the pin in/out direction, and optional internal weak pull-up.
gpio.read() Read digital GPIO pin value.
gpio.serout() Serialize output based on a sequence of delay-times in µs.
gpio.trig() Establish or clear a callback function to run on interrupt for a pin.
gpio.write() Set digital GPIO pin value.
gpio.pulse This covers a set of APIs that allow generation of pulse trains with accurate timing on
multiple pins.
gpio.pulse.build This builds the gpio.
gpio.pulse:start This starts the output operations.
gpio.pulse:getstate This returns the current state.
gpio.pulse:stop This stops the output operation at some future time.
gpio.pulse:cancel This stops the output operation immediately.
gpio.pulse:adjust This adds (or subtracts) time that will get used in the min / max delay case.
gpio.pulse:update This can change the contents of a particular step in the output program.

 

Note : [*] D0(GPIO16) can only be used as gpio read/write. No support for open-drain/interrupt/pwm/i2c/ow.


 

Pr-Request

 

GPIO pin set as input

  • if you have questions like How set GPIO pin as input in ESP8266? then refer the below contents

 

Required

  • ESP8266 Any module or NodeMCU Development Kit(Any Version)
  • ESPlorer
  • Wires (Optional)

Note : if your using ESP8266 module only you need to know basic connection diagram of ESP8266

 

Code

 

 


GPIO pin set as output

  • Set GPIO pin as output using gpio.mode()  function.
  • Example : gpio.mode(pin, gpio.INPUT)

 

Code

 

Result

 

 


GPIO pin status monitor

  • GPIO pin monitor status is very useful, because if you wanna monitor the pin status based on do the some process can easily.
  • Example : continuously monitor the gpio input button pin and based on button pin low/high level trun on/off the led.

 

Required

  • ESP8266 Any module or NodeMCU Development Kit(Any Version)
  • ESPlorer
  • Wires (Optional)

Note : if your using ESP8266 module only you need to know basic connection diagram of ESP8266.

 

Basic connection Diagram

Note : this below diagram for flash nodeMCU Firmware to ESP8266. We use the same circuit. But GPIO-0 Should be High or float Mode

 

Code

 

 


 

ESP8266 NodeMCU – Flash Firmware

For beginner to recommend use the NodeMCU Flasher.

 

FAQ

  • What is NodeMCU Flasher tool?
  • How Download the NodeMCU Flasher tool?
  • Which platform PC’s devices supports NodeMCU Flasher tool?
    • Windows
  • Can i update firmware using NodeMCU Flasher tool into any kind of ESP8266 Module
    • Yes you can do.
  • Why firmware not update in ESP8266?
    • Make sure you enabled GPIO-0 Should be Low
  • Which firmware is best to upload to ESP8266 (Float/integer)?
    • Always commanded to flash the  float type firmware because for float type calculation and also precision process works well with float firmware

 


NodeMCU Flasher Programmer

  • NodeMCU Flasher tool is flashing the NodeMCU Firmware to ESP8266 Easily.
  • This tool is developed by NodeMCU.

 

Flash Custom NodeMCU Firmware into ESP8266 using NodeMCU Flasher Tool

  • Build your custom firmware and upload using below steps

 

Required

  • ESP8266 (Any module)
  • USB to UART Programmer or Ardunio Uno Board
  • NodeMCU Flasher Progarmmer
  • Some wire(May require)
  • NodeMCU Firmware (.bin file)

 

Connection Diagram

 

ESP-07 with FDTI Programmer

 

ESP-01 Module with CP2102 FTDI Programmer

 

ESP-01 Module with Arduino Uno board as Programmer

ESP-07 Module with FDTI Programmer

 

ESP-12 Module with FDTI Programmer

NodeMCU Dev Kit

 

 

Follow Steps

  • Step 1 : Go-to  NodeMCU Flasher  Programmer tool folder and open ESP8266Flasher.exe

  • Step 2 : Click the Gear Icon Upload the NodeMCU Custom firmware into NodeMCU Flasher Tool in config tab (Note : Don’t set any offset memory address in config tab, Leave default value 0x00000)

 

Gear Icon

 

NodeMCU Custom Firmware

Uploaded file in path with green background, Set offset as 0x00000

 

  • Step 3 : Make sure correct COM pot of ESP8266 USB port detected.

For My case COM is 7 When i was use one ESP8266 Module, It May be Change when using Different ESP8266and Different USB PORTs

 

  • Step 4 : Click flash button to flash the  firmware into ESP8266

 

  • Step 5 : Wait a moment when finish the firmware flash (Green Tick will can see, if the process success)

 

Green Right tick Symbol

 


NodeMCU Flasher Programmer Note :

  • Tips: You could use some special path to do something interesting.
    • The blank.bin file:  INTERNAL://BLANK
    • The esp_init_data_default.bin file(for 26MHz crystal):  INTERNAL://DEFAULT

 


NodeMCU Flasher Programmer Troubleshoot Guide

  • When the path have some error(e.g. file not exist), the line will become red. (Green shows when correct path file present )

  • What is the meaning of Red symbol when flashe fineshed

This red mark only present when the flash not finished. Check the correct COM port and make sure GPIO-0 Should be Low mode

 

 

 


 

 

ESP8266 NodeMCU – Build Firmware


Introduction

What is firmware?

  • Firmware is a piece of code for small type of device. The firmware contains binaries, that can do all the works and process.

If you have a questions like following, you can learn all of this questions solutions here.

  1. What is NodeMCU Firmware?
  2. What is the format of NodeMCU Firmware?
  3. What contains the NodeMCU Fimware?
  4. Build Firmware
    1. How to build the NodeMCU Firmware for ESP8266?
    2. How to compile the NodeMCU Firmware for ESP8266?
    3. How to build the NodeMCU firmware from source?
    4. How Build NodeMCU firmware for ESP8266 in Linux Machine?
    5. How Build NodeMCU firmware for ESP8266 using web based Cloud?
    6. how to build NodeMCU firmware on your own?
  5. What are the ESP8266 modules are support this NodeMCU Firmware?
  6. Which ESP8266 modules is best for NodeMCU Firmware?

NodeMCU Firmware

  • NodeMCU firmware is contains many lua modules.
  • Lua modules are contains many lua library files and calling functions.
  • You can select based on your requirement in custom firmware build page.

 


In Linux

 


Web based Cloud Build Custom NodeMCU Firmware

Beginner Recommended Method*

 

Step 1 :

Go-to this site https://nodemcu-build.com/

 

Step 2 :

Two times enter your e-mail address (You will get a status about building the firmware)

 

Step 3 :

Select branch to build from (Recommended choose master always)

Step 4 :

Select modules to include( More than 40+ NodeMCU Lua Modules are available, Select depends upon your application development)

 

Step 5 :

Miscellaneous options (Recommended for beginner : Don’t select any option )

 

Step 6 :

Click Start Your Build button

 

Step 7 :

Open your mail id (What you gave before)

Step 8:

you will get a email about firmware  building started and finished notification. In finished Notification mail you can download float  and integer  type NodeMCU .bin  firmware file.

 


 

 

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: