<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong?]]></title><description><![CDATA[<p dir="auto">Good day,</p>
<p dir="auto">The following example for a https request is not working for my M5Core2. I don't see what I am doing wrong.</p>
<p dir="auto">Has anybody a clue why the example is not working?</p>
<p dir="auto">Added:</p>
<ul>
<li>source and</li>
<li>Serial log. The last line printed is 'DEBUG 001' followed by 'DEBUG 002'.</li>
</ul>
<pre><code>#include &lt;WiFi.h&gt;

char ssid[]     = "&lt;SSID_var&gt;";
char password[] = "XXXXX";

char server[] = "www.google.com";
WiFiClient client;

int status = WL_IDLE_STATUS;

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  delay(1000);
}

void loop() {
  WiFi.begin(ssid, password);

  // Attempt to connect to Wifi network:
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    delay(1000);
    Serial.print(".");
  }

  Serial.println("Connected to wifi");
  printWifiStatus();
  Serial.println("\nStarting connection to server...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 443)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET /search?q=arduino HTTP/1.1");
    client.println("Host: www.google.com");
    client.println("Connection: close");
    client.println();
    Serial.println("DEBUG 001");
  }
  Serial.println("DEBUG 002");
  
  // if there are incoming bytes available
  // from the server, read them and print them:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();
  }
  // do nothing forevermore:
  while (true);
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI): ");
  Serial.print(rssi);
  Serial.println(" dBm");
}
</code></pre>
<p dir="auto">Serial log</p>
<pre><code>20:32:29.120 -&gt; .Attempting to connect to SSID: &lt;SSID_var&gt;
20:32:30.107 -&gt; .Connected to wifi
20:32:30.154 -&gt; SSID: Lumierestraat24
20:32:30.154 -&gt; IP Address: 192.168.50.220
20:32:30.154 -&gt; signal strength (RSSI): -50 dBm
20:32:30.154 -&gt; 
20:32:30.154 -&gt; Starting connection to server...
20:32:30.154 -&gt; connected to server
20:32:30.154 -&gt; DEBUG 001
20:32:30.154 -&gt; DEBUG 002
</code></pre>
]]></description><link>https://community.m5stack.com/topic/4591/on-m5core2-i-am-not-getting-a-working-https-request-wificlient-what-do-i-wrong</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 20:40:03 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4591.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Sep 2022 18:47:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong? on Wed, 28 Sep 2022 19:07:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mickey95" aria-label="Profile: mickey95">@<bdi>mickey95</bdi></a> dude?</p>
]]></description><link>https://community.m5stack.com/post/18758</link><guid isPermaLink="true">https://community.m5stack.com/post/18758</guid><dc:creator><![CDATA[Asmodev]]></dc:creator><pubDate>Wed, 28 Sep 2022 19:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong? on Tue, 27 Sep 2022 05:18:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mickey95" aria-label="Profile: mickey95">@<bdi>mickey95</bdi></a> said in <a href="/post/18550">On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thank you for the answer. This is working! Meanwhile my own example is working using an updated PEM certificate :-)</p>
</blockquote>
<p dir="auto">So It was the PEM certificate that was the cause?<br />
How did you discover that?</p>
]]></description><link>https://community.m5stack.com/post/18733</link><guid isPermaLink="true">https://community.m5stack.com/post/18733</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Tue, 27 Sep 2022 05:18:45 GMT</pubDate></item><item><title><![CDATA[Reply to On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong? on Mon, 26 Sep 2022 16:56:50 GMT]]></title><description><![CDATA[<p dir="auto">Can we see the code?</p>
]]></description><link>https://community.m5stack.com/post/18723</link><guid isPermaLink="true">https://community.m5stack.com/post/18723</guid><dc:creator><![CDATA[Asmodev]]></dc:creator><pubDate>Mon, 26 Sep 2022 16:56:50 GMT</pubDate></item><item><title><![CDATA[Reply to On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong? on Mon, 05 Sep 2022 19:47:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thank you for the answer. This is working! Meanwhile my own example is working using an updated PEM certificate :-)</p>
]]></description><link>https://community.m5stack.com/post/18550</link><guid isPermaLink="true">https://community.m5stack.com/post/18550</guid><dc:creator><![CDATA[Mickey95]]></dc:creator><pubDate>Mon, 05 Sep 2022 19:47:39 GMT</pubDate></item><item><title><![CDATA[Reply to On M5Core2 I am not getting a working https request (WiFiClient). What do I wrong? on Mon, 05 Sep 2022 19:22:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/mickey95" aria-label="Profile: Mickey95">@<bdi>Mickey95</bdi></a></p>
<p dir="auto">I don't think WiFiClient can handle HTTPS requests. I think you need to use <a href="https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" target="_blank" rel="noopener noreferrer nofollow ugc">WiFiClientSecure</a> for that.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/18549</link><guid isPermaLink="true">https://community.m5stack.com/post/18549</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 05 Sep 2022 19:22:32 GMT</pubDate></item></channel></rss>