Git Product home page Git Product logo

esp32_azureiot_arduino's Introduction

Stop! Before you proceed:

This Get Started Guide is an older version and it is neither maintained nor supported anymore.

It is kept here for reference only and should not be used for any new development.

If you’re looking for a Get Started guide to the Espressif ESP32 there are two alternatives available:

  1. Azure IoT SDK for C which uses a bare metal approach (no RTOS) and support for Arduino IDE.
  2. Azure IoT middleware for FreeRTOS which uses ESP-IDF.

ESP32_AzureIoT - Azure IoT Hub library for esp32 devices in Arduino

This library is a port of the Microsoft Azure IoT device SDK for C to Arduino for esp32 devices. It allows you to use several Arduino compatible ESP32 boards with Azure IoT Hub.

Currently supported hardware

It should also work for other esp32 boards.

Prerequisites

You should have the following ready before beginning with any board:

SimpleMQTT and GetStarted Instructions

  1. Install esp32 board support into your Arduino IDE.

    • Start Arduino and open Preferences window.
    • Enter esp32 package URL https://dl.espressif.com/dl/package_esp32_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
    • Open Boards Manager from Tools > Board menu and install esp32 platform.
    • Select your esp32 board from Tools > Board menu after installation
  2. Open the SimpleMQTT or GetStartedexample from the Arduino IDE File->Examples->ESP32 Azure IoT Arduino.

  3. Update Wifi SSID/Password and IoT Hub Connection string in ino file

    • Ensure you are using a wifi network that does not require additional manual steps after connection, such as opening a web browser.
  4. Access the Get Started tutorial to learn more about how to get started with physical devices.

Contributing

There are a couple of ways you can contribute to this repo:

  • Ideas, feature requests and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, provide your ideas or contribute to existing threads.
  • Documentation: Found a typo or strangely worded sentences? Submit a PR!
  • Code: Contribute bug fixes, features or design changes.

Contributions for code that is not esp32 Arduino-specific can be made to the Azure IoT C SDK

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

See LICENSE file.

esp32_azureiot_arduino's People

Contributors

anthrene avatar lirenhe avatar wduraes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32_azureiot_arduino's Issues

Direct method response

How to respond to the direct method?

After invoking a direct method from IoT hub the message is received on the ESP32 but no response is sent back.
The error message below is shown on IoT hub
An error prevented the operation from successfully completing. The request failed with status code 200.

Error initializing SNTP

Hi,

An error occurs in the two examples if the delay between messages of 5 minutes or more.

"start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.

Error: Time:Wed Jun 20 12:41:38 2018 File:C:\Users\jorge\Documents\Arduino\libraries\azure_esp32\src\Esp32MQTTClient.cpp Func:SendEventOnce Line:316 Waiting for send confirmation, time is up 10003

Info: >>>Re-connect.

Info: >>>Confirmation[1] received for message tracking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY

Info: Initializing SNTP

assertion "Operating mode must not be set while SNTP client is running" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/apps/sntp/sntp.c", line 591, function: sntp_setoperatingmode
abort() was called at PC 0x400e01eb on core 1

Backtrace: 0x40087b34:0x3ffd53d0 0x40087c33:0x3ffd53f0 0x400e01eb:0x3ffd5410 0x400f23d9:0x3ffd5440 0x400d3a3e:0x3ffd5460 0x400d3a9a:0x3ffd5480 0x400d2b96:0x3ffd54a0 0x400d2e3e:0x3ffd54e0 0x400d2e75:0x3ffd5500 0x400d2f9b:0x3ffd5540 0x400d22c1:0x3ffd5560 0x4012da3c:0x3ffd5600

Rebooting..."

Connection Not Accepted: 0x3: Server Unavailable

Hi,

ESP32 crashes and reboots when connection time occures with Azure IoT hub: error message:

Info: >>>Connection status: timeout
Info: >>>Re-connect.
Info: Initializing SNTP
Info: SNTP initialization complete
Info: IoT Hub SDK for C, version 1.1.23

iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1234
Connection Not Accepted: 0x3: Server Unavailable

Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4016c199 PS : 0x00060c30 A0 : 0x800d6824 A1 : 0x3ffb1b90
A2 : 0x00000000 A3 : 0x3ffb1bcc A4 : 0x00000040 A5 : 0x00000151
A6 : 0x0000000a A7 : 0x3ffbc5b0 A8 : 0x00000003 A9 : 0x3ffb1b60
A10 : 0x00000000 A11 : 0x3ffb1bcc A12 : 0x00000004 A13 : 0x00000004
A14 : 0x00000001 A15 : 0x3ffc893c SAR : 0x00000008 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000038 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x4016c199:0x3ffb1b90 0x400d6821:0x3ffb1bb0 0x4016bcbf:0x3ffb1c30 0x400e008b:0x3ffb1c50 0x400de755:0x3ffb1c80 0x400dec75:0x3ffb1cf0 0x400daa8d:0x3ffb1d10 0x400d5694:0x3ffb1d40 0x400d5716:0x3ffb1d80 0x400d58c1:0x3ffb1da0 0x400d4118:0x3ffb1dc0 0x400e1f29:0x3ffb1fb0 0x40088e01:0x3ffb1fd0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:8424
ho 0 tail 12 room 4
load:0x40080400,len:5868
entry 0x4008069c

Direct Method Invocation seems to be broken

I have an ESP32 device running this library, and while it can connect to Azure IoT hub and transmit/receive messages just fine, it seems that the device method functionality is not working. Whenever I call the device's direct method from the Azure IoT portal or the device manager utility, I get the following error:
image

As of mid-2018, it sounds like there were issues with direct method invocation not being supported for ESP8266. Is this currently the case for ESP32?

Thanks!

"Operating mode must not be set while SNTP client is running" on sntp.c

Hello.

I tried using both getstarted and MQTT examples but I keep getting this error when trying to access the Hub. My connection string is as follows:

static const char* connectionString = "HostName=;DeviceId=;SharedAccessSignature=<My key";

I checked on a thread with the same issue where increasing the time in "platform_init" function solved the issue but I can't find that function in this implementation.

Any help would be appreciated.

Cheers

how to subscribe the topic

as far i understand for publishing "Esp32MQTTClient_SendEventInstance()" function is used . But how to subscribe the topic . Please share the details .

Receiving properties with message from Azure IOT hub

Hi, I can receive the message when sending a message from the Azure IOT hub to the ESP32 but cannot figure out how to retrieve the properties (key/value) that's part of the message, only thing returned is (const char* payLoad, int size) and payLoad only contains the message. Please see image below, thank you:

image

Using x509 - Connection Not Accepted: 0x5: Not Authorized

I would like to connect with x509 certificates. In example is used only SharedAccessKey or SharedAccessSignature. I modified the example by entering certificates, but unfortunately, the authorization is not accepted.

To test Azure setup I used the example from https://github.com/Azure/azure-iot-sdk-c
I attached the source file that I compiled and run in the emulator. Validation is successful. Running without a problem.

Then I tried to add this validation to SimpleMQTT (Arduino example). I added:

libraries:
#include "az_iot/iothub_client/inc/iothub_client_options.h"
#include "az_iot/c-utility/inc/azure_c_shared_utility/shared_util_options.h"

Certificates:
x509privatekey, x509certificate

change connection string to:
static const char* connectionString = "HostName=fengoo.azure-devices.net;DeviceId=mydevice;x509=true"

and set option for this certificates:
Esp32MQTTClient_SetOption(OPTION_TRUSTED_CERT, certificates); if ((Esp32MQTTClient_SetOption(OPTION_X509_CERT, x509certificate) != IOTHUB_CLIENT_OK) || (Esp32MQTTClient_SetOption(OPTION_X509_PRIVATE_KEY, x509privatekey) != IOTHUB_CLIENT_OK)) { printf("failure to set options for x509, aborting\r\n"); }

