Skip to content

Commit 6e57f7b

Browse files
authored
Merge pull request #1981 from ladyada/main
fix esp32 wifi demos
2 parents b83dd25 + d960ec1 commit 6e57f7b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

ESP32_S2_WiFi_Tests/JSONdemo/JSONdemo.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ int status = WL_IDLE_STATUS;
3535
#define SERVER "cdn.syndication.twimg.com"
3636
#define PATH "/widgets/followbutton/info.json?screen_names=adafruit"
3737

38-
// Initialize the SSL client library
39-
// with the IP address and port of the server
40-
// that you want to connect to (port 443 is default for HTTPS):
41-
WiFiClientSecure client;
4238

4339
void setup() {
4440
//Initialize serial and wait for port to open:
45-
Serial.begin(9600);
41+
Serial.begin(115200);
4642

4743
#if defined(USE_OLED)
4844
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x32
@@ -85,12 +81,14 @@ void setup() {
8581
#endif
8682

8783
printWifiStatus();
88-
8984
}
9085

9186
uint32_t bytes = 0;
9287

9388
void loop() {
89+
WiFiClientSecure client;
90+
client.setInsecure(); // don't use a root cert
91+
9492
Serial.println("\nStarting connection to server...");
9593
#if defined(USE_OLED)
9694
display.clearDisplay(); display.setCursor(0,0);

ESP32_S2_WiFi_Tests/WiFiSSLClient/WiFiSSLClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ WiFiClientSecure client;
3232

3333
void setup() {
3434
//Initialize serial and wait for port to open:
35-
Serial.begin(9600);
35+
Serial.begin(115200);
3636
while (!Serial) {
3737
; // wait for serial port to connect. Needed for native USB port only
3838
}
@@ -51,6 +51,8 @@ void setup() {
5151
Serial.println("Connected to WiFi");
5252
printWifiStatus();
5353

54+
client.setInsecure(); // don't use a root cert
55+
5456
Serial.println("\nStarting connection to server...");
5557
// if you get a connection, report back via serial:
5658
if (client.connect(SERVER, 443)) {

ESP32_S2_WiFi_Tests/WiFiWebClient/WiFiWebClient.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ WiFiClient client;
3939

4040
void setup() {
4141
//Initialize serial and wait for port to open:
42-
Serial.begin(9600);
42+
Serial.begin(115200);
4343
while (!Serial) {
4444
; // wait for serial port to connect. Needed for native USB port only
4545
}
@@ -85,7 +85,9 @@ void loop() {
8585
client.stop();
8686

8787
// do nothing forevermore:
88-
while (true);
88+
while (true) {
89+
delay(100);
90+
}
8991
}
9092
}
9193

0 commit comments

Comments
 (0)