我正在使用 BasicHTTPClient 通过 GET 方法将数据从 esp32 cam board 发送到网络服务器 我已经在 google 上搜索了这个错误 可以解释一下这个错误并告诉我如何解决它
先感谢您!
对于在 ESP32 上运行的 C 程序中的计算,我必须按以下方式乘以和除以以下整数:
\n150 \xc3\x97 10000 \xc3\xb7 155 \xc3\xb7 138 \xc3\x97 100 \xc3\xb7 220 \xc3\x97 100对于浮点变量,它生成 3100.000000;对于 32 位无符号整数,它生成 3100。
我尝试使用以下代码在https://www.onlinegdb.com/上测试计算结果:
\nint main () {\n float calc = 150 * 10000 / 155 / 138 * 100 / 220 * 100 ;\n printf ( "calc = %f\\n", calc ) ; // 3100.000000\n\n uint32_t calc0 = 150 * 10000 / 155 / 138 * 100 / 220 * 100 ;\n printf ( "calc0 …Run Code Online (Sandbox Code Playgroud) 我对C/C++很陌生,通常我用C#编写代码,所以我有一个问题:
enum PrimitiveType {
BOOL,
STRING,
INT8,
INT16,
INT32,
UINT8,
UINT16,
UINT32,
};
struct MyValue
{
public:
String Id
PrimitiveType ValueType;
[???] Value;
};
Run Code Online (Sandbox Code Playgroud)
我想将ints,strings和bools 存储在该"Value"属性中.在C#,我将宣布Value为对象和把对象到一个int或bool像:
if(myValueObject.ValueType == BOOL)
auto value = (bool)myValueObject.ValueType;
Run Code Online (Sandbox Code Playgroud)
我可以在C++中使用哪种类型?
我对使用 Arduino 和任何类型的电路都很陌生。
我正在尝试使用以下命令设置 ESP32 板以使用外部触发器唤醒 esp_sleep_enable_ext0_wakeup
void setup(){
int MY_PIN = 13;
pinMode(MY_PIN, INPUT_PULLUP);
int reading = digitalRead(MY_PIN);
if(reading == 1) {
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,0);
}
else {
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);
}
// I want the board to wake up every time the state of the switch changes.
esp_deep_sleep_start();
}
Run Code Online (Sandbox Code Playgroud)
我遇到了这个问题。唤醒不会在我期望的时候发生。我认为这与使用外部上拉电阻有关。我没有连接一个。
有没有办法为此使用内部上拉电阻?
我将不胜感激任何可以解释这通常是如何工作的。
该文件说:
@note 此功能不会修改引脚配置。该引脚在 esp_sleep_start 中配置,紧接在进入睡眠模式之前。
也许我需要使用esp_sleep_pd_config. 这可能是上拉电阻不工作的原因吗?
我正在ESP32和路由器之间建立wifi连接。ESP32的结构包含所有wifi配置的详细信息,其中两个是SSID和密码。如果尝试使用变量,则无法设置这两个。
如果我使用#define定义了想要的字符串,它将起作用。...sta是保存配置参数的结构,sta与另一个结构合并为wifi_config_t的数据类型。...ssid和password的类型为uint8_t
//These work
#define ESP_SSID "AccessPoint"
#define ESP_PASS "Pass"
//These don't work
char ESP_SSID[32] = "AccessPoint" //32 since that's max SSID length
char ESP_PASS[64] = "Pass" //64 since that's max pass length
//...later in code...
wifi_config_t wifi_config = {
.sta = {
.ssid = ESP_SSID,
.password = ESP_PASS
},
};
//...definition of .sta ...
typedef struct {
uint8_t ssid[32];
uint8_t password[64];
...
} wifi_sta_config_t;
Run Code Online (Sandbox Code Playgroud)
但是我正在尝试使其能够在运行时更改SSID和Pass,这就是为什么要设置变量的原因。但是,如果我使用变量版本,则会导致以下错误:
warning: initialization makes integer from pointer without a cast [-Wint-conversion]
.ssid = ESP_SSID,
^ …Run Code Online (Sandbox Code Playgroud) 我正在使用 esp32 (slave) 和 rf24l01 模块做无线传感器节点。我的下一步是将我的奴隶置于睡眠模式(可能是深度睡眠)。我可以在我的项目中使用深度睡眠吗?
他们说
存储在该内存中的所有内容都被清除并且无法访问。
那么我所有的void setup()代码都被消灭了吗?或者只是我的pack0.temp,潮湿的土壤被消灭了?
我的代码附在下面
struct package0
{
float temperature = 0;
float humidity = 0;
int soil = 0;
};
typedef struct package0 Package0;
Package0 pack0;
/**********************************/
/**************RF24****************/
RF24 radio(25,26);
RF24Network network(radio);
const uint16_t this_node = 01;
const uint16_t master00 = 00;
const unsigned long interval = 3000;
/**********************************/
void setup() {
dht.begin();
radio.begin();
network.begin(90, this_node);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
}
void loop() {
// put your main code here, to run repeatedly: …Run Code Online (Sandbox Code Playgroud) 我正在通信连接到 Wifi 网络的两个 ESP32 板。一块 ESP32 板是服务器,另一块是客户端。我想测量客户端 ESP32 上的 ESP32 CPU 使用率。我不知道该怎么做,还没有在互联网上找到任何有用的资源。有人可以帮我弄这个吗?
这是服务器上的代码
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
const char* ssid = "XXXXX";
const char* password = "XXXX";
AsyncWebServer server(80);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid,password);
while (WiFi.status()!= WL_CONNECTED){
delay(200);
Serial.println("Connecting to Wifi...");
}
Serial.println("Connected to Wifi");
Serial.println(WiFi.localIP());
server.on("/test", HTTP_GET, [](AsyncWebServerRequest *request){
Serial.println("Request received from esp32client");
request->send(200, "text/plain", "Hello from ESP32Server to ESP32Client");
});
server.on("/test1", HTTP_GET, [](AsyncWebServerRequest *request){
Serial.println("Request received from PC-Client");
request->send(300, "text/plain", "Hello from ESP32Server to PC");
});
server.begin();
} …Run Code Online (Sandbox Code Playgroud) 我是 esp32 编程新手。我想尝试做一个服务器。
我尝试使用ESPAsyncWebServer 库。
我收到这个错误
Run Code Online (Sandbox Code Playgroud)In file included from C:\Users\User\Documents\Arduino\server\server.ino:2:0: Multiple libraries were found for "WiFi.h" sketch\ESPAsyncWebServer.h:33:22: fatal error: AsyncTCP.h: No such file or directory Used: C:\Users\User\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi compilation terminated. Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\libraries\WiFi exit status 1 Error compiling for board ESP32 Wrover Module.
有人可以帮助我并告诉我安装自由主义者的正确方法是什么,因为我感觉我做错了。
我正在尝试使用 esp32 IoT 开发框架。这对我来说有点复杂,尤其是 BLE 示例。我试图理解 gatts_service_table 示例,但它内部有大量代码,对于第一个 BLE 应用程序来说太难了。IDF 有简单的 Ble 示例吗?我知道 kolbans 图书馆,我也尝试过,但我的目标是 IDF。但要学习 IDF,我必须首先提高我的编程技能。
我想创建一个个人资料。里面加了服务之后,还有特色。创建 BLE 架构后,使用手机应用程序发送接收数据。
这是我的代码
#include <WiFi.h>
const char* ssid = "wifiname";
const char* password = "12345678";
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA); // SETS TO STATION MODE!
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(1000);
}
Serial.print("IP is ");
Serial.println(WiFi.localIP());
}
void loop() {
}
Run Code Online (Sandbox Code Playgroud)
我可以使用 WiFiscan 例程找到 iPhone 的个人热点,但无法连接到它。
esp32 ×10
arduino ×4
c ×3
c++ ×1
cpu-usage ×1
gcc ×1
getmethod ×1
httpclient ×1
int ×1
localhost ×1
pointers ×1
sleep-mode ×1
thread-sleep ×1
webserver ×1