latinet:unicaes:workshops:communication-23
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| latinet:unicaes:workshops:communication-23 [2024/09/10 20:34] – [3. Our first MQTT Publish] harley.lara | latinet:unicaes:workshops:communication-23 [2024/09/10 20:39] (current) – harley.lara | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| // Create an instance of WiFiClientSecure | // Create an instance of WiFiClientSecure | ||
| - | WiFiClientSecure | + | WiFiClientSecure |
| void setup() { | void setup() { | ||
| Line 48: | Line 48: | ||
| // Set the client to verify the server' | // Set the client to verify the server' | ||
| - | | + | |
| // Give the client a chance to perform the handshake | // Give the client a chance to perform the handshake | ||
| Line 57: | Line 57: | ||
| if (WiFi.status() == WL_CONNECTED) { | if (WiFi.status() == WL_CONNECTED) { | ||
| - | | + | |
| // Make an HTTPS GET request | // Make an HTTPS GET request | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| // Wait for the response | // Wait for the response | ||
| - | while (client.connected()) { | + | while (wifi_client.connected()) { |
| - | if (client.available()) { | + | if (wifi_client.available()) { |
| // read an incoming byte from the server and print it to serial monitor: | // read an incoming byte from the server and print it to serial monitor: | ||
| - | char c = client.read(); | + | char c = wifi_client.read(); |
| Serial.print(c); | Serial.print(c); | ||
| } | } | ||
| } | } | ||
| - | | + | |
| } | } | ||
latinet/unicaes/workshops/communication-23.1725993283.txt.gz · Last modified: 2024/09/10 20:34 by harley.lara