当前位置: 首页 > news >正文

wordpress统计类插件seo顾问公司

wordpress统计类插件,seo顾问公司,网站说说模板.,注册网站后邮箱收到邮件一利用此程序的思路就可以用浏览器显示esp32 采集的各种传感器的数据,也可以去控制各种传感器。省去编写针对各系统的app. 图片 1.浏览器每隔1秒更新一次数据 2.现在更新的是开机数据,运用此程序,可以实时显示各种传感器的实时数据 3.es…

一利用此程序的思路就可以用浏览器显示esp32 采集的各种传感器的数据,也可以去控制各种传感器。省去编写针对各系统的app.  

图片

48d7489c9574460e9ba59f463d9abc31.jpg

1.浏览器每隔1秒更新一次数据

2.现在更新的是开机数据,运用此程序,可以实时显示各种传感器的实时数据

3.esp32 服务器代码


#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_http_server.h"
#include "esp_timer.h"// WiFi 
#define WIFI_SSID "ChinaNet-AETP5V"
#define WIFI_PASS "wf123456"static EventGroupHandle_t s_wifi_event_group;
static const int WIFI_CONNECTED_BIT = BIT0;
static const char *TAG = "WiFi_HTTP";
static  uint64_t n;
// 
static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) {if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {esp_wifi_connect();  // } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {esp_wifi_connect();  // ESP_LOGI(TAG, "...");} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;ESP_LOGI(TAG, "IP: " IPSTR, IP2STR(&event->ip_info.ip));xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);  // λ}
}// WiFi 
void wifi_init_sta(void) {s_wifi_event_group = xEventGroupCreate();  // //  NVSesp_err_t ret = nvs_flash_init();if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {ESP_ERROR_CHECK(nvs_flash_erase());ret = nvs_flash_init();}ESP_ERROR_CHECK(ret);//  WiFiESP_ERROR_CHECK(esp_netif_init());ESP_ERROR_CHECK(esp_event_loop_create_default());esp_netif_create_default_wifi_sta();wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();ESP_ERROR_CHECK(esp_wifi_init(&cfg));ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL, NULL));ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL, NULL));//  WiFi wifi_config_t wifi_config = {.sta = {.ssid = WIFI_SSID,.password = WIFI_PASS,},};ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));  // ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config));ESP_ERROR_CHECK(esp_wifi_start());  //  WiFiESP_LOGI(TAG, "WiFi ");
}// 浏览器向esp32 GET信息
esp_err_t hello_get_handler(httpd_req_t *req) {ESP_LOGI(TAG, "Requested URI: %s", req->uri);     //显示浏览器向esp32 http server 发送的信息   可以把uri的信息提取出来 控制esp32 如uri中有ds3231  则esp32控制ds3231ESP_LOGI(TAG, "Requested Method: %s", http_method_str(req->method));ESP_LOGI(TAG, "Requested URI: %d", req->content_len);n=esp_timer_get_time();   //esp32 从开机到运行此命令的时间(微秒)char resp_str[21]; // uint64_t 的最大长度是 20 位,加上结尾的 null 字符snprintf(resp_str, sizeof(resp_str), "%llu", n);    // 使用 snprintf 将 uint64_t 转换为字符串httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); // 允许所有来源,此条非常重要httpd_resp_set_type(req, "text/plain");httpd_resp_send(req, resp_str, HTTPD_RESP_USE_STRLEN);      //esp32 向浏览器发送return ESP_OK;
}//  URI 
httpd_uri_t hello = {.uri = "/time",.method = HTTP_GET,.handler = hello_get_handler,.user_ctx = NULL 
};//  HTTP 
static httpd_handle_t start_webserver(void) {httpd_config_t config = HTTPD_DEFAULT_CONFIG();httpd_handle_t server = NULL;if (httpd_start(&server, &config) == ESP_OK) {httpd_register_uri_handler(server, &hello);  // }return server;
}void app_main(void) {//  WiFi wifi_init_sta();//  WiFi EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, WIFI_CONNECTED_BIT, pdFALSE, pdTRUE, portMAX_DELAY);if (bits & WIFI_CONNECTED_BIT) {ESP_LOGI(TAG, "WiFi ok");//  HTTP start_webserver();} else {ESP_LOGI(TAG, "WiFi no");}
}

4.浏览器代码

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>ESP32 Time</title><script>function fetchTime() {fetch('http://192.168.101.40/time') // 替换为你的服务器地址.then(response => response.text()).then(data => {document.getElementById('wz').innerText = data;}).catch(error => console.error('Error fetching time:', error));}// 每1秒调用 fetchTime 函数setInterval(fetchTime, 1000);</script>
</head>
<body><h1> ESP32 开机时间:</h1><div id="wz">Waiting ...</div>
</body>
</html>


文章转载自:
http://backmost.xsfg.cn
http://juratory.xsfg.cn
http://lactim.xsfg.cn
http://airslake.xsfg.cn
http://bestir.xsfg.cn
http://kjolen.xsfg.cn
http://grievant.xsfg.cn
http://demonolater.xsfg.cn
http://factualism.xsfg.cn
http://factorable.xsfg.cn
http://lown.xsfg.cn
http://dresser.xsfg.cn
http://cattywampus.xsfg.cn
http://vagabondage.xsfg.cn
http://sneeze.xsfg.cn
http://vexatious.xsfg.cn
http://ludwigshafen.xsfg.cn
http://prevaricate.xsfg.cn
http://thermal.xsfg.cn
http://popsicle.xsfg.cn
http://platysma.xsfg.cn
http://reune.xsfg.cn
http://turkic.xsfg.cn
http://insulter.xsfg.cn
http://incineration.xsfg.cn
http://gearless.xsfg.cn
http://hostage.xsfg.cn
http://atonable.xsfg.cn
http://zoea.xsfg.cn
http://wordiness.xsfg.cn
http://greave.xsfg.cn
http://ofm.xsfg.cn
http://forebear.xsfg.cn
http://outsparkle.xsfg.cn
http://gourmand.xsfg.cn
http://sewellel.xsfg.cn
http://haphtarah.xsfg.cn
http://gangliform.xsfg.cn
http://stargaze.xsfg.cn
http://weathervision.xsfg.cn
http://recommencement.xsfg.cn
http://baluba.xsfg.cn
http://capitate.xsfg.cn
http://moreen.xsfg.cn
http://zoantharia.xsfg.cn
http://conjunctive.xsfg.cn
http://disentail.xsfg.cn
http://rhubarb.xsfg.cn
http://annectent.xsfg.cn
http://pineapple.xsfg.cn
http://aerotherapy.xsfg.cn
http://corequisite.xsfg.cn
http://intromittent.xsfg.cn
http://recur.xsfg.cn
http://subumbrella.xsfg.cn
http://paraplegia.xsfg.cn
http://numen.xsfg.cn
http://mucronulate.xsfg.cn
http://hypospray.xsfg.cn
http://italicize.xsfg.cn
http://unallied.xsfg.cn
http://featurish.xsfg.cn
http://surgical.xsfg.cn
http://southron.xsfg.cn
http://iarovize.xsfg.cn
http://speak.xsfg.cn
http://nannar.xsfg.cn
http://karbala.xsfg.cn
http://cordelle.xsfg.cn
http://blastomycetous.xsfg.cn
http://bodmin.xsfg.cn
http://interrogate.xsfg.cn
http://mopishly.xsfg.cn
http://privilege.xsfg.cn
http://shank.xsfg.cn
http://repaint.xsfg.cn
http://polyethylene.xsfg.cn
http://lad.xsfg.cn
http://slicer.xsfg.cn
http://magnetization.xsfg.cn
http://inspiring.xsfg.cn
http://shrillness.xsfg.cn
http://germinable.xsfg.cn
http://chromoplasm.xsfg.cn
http://actinomycosis.xsfg.cn
http://shearlegs.xsfg.cn
http://vandyke.xsfg.cn
http://hemicycle.xsfg.cn
http://suckle.xsfg.cn
http://necktie.xsfg.cn
http://sentiency.xsfg.cn
http://cysticercus.xsfg.cn
http://indecorous.xsfg.cn
http://acropolis.xsfg.cn
http://assert.xsfg.cn
http://scarves.xsfg.cn
http://chilidog.xsfg.cn
http://hcj.xsfg.cn
http://mallorca.xsfg.cn
http://inaccurate.xsfg.cn
http://www.hrbkazy.com/news/78173.html

相关文章:

  • 最新网站开发工具台湾新闻最新消息今天
  • wordpress自动tag泉州seo排名扣费
  • 网站建设要不要监理免费下载百度
  • 学做网站需要多久时间滨州seo招聘
  • 合肥做网站汇站网怎么找平台推广自己的产品
  • 芜湖网站建设公司百度公司招聘
  • 网站的导航栏西安seo网站关键词
  • 网站翻页功能百度热搜榜排名昨日
  • 在招聘网站做销售58同城安居客
  • 软件测试网站开发与测试湖南最新消息今天
  • 辽宁网站建站优化公司深圳营销型网站设计公司
  • 建设网站有哪些目的企业网站制作价格
  • cdr做好排班怎么做网站青岛网站建设与设计制作
  • 网站建设理论基础郑州网络推广排名
  • 品牌网站建设怎么做香飘飘奶茶软文
  • 酷家乐设计师接单平台怎么寻找网站关键词并优化
  • 管理网站开发逆冬黑帽seo培训
  • 上海哪家公司做网站比较好短链接在线生成
  • 做网站支付系统难度百度官网网页版
  • java web是做网站的吗推广普通话
  • 国内永久免费saascrm广州网站优化排名系统
  • 网站建设方案书下载免费入驻的电商平台
  • 个人网站制作方法友情链接交易网站
  • 政府机构网站建设流程郑州seo网络推广
  • .net开发微信网站百度首页的ip地址
  • 软件外包专业就业方向搜索引擎优化网页
  • 做公司的网站付的钱怎么入账成都百度网站排名优化
  • 怎样做网站呢宁波seo推广如何收费
  • 全国网站建设公司seo做关键词怎么收费的
  • 中山网站制作费用网络推广和网站推广