We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 C3
custom board with a ESP32 C3 MCU
no
latest master (checkout manually)
Arduino IDE 2.x
windows 11
40MHz
115200
WIFIclientsecure .connect() crashes
#include <WiFiClientSecure.h> // For secure HTTPS connection WiFiClientSecure client; String getFileSHA() { mySerial.println("test 0"); if (WiFi.status() != WL_CONNECTED) { mySerial.println("WIFI not available. skipping upload."); return ""; } mySerial.println("test 1"); String sha = ""; String url = "/repos/" + String(githubUser) + "/" + String(githubRepo) + "/contents/" + String(githubFilePath) + "?ref=" + String(githubBranch); mySerial.println("test 2"); // Make sure to trust the GitHub SSL certificate client.setInsecure(); // Bypasses SSL certificate verification mySerial.println("test 3"); // Connect to GitHub bool check = client.connect("api.github.com", 443); mySerial.println("test 4"); if ( check) { mySerial.println("Connected to GitHub"); // Send the GET request client.println("GET " + url + " HTTP/1.1"); client.println("Host: api.github.com"); client.print("Authorization: token "); client.println( String(githubToken) ); // Send the GitHub PAT for authorization client.println("User-Agent: ESP32"); client.println("Connection: close"); client.println(); // Wait for the response while (client.connected()) { String line = client.readStringUntil('\n'); if (line == "\r") { break; // End of headers } } // Read the response body String jsonResponse = client.readString(); mySerial.println("Received JSON response:"); // Print the JSON response for debugging mySerial.println(jsonResponse); // Parse the JSON response StaticJsonDocument<4000> doc; DeserializationError error = deserializeJson(doc, jsonResponse); if (error) { mySerial.print("Failed to parse JSON: "); mySerial.println(error.c_str()); return ""; } // Get the SHA of the file const char* sha = doc["sha"]; if (sha) { mySerial.print("SHA: "); mySerial.println(sha); return sha; } else { mySerial.println("SHA not found in the response."); return ""; } } else { mySerial.println("Connection to GitHub failed"); BlinkLED(LED_GREEN, 5); } return ""; }
get the file SHA Blob from GitHub if it exists .... 13:44:37.901 -> test 0 13:44:37.901 -> test 1 13:44:37.901 -> test 2 13:44:37.901 -> test 3 13:44:39.328 -> ESP-ROM:esp32c3-api1-20210207 13:44:39.328 -> Build:Feb 7 2021 13:44:39.328 -> rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT) 13:44:39.328 -> Saved PC:0x40048b82 13:44:39.328 -> SPIWP:0xee 13:44:39.328 -> mode:DIO, clock div:1 13:44:39.328 -> load:0x3fcd5820,len:0x1058 13:44:39.328 -> load:0x403cc710,len:0x8a8 13:44:39.328 -> load:0x403ce710,len:0x2fa0 13:44:39.328 -> entry 0x403cc710
on the first boot of the firmware and on subsequent reboots
The text was updated successfully, but these errors were encountered:
please add minimal example that we can compile and run. We do not have reports for C3 having issues thus far.
Sorry, something went wrong.
Cannot reproduce. Perhaps you are out of memory. https://wokwi.com/projects/409203958185858049
memory available just before calling .connect() is 207,696 bytes
In the meantime i've uploaded the full firmware code here: https://github.com/aeonSolutions/Aeonlabs-Arduino_Hardware_Test_Code/blob/38ee9f945085fd264f388c0cf088fd8bc083f9b0/github_api_test_upload/github_api_test_upload.ino
you can download and try it for yourself.
No branches or pull requests
Board
ESP32 C3
Device Description
custom board with a ESP32 C3 MCU
Hardware Configuration
no
Version
latest master (checkout manually)
IDE Name
Arduino IDE 2.x
Operating System
windows 11
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
115200
Description
WIFIclientsecure .connect() crashes
Sketch
Debug Message
Other Steps to Reproduce
on the first boot of the firmware and on subsequent reboots
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: