arduino - 制作软接入点ESP8266并通过labview读取数据
问题描述
我使用 AT 命令并使用 ESP8266 (ESP - 12 - F)、Atmega32a 和 Codvision AVR 编程创建了一个软访问点。然后我用笔记本电脑连接到这个wifi热点,并在labview和ESP8266(ESP-12-F)之间正确连接。ESP 设备读取传感器的模拟量,Labview 接收数据并绘制直方图...... 这太棒了,但是采样率太低了,我每秒可以采样 100 个。增加 AVR 和 ESP 模块之间的波特率不会显着改变采样率。所以我想用 Arduino 做这个项目。我在软接入点中设置了 ESP,我用 Labview 连接到模块,但我无法在它们之间读/写数据。我的代码在这里,我的问题是什么命令可以从 ESP 向 Labview 发送/接收数据。data 是一个 4 位数字(ADC 数量)。我从Arduino网站上阅读了Soft AP中WiFi库的官方文档,但是没有明确的命令在这种模式下发送和接收数据。谁能帮助完成这个项目?我尝试在它们之间达到 2 Mb 的速度。
#include<ESP8266WiFi.h>
#include<WiFiClient.h>
#include<ESP8266WebServer.h>
/* Set these to your desired credentials. */
const char *ssid = "ESPap";
const char *password = "thereisnospoon";
ESP8266WebServer server(8080); // PORT DETERMINE
/* Just a little test message. Go to http://192.168.4.1 in a web browser
connected to this access point to see it.
*/
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
//server.on("/", handleRoot);
server.on("/other", [](){
server.send(200, "text/plain", "Other URL");
});
server.begin();
Serial.println("HTTP server started");
}
void loop() {
server.handleClient();
}
解决方案
推荐阅读
- swiftui - SwiftUI 从 URL 和构建列表中解析多层 JSON 数据
- python - 跳过地图中函数的迭代
- python - 我需要如何更改路径以使用来自 url 的多个 id 而不是作为参数?
- python - 如何计算几个txt文件中关键字(在csv文件中)的频率
- node.js - 从git将应用程序部署到heroku node js时出错
- wordpress - 如果 SKU 不存在则更改帖子状态 [WP All Import + Woocommerce]
- scalapb - 从线程池运行 scalapbc 命令
- javascript - 如何在 chrome 扩展中的 background.js 和 web_accessible_resource 之间进行通信
- python - 随着迭代的进行,Python 迭代脚本会变慢
- javascript - 流类型 - 在未知类型的属性触摸中缺少声明预期键/值类型的索引签名