GithubHelp home page GithubHelp logo

esp_servers's Introduction

ESP Servers

General server libraries for Webserver and WebSocket.

Webserver library

The library will first look for arguments and return values with handlers defined in 'onarg'. Nex it will look for uri pages and transmit defined pages with handlers defined in 'on'. If a handler is not defined for an uri pages, the librafy will look in the SPIFFS for the file.

Uses the followng libraries for ESP8266:

ESP8266WebServer.h     included as part of ESP8266 hardware profile

Uses the followng libraries for ESP32:

ESP32WebServer.h       https://github.com/Pedroalbuquerque/ESP32WebServer

Include

#include <webserver.h>

Define object

WEBSERVER webserver

Methods

void begin();
void on(const char * page, onwebtype func);       //	func = [] () {};
void onarg(const char * topic, onargtype func);   //	func = [] (char * value) {};
void ifarg(const char * topic, onargtype func);   //  func = [] (char * value) {};
void send(int id, char * type, char * data);
void loop();

WebSocket server library.

Uses the followng libraries:

The websocket expects to receive a JSON string. Each key in the JSON array will generate an 'on' event.

ArduinoJson.h          https://github.com/bblanchon/ArduinoJson/blob/master/ArduinoJson.h
WebSocketsServer.h     https://github.com/brandenhall/Arduino-Websocket/

Include

#include <socserver.h>

Define object

SOCSERVER socserver(uint_8 port);

Methods

IPAddress ip(uint8_t num);
void begin();
void on(char * id, streamtype func);           //	func = [] (uint8_t num, char * data) {};
void broadcast(String data);
void send(uint8_t num, String data);
void loop();

esp_servers's People

Contributors

palsbo 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.