Is it possible to establish a connection with x509 certificates?

I attached .c file and Arduino file.
azure-x509-test.zip

DeviceMethodCallback being called multiple times

When calling a device method from Azure IoT Central, the device method gets called 4 times and never responds correctly to IoT Central.

Error on IoT Central: Unexpected response occurred while attempting to execute method Start on device

I am using the esp32-iot-devkit-get-started/Device/device.ino sample.

Messages to IoT hub seem to work correct.

Defining system properties on iotMessage

Hi,
Is it possible to define contentEncoding(ex: "utf-8") and contentType(ex: "application/json") on the message sent to IoTHub?

I am currently working on an digital twin setup where i am using an ESP32 with a BME280 sensor, where IoThub fires an event which runs an Azure function which in turn updates my digital twin values. I am able to publish the messages to IoThub but my function cant read them because the encoding an contentType isn't defined.

Thanks in advance.

cannot work on newer version of ESP32

Hi
this library was working well with esp32 version 1.0.6, but when I update to latest version 2.0.6
it started showing errors

any idea why?

Error: Time:Wed Feb 15 09:08:01 2023 File:c:\Users\raysa\OneDrive\Documents\Arduino\libraries\AzureIoT\src\az_iot\c-utility\pal\socket_async.c Func:socket_async_create Line:134 Socket connect failed, not EINPROGRESS: 0
Info: Could not open the socket
Info: >>>Connection status: disconnected
Info: >>>Connection status: disconnected
Info: tlsio_openssl_close has been called when in neither TLSIO_STATE_OPEN nor TLSIO_STATE_ERROR.
Error: Time:Wed Feb 15 09:08:05 2023 File:c:\Users\raysa\OneDrive\Documents\Arduino\libraries\AzureIoT\src\az_iot\c-utility\pal\socket_async.c Func:socket_async_create Line:134 Socket connect failed, not EINPROGRESS: 0
Info: Could not open the socket
Info: >>>Connection status: disconnected
Info: >>>Connection status: disconnected
Info: tlsio_openssl_close has been called when in neither TLSIO_STATE_OPEN nor TLSIO_STATE_ERROR.
Error: Time:Wed Feb 15 09:08:13 2023 File:c:\Users\raysa\OneDrive\Documents\Arduino\libraries\AzureIoT\src\az_iot\c-utility\pal\socket_async.c Func:socket_async_create Line:134 Socket connect failed, not EINPROGRESS: 0
Info: Could not open the socket
Info: >>>Connection status: disconnected
Info: >>>Connection status: disconnected
Info: tlsio_openssl_close has been called when in neither TLSIO_STATE_OPEN nor TLSIO_STATE_ERROR.

Sending more than about 5500 bytes leads to reboot

I changed the GetStarted example to send 5500 bytes as one message.

The data is received by the iot hub completly, but the esp32 doesn't receive a confirmation and times out in the SendEventOnce method.

ESP32 reboots with error if the connection resets using Microsoft Examples

On the Adafruit HUZZAH32 Feather, if you loose your WiFi connection, or just have a slow connection, the code crashes and the ESP32 reboots.

This is with the latest Microsoft Azure Libraries and boards files from Espressif json file added to the Boards Manager. The code is from Examples in Azure IoT and "A simple Azure IoT example for sending telemetry." Microsoft example.

You can see below, 4 good messages and then late message because of network latency.

Then we get an error with Func:tlsio_openssl_destroy and when it resets it crashes when trying to initialize SNTP. Network problems will happen - they cant cause errors and reboot.

From button-press restart

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:808
load:0x40078000,len:6084
load:0x40080000,len:6696
entry 0x400802e4
Starting connecting WiFi.
..WiFi connected
IP address:
192.168.1.69
Info: Initializing SNTP
Info: SNTP initialization complete
Info: IoT Hub SDK for C, version 1.1.23
Info: >>>Connection status: connected

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[0] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Sending data succeed

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[1] received for message tracking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Sending data succeed

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[2] received for message tracking id = 2 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Sending data succeed

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[3] received for message tracking id = 3 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Sending data succeed

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[4] received for message tracking id = 4 with result = IOTHUB_CLIENT_CONFIRMATION_OK

Sending data succeed
start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Error: Time:Thu Nov 15 02:48:20 2018 File:/home/jpagliaccio/.arduino15/packages/esp32/hardware/esp32/1.0.0/libraries/AzureIoT/src/Esp32MQTTClient.cpp Func:SendEventOnce Line:316 Waiting for send confirmation, time is up 10003

Info: >>>Re-connect.

Error: Time:Thu Nov 15 02:48:20 2018 File:/home/jpagliaccio/.arduino15/packages/esp32/hardware/esp32/1.0.0/libraries/AzureIoT/src/az_iot/c-utility/pal/src/tlsio_openssl_compact.c Func:tlsio_openssl_destroy Line:213 tlsio_openssl_destroy called while not in TLSIO_STATE_CLOSED.

Info: >>>Confirmation[5] received for message tracking id = 5 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY

Info: Initializing SNTP
assertion "Operating mode must not be set while SNTP client is running" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/apps/sntp/sntp.c", line 591, function: sntp_setoperatingmode
abort() was called at PC 0x400e35a3 on core 1

Backtrace: 0x4008f6f4:0x3ffb1d60 0x4008f8f7:0x3ffb1d80 0x400e35a3:0x3ffb1da0 0x40119359:0x3ffb1dd0 0x400d3fca:0x3ffb1df0 0x400d4026:0x3ffb1e10 0x400d30f2:0x3ffb1e30 0x400d339a:0x3ffb1e70 0x400d33d1:0x3ffb1e90 0x400d34f7:0x3ffb1ed0 0x400d2481:0x3ffb1ef0 0x40147f68:0x3ffb1fa0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:808
load:0x40078000,len:6084
load:0x40080000,len:6696
entry 0x400802e4
Starting connecting WiFi.
..WiFi connected
IP address:
192.168.1.69
Info: Initializing SNTP

Info: SNTP initialization complete
Info: IoT Hub SDK for C, version 1.1.23
Info: >>>Connection status: connected

start sending events.
Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
Info: >>>Confirmation[0] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_OK
Sending data succeed

Can't use Esp32MQTTClient_Init()

When I try to run Esp32MQTTClient_Init(), I get the following error message:

/Users/xxxxxx/Documents/Arduino/libraries/ESP32_AzureIoT_Arduino/src/az_iot/c-utility/src/constbuffer.c:143: undefined reference to \'__sync_sub_and_fetch_4\' collect2: error: ld returned 1 exit status exit status 1 Error compiling for board ESP32S2 Dev Module.

From googling this error, this issue seems to come up when compiling for ARM, but there's no reason it should be doing for an ESP32. What's happening here?

Get started not working with esp32

IP address:
192.168.41.128
[ 4634][E][esp32-hal-adc.c:164] __analogRead(): GPIO0: ESP_ERR_TIMEOUT: ADC2 is in use by Wi-Fi.
Info: Initializing SNTP

Info: SNTP initialization complete

Info: IoT Hub SDK for C, version 1.1.23

Error: Time:Tue Apr 27 08:58:50 2021 File:C:\Users\Vaeg\Documents\Arduino\libraries\ESP32_AzureIoT_Arduino\src\az_iot\c-utility\pal\socket_async.c Func:socket_async_create Line:134 Socket connect failed, not EINPROGRESS: 0

Info: Could not open the socket

Info: >>>Connection status: disconnected

Info: >>>Connection status: disconnected

Info: tlsio_openssl_close has been called when in neither TLSIO_STATE_OPEN nor TLSIO_STATE_ERROR.

