Skip to content

Fix leaks on wifi reconnection, update docs #55

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/Azure_IoT_Adu_ESP32/Azure_IoT_Adu_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static void connect_to_wifi()
Logger.Info("Connecting to WIFI SSID " + String(ssid));

WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down
3 changes: 2 additions & 1 deletion examples/Azure_IoT_Adu_ESP32/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This is a "to-the-point" guide outlining how to run an Azure SDK for Embedded C
- Setting up and configuring the necessary services for the scenario.
- Configuration, build, and run instructions for the IoT ADU sample.

_The following was run on Windows 11 and Ubuntu Desktop 20.04 environments, with Arduino IDE 1.8.19 and ESP32 board library version 2.0.4._
_The following was run on Windows 11, with Arduino IDE 2.1.0 and ESP32 board library version 2.0.9._

## Prerequisites

Expand All @@ -63,6 +63,7 @@ _The following was run on Windows 11 and Ubuntu Desktop 20.04 environments, with

- ESP32 boards are not natively supported by Arduino IDE, so you need to add them manually.
- Follow the [instructions](https://github.com/espressif/arduino-esp32) in the official ESP32 repository.
- If your ESP32 board is not recognized and a COM port is not mapped by your computer, try installing the [serial port drivers](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#connect-esp32-to-pc) recommended by ESPRESSIF.
- Install Azure CLI and Azure IoT Module

See steps to install both [here](https://learn.microsoft.com/azure/iot-hub-device-update/create-update?source=recommendations#prerequisites).
Expand Down
2 changes: 2 additions & 0 deletions examples/Azure_IoT_Central_ESP32/Azure_IoT_Central_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ static void connect_to_wifi()
LogInfo("Connecting to WIFI wifi_ssid %s", wifi_ssid);

WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.begin(wifi_ssid, wifi_password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/Azure_IoT_Central_ESP32/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ You will complete the following tasks:
* Build the image and flash it onto the ESP32
* Use Azure IoT Central to create cloud components, view properties, view device telemetry, and call direct commands

_The following was run on Windows 11, with Arduino IDE 2.1.0 and ESP32 board library version 2.0.9._

## Prerequisites

* Have the latest [Arduino IDE](https://www.arduino.cc/en/Main/Software) installed.
Expand All @@ -29,6 +31,7 @@ You will complete the following tasks:

- ESP32 boards are not natively supported by Arduino IDE, so you need to add them manually.
- Follow the [instructions](https://github.com/espressif/arduino-esp32) in the official ESP32 repository.
- If your ESP32 board is not recognized and a COM port is not mapped by your computer, try installing the [serial port drivers](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#connect-esp32-to-pc) recommended by ESPRESSIF.

* Hardware

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ static void connect_to_wifi()
LogInfo("Connecting to WIFI wifi_ssid %s", wifi_ssid);

WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.begin(wifi_ssid, wifi_password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/Azure_IoT_Central_ESP32_AzureIoTKit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ You will complete the following tasks:
* Build the image and flash it onto the ESP32 DevKit
* Use Azure IoT Central to create cloud components, view properties, view device telemetry, and call direct commands

_The following was run on Windows 11, with Arduino IDE 2.1.0 and ESP32 board library version 2.0.9._

## Prerequisites

* Have the latest [Arduino IDE](https://www.arduino.cc/en/Main/Software) installed.
Expand All @@ -29,6 +31,7 @@ You will complete the following tasks:

- ESP32 boards are not natively supported by Arduino IDE, so you need to add them manually.
- Follow the [instructions](https://github.com/espressif/arduino-esp32) in the official ESP32 repository.
- If your ESP32 board is not recognized and a COM port is not mapped by your computer, try installing the [serial port drivers](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#connect-esp32-to-pc) recommended by ESPRESSIF.

* Hardware

Expand Down
2 changes: 2 additions & 0 deletions examples/Azure_IoT_Hub_ESP32/Azure_IoT_Hub_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ static void connectToWiFi()
Logger.Info("Connecting to WIFI SSID " + String(ssid));

WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down
3 changes: 2 additions & 1 deletion examples/Azure_IoT_Hub_ESP32/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This is a "to-the-point" guide outlining how to run an Azure SDK for Embedded C
- Configuration instructions for the Arduino IDE to compile a sample using the [Azure SDK for Embedded C](https://github.com/Azure/azure-sdk-for-c).
- Configuration, build, and run instructions for the IoT Hub telemetry sample.

_The following was run on Windows 10 and Ubuntu Desktop 20.04 environments, with Arduino IDE 1.8.15 and ESP32 board library version 1.0.6._
_The following was run on Windows 11, with Arduino IDE 2.1.0 and ESP32 board library version 2.0.9._

## Prerequisites

Expand All @@ -53,6 +53,7 @@ _The following was run on Windows 10 and Ubuntu Desktop 20.04 environments, with

- ESP32 boards are not natively supported by Arduino IDE, so you need to add them manually.
- Follow the [instructions](https://github.com/espressif/arduino-esp32) in the official ESP32 repository.
- If your ESP32 board is not recognized and a COM port is not mapped by your computer, try installing the [serial port drivers](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#connect-esp32-to-pc) recommended by ESPRESSIF.

- Have one of the following interfaces to your Azure IoT Hub set up:
- [Azure Command Line Interface](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest) (Azure CLI) utility installed, along with the [Azure IoT CLI extension](https://github.com/Azure/azure-iot-cli-extension).
Expand Down
2 changes: 2 additions & 0 deletions examples/Azure_IoT_Hub_ESP8266/Azure_IoT_Hub_ESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ static void connectToWiFi()
Serial.println(ssid);

WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/Azure_IoT_Hub_ESP8266/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This is a "to-the-point" guide outlining how to run an Azure SDK for Embedded C
- Configuration instructions for the Arduino IDE to compile a sample using the Azure SDK for Embedded C.
- Configuration, build, and run instructions for the IoT Hub telemetry sample.

_The following was run on Windows 10 and Ubuntu Desktop 20.04 environments, with Arduino IDE 1.8.15 and Esp8266 module 3.0.1._
_The following was run on Windows 11, with Arduino IDE 2.1.0 and Esp8266 module 3.1.2._

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Azure SDK for C
version=1.1.3
version=1.1.4
author=Microsoft Corporation
maintainer=Microsoft Corporation <aziotarduino@microsoft.com>
sentence=Azure SDK for C library for Arduino.
Expand Down