1212#include " WiFiSSLClient.h"
1313#include " IPAddress.h"
1414
15- #include " arduino_secrets.h"
15+ #include " arduino_secrets.h"
1616
1717// /////please enter your sensitive data in the Secret tab/arduino_secrets.h
1818char ssid[] = SECRET_SSID; // your network SSID (name)
@@ -31,41 +31,41 @@ WiFiSSLClient client;
3131
3232/* -------------------------------------------------------------------------- */
3333void setup () {
34- /* -------------------------------------------------------------------------- */
34+ /* -------------------------------------------------------------------------- */
3535 // Initialize serial and wait for port to open:
3636 Serial.begin (115200 );
3737 while (!Serial) {
3838 ; // wait for serial port to connect. Needed for native USB port only
3939 }
40-
40+
4141 // check for the WiFi module:
4242 if (WiFi.status () == WL_NO_MODULE) {
4343 Serial.println (" Communication with WiFi module failed!" );
4444 // don't continue
4545 while (true );
4646 }
47-
47+
4848 String fv = WiFi.firmwareVersion ();
4949 if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
5050 Serial.println (" Please upgrade the firmware" );
5151 }
52-
52+
5353 // attempt to connect to WiFi network:
5454 while (status != WL_CONNECTED) {
5555 Serial.print (" Attempting to connect to SSID: " );
5656 Serial.println (ssid);
5757 // Connect to WPA/WPA2 network.
5858 status = WiFi.begin (ssid, pass);
59-
59+
6060 // wait 10 seconds for connection:
6161 delay (10000 );
6262 }
63-
63+
6464 printWifiStatus ();
65-
65+
6666 Serial.println (" \n Starting connection to server..." );
6767 // if you get a connection, report back via serial:
68-
68+
6969 if (client.connect (server, 443 )) {
7070 Serial.println (" connected to server" );
7171 // Make a HTTP request:
@@ -79,7 +79,7 @@ void setup() {
7979/* just wrap the received data up to 80 columns in the serial print*/
8080/* -------------------------------------------------------------------------- */
8181void read_response () {
82- /* -------------------------------------------------------------------------- */
82+ /* -------------------------------------------------------------------------- */
8383 uint32_t received_data_num = 0 ;
8484 while (client.available ()) {
8585 /* actual data reception */
@@ -88,15 +88,15 @@ void read_response() {
8888 Serial.print (c);
8989 /* wrap data to 80 columns*/
9090 received_data_num++;
91- if (received_data_num % 80 == 0 ) {
91+ if (received_data_num % 80 == 0 ) {
9292 Serial.println ();
9393 }
94- }
94+ }
9595}
9696
9797/* -------------------------------------------------------------------------- */
9898void loop () {
99- /* -------------------------------------------------------------------------- */
99+ /* -------------------------------------------------------------------------- */
100100 read_response ();
101101
102102 // if the server's disconnected, stop the client:
@@ -112,7 +112,7 @@ void loop() {
112112
113113/* -------------------------------------------------------------------------- */
114114void printWifiStatus () {
115- /* -------------------------------------------------------------------------- */
115+ /* -------------------------------------------------------------------------- */
116116 // print the SSID of the network you're attached to:
117117 Serial.print (" SSID: " );
118118 Serial.println (WiFi.SSID ());
0 commit comments