Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MR-Addict/esp32-async-webserver-api

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ESP32 Async Webserver With SSD1306

1. Libraries

You can find all of them in libraries folder.

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <ArduinoJson.h>

2. API

Endpoint Method Description
/api GET Get sensor status and name
/api PUT Set sensor name

3. Examples

Curl

# get status and name
curl esp32-ip-address/api

# update name
curl -X PUT esp32-ip-address/api -d "name=01"

Fetch

// get data
function handleClick() {
  fetch("http://esp32-ip-address/api")
    .then((res) => res.json())
    .then((res) => console.log(res));
}

// put data
function handleSubmit(event) {
  event.preventDefault();
  const data = new FormData();
  data.append("name":"01");

  fetch("http://esp32-ip-address/api", { method: "PUT", body: data })
    .then((res) => res.json())
    .then((res) => console.log(res));
}

4. Demo Video

demo.mp4

About

ESP32 Async Webserver API with SSD1306

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.