arduino-c++

ESP8266 crashes after simple http request

狂风中的少年 提交于 2021-02-08 11:35:53
问题 I am working with the NodeMCU V3 module. Whenever I try to make an http request to my server, the module crashes. Here's the code: void setup() { WiFi.begin("wifi-name", "wifi-password"); while (WiFi.status() != WL_CONNECTED) { //Wait for the WiFI to connect } } void loop() { HTTPClient http; WiFiClient client; http.begin( client, "server-address" ); int httpCode = http.GET(); String payload = http.getString(); //Get the response payload Serial.println(httpCode); //Print HTTP return code

ESP8266 crashes after simple http request

主宰稳场 提交于 2021-02-08 11:35:07
问题 I am working with the NodeMCU V3 module. Whenever I try to make an http request to my server, the module crashes. Here's the code: void setup() { WiFi.begin("wifi-name", "wifi-password"); while (WiFi.status() != WL_CONNECTED) { //Wait for the WiFI to connect } } void loop() { HTTPClient http; WiFiClient client; http.begin( client, "server-address" ); int httpCode = http.GET(); String payload = http.getString(); //Get the response payload Serial.println(httpCode); //Print HTTP return code

How to `Serial.print()` “full” hexadecimal bytes?

橙三吉。 提交于 2020-12-26 06:32:16
问题 I am programming Arduino and I am trying to Serial.print() bytes in hexadecimal format "the my way" (keep reading for more information). That is, by using the following code byte byte1 = 0xA2; byte byte2 = 0x05; byte byte3 = 0x00; Serial.println(byte1, HEX); Serial.println(byte2, HEX); Serial.println(byte3, HEX); I get the following output in the Serial Monitor: A2 5 0 However I would like to output the following: A2 05 00 In words, I would like to print the "full" hexadecimal value including

How to upload multiple files to ftp in one session in Arduino C++

爱⌒轻易说出口 提交于 2019-12-23 04:21:29
问题 My code works well to upload first file in the loop to ftp. But it hangs once second file is going to be uploaded. I'm reading the SD card root folder using lib first I set the ftp connection using connectFTP() to establish also data transfer port. Next I'm calling the fileTransfer(); While loop function works well, until first file is transfered. Once second file meet If criteria if (fileTemp != fileName && fileTemp[0] == '1' && fileTemp[1] == '9') and send the client.print(F("STOR "));