MessageCallback never called?

board: esp32 dev module

i use nodejs azure iot hub api to send message to esp32 but MessageCallback never called?

below logs

ESP32 Device
Initializing...
 > WiFi
Connecting...
..WiFi connected
IP address: 
192.168.1.160
 > IoT Hub
Info: Initializing SNTP

Info: SNTP initialization complete

Info: IoT Hub SDK for C, version 1.1.23

Info: >>>Connection status: connected

Info: >>>Received Message [0], Size=25 Message {"hello":"lynky 6666666"}

1

Everytime I reboot the program, it print a message from nodejs, but not from the MessageCallback
tip: in nodejs i start a some connectionString client to test it , it can receive message

Any help is greatly appreciated!

ESP32 continues restarts once reached subscription limit (e.g. 8000 pcs / day)

Hello, I reached limit of azure daily msg (8.000) and I am getting error / restarts of ESP32 device.

I am having flashed esp32 device with latest up to date GetStarted.ino.

What has to be done to keep trying to connect rather then restarting ?

Thanks

`22:32:42.858 -> ESP32 Device
22:32:42.858 -> Initializing...
22:32:42.858 -> 5471
22:32:42.858 -> 31665
22:32:42.858 -> 495720
22:32:42.858 -> 582509
22:32:42.858 -> 1968036
22:32:42.858 -> 2502000
22:32:42.858 -> 542195
22:32:42.858 -> 597772
22:32:42.858 -> > WiFi
22:32:42.858 -> Connecting...
22:32:43.444 -> .WiFi connected
22:32:43.444 -> IP address:
22:32:43.444 -> 192.168.1.115
22:32:43.444 -> > IoT Hub
22:32:43.444 -> Info: Initializing SNTP

22:32:44.442 -> Info: SNTP initialization complete

22:32:44.442 -> Info: IoT Hub SDK for C, version 1.1.23

22:32:47.331 -> Info: >>>Connection status: connected

22:32:47.331 -> 2019-October-21 20:32:47
22:32:48.293 -> 2019-October-21 20:32:48
22:32:48.293 -> {"deviceId":"Esp32Device", "messageId":1, "Temperature":23.00, "Humidity":60.50, "rssi":-67, "cycle":1, "green":1, "orange":0, "red":0, "blue":0, "reject":0, "equipment":0, "operator":0, "changeover":0, "material":0}
22:32:48.329 -> Info: >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.

22:32:58.326 -> Error: Time:Mon Oct 21 20:32:58 2019 File:C:\Users\rasti\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\AzureIoT\src\Esp32MQTTClient.cpp Func:SendEventOnce Line:316 Waiting for send confirmation, time is up 10016

22:32:58.326 -> 2019-October-21 20:32:58
22:32:58.361 -> {"deviceId":"Esp32Device", "messageId":2, "Temperature":23.00, "Humidity":60.50, "rssi":-68, "cycle":1, "green":1, "orange":0, "red":0, "blue":0, "reject":0, "equipment":0, "operator":0, "changeover":0, "material":0}
22:32:58.361 -> Info: >>>Re-connect.

22:32:58.361 -> Error: Time:Mon Oct 21 20:32:58 2019 File:C:\Users\rasti\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\AzureIoT\src\az_iot\c-utility\pal\src\tlsio_openssl_compact.c Func:tlsio_openssl_destroy Line:213 tlsio_openssl_destroy called while not in TLSIO_STATE_CLOSED.

22:32:58.399 -> Info: >>>Confirmation[0] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY

22:32:58.399 -> Info: Initializing SNTP

22:32:58.399 -> assertion "Operating mode must not be set while SNTP client is running" failed: file "/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/apps/sntp/sntp.c", line 600, function: sntp_setoperatingmode
22:32:58.433 -> abort() was called at PC 0x4010b16f on core 1
22:32:58.433 ->
22:32:58.433 -> Backtrace: 0x4008c820:0x3ffb1c90 0x4008ca51:0x3ffb1cb0 0x4010b16f:0x3ffb1cd0 0x40123c15:0x3ffb1d00 0x400d4272:0x3ffb1d20 0x400d42ce:0x3ffb1d40 0x400d32ee:0x3ffb1d60 0x400d3622:0x3ffb1da0 0x400d3659:0x3ffb1dc0 0x400d376c:0x3ffb1e00 0x400d2140:0x3ffb1e20 0x400d2434:0x3ffb1f90 0x400dfe1d:0x3ffb1fb0 0x40088f69:0x3ffb1fd0
22:32:58.467 ->
22:32:58.467 -> Rebooting...
22:32:58.467 -> ets Jun 8 2016 00:22:57
22:32:58.467 ->
22:32:58.467 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
22:32:58.467 -> configsip: 0, SPIWP:0xee
22:32:58.467 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
22:32:58.467 -> mode:DIO, clock div:1
22:32:58.467 -> load:0x3fff0018,len:4
22:32:58.467 -> load:0x3fff001c,len:1216
22:32:58.467 -> ho 0 tail 12 room 4
22:32:58.467 -> load:0x40078000,len:9720
22:32:58.498 -> ho 0 tail 12 room 4
22:32:58.498 -> load:0x40080400,len:6352
22:32:58.498 -> entry 0x400806b8
22:32:58.772 -> ESP32 Device
22:32:58.772 -> Initializing...
`

