Coder Social home page Coder Social logo

bmcage / esp8266-arduino-ide-web-server-using-sdk-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from internetofhomethings/esp8266-arduino-ide-web-server-using-sdk-api

0.0 2.0 0.0 15 KB

Supports SDK callbacks when data is received instead of polling for connections in the loop() function.

C++ 5.43% C 18.40% Arduino 76.17%

esp8266-arduino-ide-web-server-using-sdk-api's Introduction

ESP8266 Web Server Using SDK API

This project provides a Web Server Framework using either the Arduino Wifi Library or the EspressIf SDK API.

Setup:

  1. Copy the web_server folder to your Arduino sketch folder.
  2. Copy the UtilityFunctions folder to your Arduino libraries folder.
  3. Copy the webserver folder to your Arduino libraries folder.
  4. Change the following in the web_server sketch to match your network settings:

const char* ssid = "YOURWIFISSID"; const char* password = "YOURWIFIPASSWORD"; const IPAddress ipadd(192,168,0,132);
const IPAddress ipgat(192,168,0,1);

define SVRPORT 9701

5.0 Server Setting

5.1 To use the standard Arduino Web Server library, which polls for connections, use this define in the sketch:

define SVR_TYPE SVR_HTTP_LIB

5.2 To use the EspressIf SDK Web Server API, which uses event callbacks, use this define in the sketch:

define SVR_TYPE SVR_HTTP_SDK

Operation:

While not necessary, the code assumes an LED is connected to GPIO16. This LED is ON upon power-up and is turned OFF once initialization completes.

Web Server test:

Enter the following URL in a web browser (adjust IP & port to your settings):

http://192.168.0.132:9701/?request=GetSensors

A JSON string will be returned with the sensor values in this format:

{ "Ain0":"316.00", "Ain1":"326.00", "Ain2":"325.00", "Ain3":"314.00", "Ain4":"316.00", "Ain5":"163.00", "Ain6":"208.00", "Ain7":"333.00", "SYS_Heap":"25408", "SYS_Time":"26" }

The server will also respond to requests to turn the LED, if connected, on and off.

To turn on, enter the URL:

http://192.168.0.132:9701/?request=LedOn

To turn off, enter the URL:

http://192.168.0.132:9701/?request=LedOff

esp8266-arduino-ide-web-server-using-sdk-api's People

Contributors

internetofhomethings avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.