Archives

ESP8266 NodeMCU Interface – DSB1820

Code

 

ESP8266 Mongoose-OS Module – WiFi

 

We can set AP or STA or AP+STA mode in ESP8266 with Mongoose OS platform

  • SSID – SSID may be any combination of string, number, float
  • Password – Password is case sensitive.

 

 



Scan all available networks

 

Code

 

 

 

 


Configure Access Point (Hotpots)

By default when flashing the firmware after ESP8266 WiFi configured as a AP mode in the WiFI AP SSID name of Mongoose_?????  here ????  is the chip id and password is Mongoose .

FAQ

  • How to Set ESP8266 as AP mode?
  • How to Set ESP8266 as Hotpots?

 

Steps to follow

  • Go to Device files  tab in web browser using mos tool . (IP address http://127.0.0.1:1992/#files )
  • Change the ap credential or set credential in conf0.json  file. (Refer Below Image)

Code Example

  • Enable AP Mode : "enable": true, .
  • Disable AP Mode : "enable": false, .
  • You can hide ESP8266 AP mode list using  "hidden": false,  (Not shown WiFi available list).

 

 


 

ESP8266 connect to WiFi Router

 

 

 

 

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 Arduino-core Tutorial – HTTP Post Data to Web Page

Note I was tested its code is working well , But dont have time to documentation, any further doubts please contact in whatsapp +91-8300026060 or mail to [email protected]


FAQ

if you have following Questions and most of the reaped and same meaning questions, then this below contents should help for you

  • How send data to web page using ESP8266?
  • ESP8266 send data to website?
  • Send ESP8266 Data to Your Webpage – no AT Commands
  • Arduino-Esp8266-Post-Data-to-Website
  • ESP8266: HTTP POST Requests
  • Posting and getting data from ESP on Apache WebServer
  • How to Send Data from Arduino to Webpage using WiFi?
  • How to send data to a server using ESP8266 with Arduino?

 


Required

  • ESP8266 Any Module (Used NodeMCU Dev Kit Version 1.0)
  • Arduino IDE with ESP8266 Platform
  • Web Sever (Shared, Lunux, Windows or Own Server like with any hosting provides : Amazon, GoDaddy, GlobeHost, BlueHost, HostingRaja and etc)
  • Cpanel Login Access and update index file contend

 

Cpanel index.php  code

 

 

ESP8266 Arduino-Core 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

 

 


 

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

0

Your Cart

%d bloggers like this: