资料不多。多是国外网站的。

百度搜基本出来的是这个网站https://www.dfrobot.com/blog-922.html

出来的代码是:

#include <WiFi.h>
#include <FS.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
 
const char* ssid = "yourNetworkName";
const char* password =  "yourNetworkPassword";
 
AsyncWebServer server(80);
 
void setup(){
  Serial.begin(115200);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi..");
  }
 
  Serial.println(WiFi.localIP());
 
  server.on("/html", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(200, "text/html", "<p>This is HTML!</p>");
  });
 
  server.begin();
}
 
void loop(){
}

发愁:这个库在哪里?我怎么运行?于是我找到了这里:

https://github.com/me-no-dev/ESPAsyncWebServer

里面使用ESPAsyncWebServer的步骤

如下:

1   安装:PlatformIO IDE

这里有详细教材:https://blog.csdn.net/baimei4833953/article/details/78771611/

2 创建新的工程:"PlatformIO Home > New Project"

http://docs.platformio.org/en/latest/ide/vscode.html

3 修改配置文件

Add "ESP Async WebServer" to project using Project Configuration File platformio.ini and lib_deps option:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
# using the latest stable version
lib_deps = ESP Async WebServer
 
打開main.c
 
 
#include <WiFi.h>
#include <FS.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h> const char *ssid = "MyESP32AP";
const char *password = "testpassword"; AsyncWebServer server(80); void setup(){
Serial.begin(115200); WiFi.softAP(ssid, password); Serial.println();
Serial.print("IP address: ");
Serial.println(WiFi.softAPIP()); server.on("/hello", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, "text/plain", "Hello World");
}); server.begin();
} void loop(){}

编译运行下载,搞定。。。。

 

ESP32 做Web服务器 http Server步骤的更多相关文章

  1. Nginx是什么,有什么优点?为什么选择Nginx做web服务器软件?(经典经典)

    1.基础知识 代理服务器:    一般是指局域网内部的机器通过代理服务器发送请求到互联网上的服务器,代理服务器一般作用在客户端.应用比如:GoAgent,FQ神器.    一个完整的代理请求过程为:客 ...

  2. Nginx做web服务器反向代理

    实验目的 通过nginx实现反向代理的功能,类似apache反向代理和haproxy反向代理 工作中用nginx做反向代理和负载均衡的也越来越多了 有些公司从web服务器到反向代理,都使用nginx. ...

  3. 死磕nginx系列--nginx服务器做web服务器

    nginx 做静态服务器 HTML页面如下 <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  4. node - web 服务器 、server 服务器

    node 作为服务端 - 基本使用 1. web 服务器 web.html <!DOCTYPE html> <html> <head> <meta chars ...

  5. 什么是 Web 服务器(server)

    首先我们来了解什么是服务器(server) Web服务器一般指网站服务器,是指驻留于因特网上某种类型计算机的程序,可以向浏览器等Web客户端提供文档,[1]也可以放置网站文件,让全世界浏览:可以放置数 ...

  6. 树莓派做web服务器(nginx、Apache)

    一想到Linux Web服务器,我们首先想到的是: Apache + MySql + Php. Apache:是世界使用排名第一的Web服务器软件. 可以运行在几乎所有广泛使用的计算机平台上,由于其跨 ...

  7. 基于corosync+pacemaker+drbd+LNMP做web服务器的高可用集群

    实验系统:CentOS 6.6_x86_64 实验前提: 1)提前准备好编译环境,防火墙和selinux都关闭: 2)本配置共有两个测试节点,分别coro1和coro2,对应的IP地址分别为192.1 ...

  8. 利器: 用Siege做Web服务器压测

    用「Web压测」关键词检索,能找到好多进行压测的工具,比如ab.Http_load.Webbench.Siege这些,不过今天并不是要对这些工具做对比,毕竟我们只是想得到一个结果.本文主要介绍Sieg ...

  9. 解决Vue用Nginx做web服务器报错favicon.ico 404 (Not Found)的问题

    有多种解决方案 1.vue静态资源 vue中为网页增加favicon的最便捷的方式为使用link标签 <link rel="shortcut icon" type=" ...

随机推荐

  1. 【Linux】scp指令

    语法: scp [可选参数] file_source file_target 参数说明: -1: 强制scp命令使用协议ssh1 -2: 强制scp命令使用协议ssh2 -4: 强制scp命令只使用I ...

  2. css3实现小程序的动画

    <view class="biground" >     <block wx:for="{{Namelist}}" wx:key=" ...

  3. 安装python的第三方Pillow库

    方法/步骤 找到easy_install.exe工具.在windows下安装Python后,在其安装路径下的scripts文件中默认安装好了easy_install工具.完整路径如下例:D:\Pyth ...

  4. oracle控制文件问题

    下午时连接数据库突然发现连不上了,监听报错找不到服务,于是登录数据库所在服务器,查看监听状态,oracle:lsnrctl status 监听状态正常,登入数据库查看[oracle@frkdb1 ~] ...

  5. concat_ws 使用在hive spark-sql上的区别

    concat_ws() 在hive中,被连接对象必须为string或者array<string>,否则报错如下: hive> select concat_ws(',',unix_ti ...

  6. @EnableScheduling注解

    @EnableScheduling 开启对定时任务的支持       其中Scheduled注解中有以下几个参数: 1.cron是设置定时执行的表达式,如 0 0/5 * * * ?每隔五分钟执行一次 ...

  7. STM8L LCD配置与com使用问题

    void LCD_GPIO_Config(void) { //SEG GPIO Init GPIO_Init(GPIOE, GPIO_Pin_0|GPIO_Pin_1,GPIO_Mode_Out_PP ...

  8. L1-043 阅览室

    天梯图书阅览室请你编写一个简单的图书借阅统计程序.当读者借书时,管理员输入书号并按下S键,程序开始计时:当读者还书时,管理员输入书号并按下E键,程序结束计时.书号为不超过1000的正整数.当管理员将0 ...

  9. Java(原码、反码、补码和计算机存储格式)

    原码:将一个整数,转换成二进制,就是其原码.如单字节的5的原码为:0000 0101:-5的原码为1000 0101. 反码:正数的反码就是其原码:负数的反码是将原码中,除符号位以外,每一位取反.如单 ...

  10. sql注入-输入’or 1=1#

    比如:在用户名输入框中输入:’or 1=1#,密码随便输入,这时候的合成后的SQL查询语句为:     select * from users where username='' or 1=1#' a ...