Cannot connect to Iot Hub

Hi

I have compiled and uploaded "GetStarted" example without errors BUT

Serial monitor shows these messeges

Error: Time:Tue Jul 10 19:48:41 2018 File:C:\Users\Marcin\Documents\Arduino\libraries\ESP32_AzureIoT_Arduino\src\az_iot\c-utility\src\base64.c Func:Base64_Decoder Line:201 Invalid length Base64 string!

Error: Time:Tue Jul 10 19:48:41 2018 File:C:\Users\Marcin\Documents\Arduino\libraries\ESP32_AzureIoT_Arduino\src\az_iot\c-utility\src\sastoken.c Func:construct_sas_token Line:217 Unable to decode the key for generating the SAS.

Error: Time:Tue Jul 10 19:48:41 2018 File:C:\Users\Marcin\Documents\Arduino\libraries\ESP32_AzureIoT_Arduino\src\az_iot\iothub_client\src\iothub_client_authorization.c Func:IoTHubClient_Auth_Get_SasToken Line:389 Failed creating sas_token

Error: Time:Tue Jul 10 19:48:41 2018 File:C:\Users\Marcin\Documents\Arduino\libraries\ESP32_AzureIoT_Arduino\src\az_iot\iothub_client\src\iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:1585 failure getting sas token from IoTHubClient_Auth_Get_SasToken.

Info: >>>Re-connect.

Info: Initializing SNTP

assertion "Operating mode must not be set while SNTP client is running" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/apps/sntp/sntp.c", line 591, function: sntp_setoperatingmode
abort() was called at PC 0x400e2cf7 on core 1

Backtrace: 0x40088348:0x3ffd0bd0 0x40088447:0x3ffd0bf0 0x400e2cf7:0x3ffd0c10 0x401135bd:0x3ffd0c40 0x400d3f5e:0x3ffd0c60 0x400d3fba:0x3ffd0c80 0x400d2fa2:0x3ffd0ca0 0x400d32d6:0x3ffd0ce0 0x400d343d:0x3ffd0d00 0x400d2653:0x3ffd0d20 0x401384b4:0x3ffd0e60

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078a58
ESP32 Device
Initializing...

WiFi
Connecting...
....WiFi connected
IP address:
192.168.1.74
IoT Hub
Info: Initializing SNTP

Info: SNTP initialization complete

Info: IoT Hub SDK for C, version 1.1.23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.