Giter VIP home page Giter VIP logo

iot-middleware-freertos-samples's Introduction

Azure IoT samples using Azure IoT middleware for FreeRTOS

Windows CI Tests Linux CI Tests

Getting Started with Azure IoT middleware for FreeRTOS

The Azure IoT middleware for FreeRTOS simplifies the connection of devices running FreeRTOS to the Azure IoT services. It implements a modular approach that brings flexibility to IoT developers by allowing them to bring their own network stack (MQTT, TLS and Socket).

The Azure IoT middleware for FreeRTOS repo has the core functionalities of the middleware and no external dependencies, however to implement the working samples, we need to bring a network stack which is the objective of the samples in this repo.

We have two sets of samples:

  • Azure IoT Hub: These samples leverage Azure IoT Hub, DPS (Device Provisioning) and Plug and Play.

  • Azure IoT Central: These samples leverage Azure IoT Central, Azure DPS (Device Provisioning Service) and, Plug and Play. Azure subscription is not required during the initial 7 days of the IoT Central Free Trial.

There are several other alternatives to get MCU-based devices connected to Azure. See Other Azure IoT SDKs to learn more.

IoT Hub Samples:

Below you will find samples for development kits and simulators showing how to use the Azure IoT middleware for FreeRTOS connected to Azure IoT hub. The following samples support these development kits:

For a video deep dive into this repo and the source code, please see the Microsoft Developers video below.

Azure Device Update

You can interact with Azure Device Update, remotely updating your Azure IoT Hub devices through the samples below:

IoT Central Samples

Below you will find samples for development kits showing how to use the Azure IoT middleware for FreeRTOS connected to Azure IoT Central. The following samples support these development kits:

Plug and Play Sample

The easiest way to interact with the Plug and Play sample from the IoT service side is to use Azure IoT Explorer. To interact with the device sample:

  • Install Azure IoT Explorer.
  • Download the Thermostat model to a local directory.
  • Start Azure IoT Explorer and then:
    • Configure your hub. Once you've created your thermostat device, you should see it listed in the UX.
    • Go to IoT Plug and Play Settings on the home screen, select Local Folder for the location of the model definitions, and point to the folder you downloaded the thermostat model.
    • Go to the devices list and select your thermostat device. Now select IoT Plug and Play components and then Default Component.
    • You will now be able to interact with the Plug and Play device.

Additional instructions for using Azure IoT Explorer are available here.

Support

If you need support, please see our SUPPORT.md file.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

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.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies

iot-middleware-freertos-samples's People

Contributors

cal-kulator avatar cipop avatar danewalton avatar ericwol-msft avatar ewertons avatar felixkroemer avatar hihigupt avatar jspaith avatar microsoft-github-operations[bot] avatar microsoftopensource avatar rleclair avatar ryanwinter avatar sckulkarni246 avatar vaavva avatar wduraes avatar wickste 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  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  avatar

Watchers

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

iot-middleware-freertos-samples's Issues

[ADU] Agent sample should use install criteria version instead of update id for evaluating update

Please provide us with the following information:

This function is incorrect:
https://github.com/Azure-Samples/iot-middleware-freertos-samples/blob/ota/demos/sample_azure_iot_adu/sample_azure_iot_pnp_simulated_data.c#L239

It should use the criteria from the steps to decide to install or not:

From a sample update manifest:

{
    "steps": [{
            "type": "inline",
            "handler": "microsoft/swupdate:1",
            "files": [
                "azure_iot_freertos_esp32-v1.1.bin"
            ],
            "handlerProperties": {
                "installedCriteria": "00.06.06.42"
            }
        }
    ]
},

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

guru meditaion / reboot in esp32 sample

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

follow the steps from readme here https://github.com/Azure-Samples/iot-middleware-freertos-samples/tree/main/demos/projects/ESPRESSIF/esp32

in my case my CONFIG_IDF_TARGET is "esp32c3"

Any log messages given by the failure

I (28275) AZ IOT: Puback received for packet id: 0x00000003
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Stack dump detected
Core  0 register dump:
MEPC    : 0x4203ecc0  RA      : 0x4203ec7c  SP      : 0x3fca91c0  GP      : 0x3fc8f600
0x4203ecc0: capture_tcp_transport_error at C:/Users/moritz/entwicklung/projekte/bosch_pt/code/esp-idf-v4.4.1/components/tcp_transport/transport.c:332

0x4203ec7c: capture_tcp_transport_error at C:/Users/moritz/entwicklung/projekte/bosch_pt/code/esp-idf-v4.4.1/components/tcp_transport/transport.c:324

TP      : 0x3fc89860  T0      : 0x4005890e  T1      : 0x00000004  T2      : 0x00000080
S0/FP   : 0x00000002  S1      : 0x3fca1e5c  A0      : 0x00000000  A1      : 0x00000002
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x3fc98000  A5      : 0x00008008
A6      : 0x42024c36  A7      : 0x00000000  S2      : 0x3fca8198  S3      : 0x3fca9244
0x42024c36: lwip_read at C:/Users/moritz/entwicklung/projekte/bosch_pt/code/esp-idf-v4.4.1/components/lwip/lwip/src/api/sockets.c:1313

S4      : 0x00000001  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x3fcb0564  T4      : 0x3fcb0510  T5      : 0x00000000  T6      : 0x00000000
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'c:\\espbuild\\azure_iot_freertos_esp32.elf', '-ex', 'target remote | "C:\\Users\\moritz\\.espressif\\python_env\\idf4.4_py3.10_env\\Scripts\\python.exe" "C:\\Users\\moritz\\entwicklung\\projekte\\bosch_pt\\code\\esp-idf-v4.4.1\\tools\\idf_monitor_base\\..\\gdb_panic_server.py" --target esp32c3 "C:\\Users\\moritz\\AppData\\Local\\Temp\\tmp4v181ncg"', '-ex', 'bt']' returned non-zero exit status 1.
b'C:\\Users\\moritz\\.espressif\\tools\\riscv32-esp-elf\\esp-2021r2-patch3-8.4.0\\riscv32-esp-elf\\bin\\riscv32-esp-elf-gdb.exe: warning: Couldn\'t determine a path for the index cache directory.\r\nerror starting child process \'"C:\\Users\\moritz\\.espressif\\python_env\\idf4.4_py3.10_env\\Scripts\\python.exe" "C:\\Users\\moritz\\entwicklung\\projekte\\bosch_pt\\code\\esp-idf-v4.4.1\\tools\\idf_monitor_base\\..\\gdb_panic_server.py" --target esp32c3 "C:\\Users\\moritz\\AppData\\Local\\Temp\\tmp4v181ncg"\': CreateProcess: No such file or directory\r\nNo stack.\r\n'


Core  0 register dump:
MEPC    : 0x4203ecc0  RA      : 0x4203ec7c  SP      : 0x3fca91c0  GP      : 0x3fc8f600
TP      : 0x3fc89860  T0      : 0x4005890e  T1      : 0x00000004  T2      : 0x00000080
S0/FP   : 0x00000002  S1      : 0x3fca1e5c  A0      : 0x00000000  A1      : 0x00000002
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x3fc98000  A5      : 0x00008008
A6      : 0x42024c36  A7      : 0x00000000  S2      : 0x3fca8198  S3      : 0x3fca9244
S4      : 0x00000001  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x3fcb0564  T4      : 0x3fcb0510  T5      : 0x00000000  T6      : 0x00000000
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
MHARTID : 0x00000000

Stack memory:
3fca91c0: 0x3fca8198 0x3fca1e5c 0x00000000 0x4203f566 0x00000000 0x00000000 0x00006b6c 0x3fca930c
3fca91e0: 0x00000001 0x3fca9244 0x3fca930c 0x4203ebba 0x00000001 0x3fc98114 0x3fca9244 0x4200936c
3fca9200: 0x42009312 0x00000000 0x3fca9244 0x4200fb46 0x3c0ba3d8 0x00000002 0x00006b6c 0x0000005a
3fca9220: 0x00000001 0x00000000 0x3fc98114 0x4200df7a 0x3c0b5540 0x3fc93780 0x00000002 0x3fca929c
3fca9240: 0x3c0b5420 0x3c0b5540 0x3fc93780 0x00000002 0x3fc94980 0x00000000 0x3fc98114 0x000001f4
3fca9260: 0x3fc98114 0x00000000 0x0000005a 0x4200e166 0x00000001 0x00000000 0x00000000 0x00000000
3fca9280: 0x00000000 0x000001f4 0x00000000 0x4200c608 0x00000000 0x00000000 0x00000000 0x4200a446
3fca92a0: 0x3c0b55ac 0x00000000 0x00000000 0x42008382 0x420079e2 0x3fca9310 0xa5a5a5a5 0xa5a5a5a5
3fca92c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x0000000d 0x0000001d 0x3fc94ac0 0x3fc94b40 0x01c8f600
3fca92e0: 0x3c0c4fb0 0x00000000 0x3c0b53c4 0x0000001d 0x00000000 0x00000000 0x3c0b6854 0x0000002f
3fca9300: 0x00000000 0x00000000 0x00000000 0x3fca1e5c 0x42009312 0x420093a4 0x3fca930c 0x00000000
3fca9320: 0x00000000 0x3fc8f3e4 0x00000cb9 0x00000000 0x00000000 0x00000000 0x00000000 0x00000015
3fca9340: 0x00000000 0x00000000 0x00000000 0x40389eb8 0x00000000 0x00000000 0x00000000 0x00000000
3fca9360: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x27146414 0x01010107 0x00000001 0x000000ff
3fca9380: 0xffffffff 0x7fefffff 0x00000000 0x3fc00000 0x00000000 0x40300000 0x00000000 0x3fe00000
3fca93a0: 0x00000000 0x3ff80000 0x636f4361 0x3fd287a7 0x8b60c8b3 0x3fc68a28 0x509f79fb 0x3fd34413
3fca93c0: 0x00000000 0x401c0000 0x00000000 0x40140000 0x00000000 0x43500000 0x7fc00000 0x7f7fffff
3fca93e0: 0x00000000 0x40000000 0xffc00000 0x41dfffff 0x94a03595 0x3fdfffff 0x35afe535 0x3fe00000
3fca9400: 0x94a03595 0x3fcfffff 0x00000000 0x7ff80000 0xa5a5a5a5 0xa5a5a5a5 0x00004150 0x00000000
3fca9420: 0x08000000 0x00030317 0x238e4e04 0x7ad7f807 0xc03f7ffb 0x4ea16f2b 0x000000df 0x84a9f000
3fca9440: 0xff81348f 0xe122da3e 0x1d65263f 0xef0f14ba 0xab5d6681 0x894ec4a3 0x643b065f 0x0b0b0bb1
3fca9460: 0x0b0b0b0b 0x0b0b0b0b 0x87a0260b 0x607e3c1e 0x2bf86c57 0x9d8e5c63 0x4177acef 0xdafe3391
3fca9480: 0xa1aa0a50 0x030303d7 0x00000003 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca94a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca94c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca94e0: 0x00000000 0x00000000 0x057c0000 0x423f291a 0x25e97fb2 0xa41faff9 0xab4d4219 0x9daa0771
3fca9500: 0x1e41058d 0x93338948 0x0e0eb939 0x0e0e0e0e 0x0e0e0e0e 0x0e0e0e0e 0x1e45860e 0x9d81361f
3fca9520: 0x047d3cf8 0x70d1e986 0x5bfb6b0f 0xf12da02b 0x549a73b1 0x457d9c6f 0x6de02962 0x1a317277
3fca9540: 0xd2f4e821 0x4b65c13b 0x060403ae 0xed235b52 0x2da3c05d 0x1f6c4376 0xf75ef05d 0xb0920419
3fca9560: 0x14a38e76 0x83aa6cbb 0x63c6dfa9 0x0667e4a3 0x5e8dd6d1 0x000db8a3 0x01031a00 0x12004002
3fca9580: 0x01050104 0x03040102 0x03020305 0x01060202 0x00000306 0x0000000e 0x1eeba2b0 0xb6afeac5
3fca95a0: 0xe3d1be31 0xb7889db5 0xede42c3c 0x066f3bc8 0x116bf1ed 0x815b9371 0x8ceb5c64 0x8f27bbc8



ELF file SHA256: 3190aad83cdd3ed6
ELF file SHA256: 3190aad83cdd3ed6

Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40380654
0x40380654: esp_restart_noos_dig at C:/Users/moritz/entwicklung/projekte/bosch_pt/code/esp-idf-v4.4.1/components/esp_system/esp_system.c:44 (discriminator 1)

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x16b4
load:0x403ce000,len:0x930
load:0x403d0000,len:0x2d28
entry 0x403ce000
I (35) boot: ESP-IDF v4.4.1 2nd stage bootloader

Another occasion:

I (25085) MQTT: Packet received. ReceivedBytes=43.
I (25085) MQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess.
I (25085) MQTT: State record updated. New state=MQTTPublishDone.
I (25095) AZ IOT: $iothub/twin/res/204/?$rid=5&$version=115
I (25175) MQTT: Packet received. ReceivedBytes=2.
I (25175) MQTT: Ack packet deserialized with result: MQTTSuccess.
I (25175) MQTT: State record updated. New state=MQTTPublishDone.
I (25175) AZ IOT: Puback received for packet id: 0x00000004
I (25285) MQTT: Packet received. ReceivedBytes=43.
I (25285) MQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess.
I (25285) MQTT: State record updated. New state=MQTTPublishDone.
I (25295) AZ IOT: $iothub/twin/res/204/?$rid=7&$version=117
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

(so what happens before seems to be different, but the trace and dump are exactly the same)

Expected/desired behavior

This should not happen i guess. After reboot the device will successfully reconnect and send data until next crash.

OS and Version?

Windows 11.

Versions

esp-ide 4.4.1

Mention any other details that might be useful

(i am new to iot/ embedded world, so this might be a simple mistake of mine ?!)

just found the cause: espressif/esp-idf#8895


Thanks! We'll be in touch soon.

Show memory usage with each build

Proposed enhancement: for all samples or at least those using ARM GCC we could show memory usage with each build using -print-memory-usage.
Example diff for gcc_flags.cmake for b-l475e-iot01a:

set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-Wl,--gc-sections,-print-memory-usage \
    -static -z muldefs -mthumb -Wl,--start-group -lc -lm -Wl,--end-group")

ESP32 - Individual enrollment works, Group enrollment fails - Root and Intermediate Cert uploaded to DPS correctly

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Working case - Individual Enrolment

  • Upload root certificate to DPS
  • Create an individual enrolment policy with the device certificate correctly uploaded
  • Provide the device key and certificate correctly in the ESP32 sample example
  • Enable DPS support in the menuconfig of the ESP32 project and supply the correct idscope and the registrationId
  • Try out the example - it works and able to do MQTT

Non-working case - Group Enrolment

  • Delete the individual enrolment policy
  • Create a group enrolment policy with the correct intermediate certificate uploaded
  • Remove the device from IoT Hub and try the example again - it does not work, logs are below

Any log messages given by the failure

I (578) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (777) wifi:wifi driver task: 3ffaf6c8, prio:23, stack:6656, core=0
I (777) system_api: Base MAC address is not set
I (777) system_api: read default base MAC address from EFUSE
I (797) wifi:wifi firmware version: 7679c42
I (807) wifi:wifi certification version: v7.0
I (807) wifi:config NVS flash: enabled
I (807) wifi:config nano formating: disabled
I (807) wifi:Init data frame dynamic rx buffer num: 32
I (807) wifi:Init management frame dynamic rx buffer num: 32
I (817) wifi:Init management short buffer num: 32
I (817) wifi:Init dynamic tx buffer num: 32
I (827) wifi:Init static rx buffer size: 1600
I (827) wifi:Init static rx buffer num: 10
I (837) wifi:Init dynamic rx buffer num: 32
I (837) wifi_init: rx ba win: 6
I (837) wifi_init: tcpip mbox: 32
I (847) wifi_init: udp mbox: 6
I (847) wifi_init: tcp mbox: 6
I (857) wifi_init: tcp tx win: 5744
I (857) wifi_init: tcp rx win: 5744
I (857) wifi_init: tcp mss: 1440
I (867) wifi_init: WiFi IRAM OP enabled
I (867) wifi_init: WiFi RX IRAM OP enabled
I (877) sample_azureiot: Connecting to Shashank Kulkarni...
I (877) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (987) wifi:mode : sta (7c:9e:bd:ed:11:30)
I (997) wifi:enable tsf
I (997) sample_azureiot: Waiting for IP(s)
I (3047) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (3807) wifi:state: init -> auth (b0)
I (3817) wifi:state: auth -> assoc (0)
I (3827) wifi:state: assoc -> run (10)
I (3847) wifi:connected with Shashank Kulkarni, aid = 1, channel 6, BW20, bssid = de:d9:6a:a9:d3:dc
I (3857) wifi:security: WPA2-PSK, phy: bgn, rssi: -32
I (3857) wifi:pm start, type: 1

I (3897) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (4667) esp_netif_handlers: sample_azureiot: sta ip: 172.20.10.8, mask: 255.255.255.240, gw: 172.20.10.1
I (4667) sample_azureiot: Got IPv4 event: Interface "sample_azureiot: sta" address: 172.20.10.8
I (4677) sample_azureiot: Connected to sample_azureiot: sta
I (4677) sample_azureiot: - IPv4 address: 172.20.10.8
I (4687) sample_azureiot: Waiting for time synchronization with SNTP server
W (6567) wifi:<ba-add>idx:0 (ifx:0, de:d9:6a:a9:d3:dc), tid:0, ssn:2, winSize:64
I (6637) sample_azureiot: Notification of a time synchronization event
I (6707) AZ IOT: Creating a TLS connection to global.azure-devices-provisioning.net:8883.

I (6957) esp-tls-mbedtls: Initialize the ATECC interface...
I (10197) tls_freertos: (Network connection 0x3ffca850) Connection to global.azure-devices-provisioning.net established.
I (10367) MQTT: Packet received. ReceivedBytes=2.
I (10367) MQTT: CONNACK session present bit not set.
I (10367) MQTT: Connection accepted.
I (10377) MQTT: Received MQTT CONNACK successfully from broker.
I (10387) MQTT: MQTT connection established with the broker.
I (10387) AZ IOT: AzureIoTProvisioning established an MQTT connection with global.azure-devices-provisioning.net
I (12407) AZ IOT: AzureIoTProvisioning attempting to subscribe to the MQTT topic: devices/+/messages/devicebound/#
I (12537) MQTT: Packet received. ReceivedBytes=3.
I (14987) MQTT: Packet received. ReceivedBytes=192.
I (14987) MQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess.
I (14987) MQTT: State record updated. New state=MQTTPublishDone.
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x40103543  PS      : 0x00060b30  A0      : 0x80103b1e  A1      : 0x3ffca6b0  
0x40103543: capture_tcp_transport_error at /home/shashank/work/git/espressif/esp-idf/components/tcp_transport/transport.c:332

A2      : 0x3ffaf85c  A3      : 0x00008008  A4      : 0x00000001  A5      : 0x3ffca560  
A6      : 0x0000004c  A7      : 0x3ffca560  A8      : 0x80103514  A9      : 0x3ffca690  
A10     : 0x00000000  A11     : 0xffff8d80  A12     : 0x00000001  A13     : 0x3ffbcd40  
A14     : 0x00000001  A15     : 0xff000000  SAR     : 0x0000000a  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  


Backtrace:0x40103540:0x3ffca6b00x40103b1b:0x3ffca6d0 0x4016945d:0x3ffca700 0x400d8a65:0x3ffca720 0x400dcf79:0x3ffca750 0x400dbcb2:0x3ffca770 0x400dbdba:0x3ffca7a0 0x400dab99:0x3ffca7c0 0x400da79c:0x3ffca7e0 0x400da9e4:0x3ffca810 0x400d7db2:0x3ffca830 0x400d7ecb:0x3ffca8b0 0x4008ce65:0x3ffca960 
0x40103540: capture_tcp_transport_error at /home/shashank/work/git/espressif/esp-idf/components/tcp_transport/transport.c:332

0x40103b1b: ssl_read at /home/shashank/work/git/espressif/esp-idf/components/tcp_transport/transport_ssl.c:249

0x4016945d: esp_transport_read at /home/shashank/work/git/espressif/esp-idf/components/tcp_transport/transport.c:190

0x400d8a65: TLS_Socket_Recv at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/esp32/build/../components/sample-azure-iot/transport_tls_esp32.c:168

0x400dcf79: MQTT_GetIncomingPacketTypeAndLength at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt_serializer.c:2359

0x400dbcb2: receiveSingleIteration at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt.c:1297

0x400dbdba: MQTT_ProcessLoop at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt.c:2185

0x400dab99: AzureIoTMQTT_ProcessLoop at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/ports/coreMQTT/azure_iot_core_mqtt.c:182

0x400da79c: prvProvClientRunWorkflow at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/source/azure_iot_provisioning_client.c:537

0x400da9e4: AzureIoTProvisioningClient_Register at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos/source/azure_iot_provisioning_client.c:902

0x400d7db2: prvIoTHubInfoGet at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/demos/sample_azure_iot_pnp/sample_azure_iot_pnp.c:590 (discriminator 1)

0x400d7ecb: prvAzureDemoTask at /home/shashank/work/git/espressif/sck-stuff/azure-stuff/iot-middleware-freertos-samples/demos/sample_azure_iot_pnp/sample_azure_iot_pnp.c:359

0x4008ce65: vPortTaskWrapper at /home/shashank/work/git/espressif/esp-idf/components/freertos/port/xtensa/port.c:131

Expected/desired behavior

  • Group enrolment should also work, we should see MQTT happening correctly

OS and Version?

  • Ubuntu 20.04 LTS
  • ESP IDF v4.4

Versions

My repo's HEAD is at bcfbaab143e5ece442b5d0d45712f2f681c3b237

Mention any other details that might be useful

Nothing to report. Look forward to a resolution!

Fail during menuconfig in "Connect an ESPRESSIF ESP32 using Azure IoT Middleware for FreeRTOS" sample.

I have provided a patch for this in this PR

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Use a Linux based system, Bash, with ESP-IDF configured and sourced in the current shell, as explained in the official documentation.
Follow the steps until idf.py menuconfig in Connect an ESPRESSIF ESP32 using Azure IoT Middleware for FreeRTOS READ

Any log messages given by the failure

07:59:14 minef@mineflaptoparch aziotkit ±|main|→ idf.py menuconfig
Executing action: menuconfig
Running cmake in directory /home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.35.1") 
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/minef/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/minef/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/minef/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/sdkconfig
Loading defaults file /home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/sdkconfig.defaults...
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: /home/minef/.espressif/python_env/idf5.0_py3.10_env/bin/python3.10 (found version "3.10.2") found components: Interpreter 
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "azure_iot_freertos_esp32" version: bcfbaab
-- Adding linker script /home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/minef/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
-- Adding linker script /home/minef/esp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
CMake Error at /home/minef/esp/esp-idf/tools/cmake/component.cmake:304 (message):
  Include directory
  '/home/minef/esp/esp-idf/components/freertos/include/freertos' is not a
  directory.
Call Stack (most recent call first):
  /home/minef/esp/esp-idf/tools/cmake/component.cmake:477 (__component_add_include_dirs)
  components/azure-iot-middleware-freertos/CMakeLists.txt:29 (idf_component_register)


-- Configuring incomplete, errors occurred!
See also "/home/minef/esp/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1

Expected/desired behavior

OS and Version?

Linux mineflaptoparch 5.16.11-arch1-1 #1 SMP PREEMPT Thu, 24 Feb 2022 02:18:20 +0000 x86_64 GNU/Linux, standard kernel

Versions

ESP-IDF v5.0-dev-1624-gc04803e88b
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Mention any other details that might be useful

The directory /home/minef/esp/esp-idf/components/freertos/ does exist, but it does not contain an include folder.
The EDP-IDF is sourced via the Bash alias alias get_idf='. $HOME/esp/esp-idf/export.sh'.

TLS wrapper should print out error code in addition to helpful string

A common pattern in transport_tls_socket_using_mbedtls.c is to have code like below.

    if( lMbedtlsError != 0 )
    {
        LogError( ( "Failed to parse the client certificate: lMbedtlsError= %s : %s.",
                    mbedtlsHighLevelCodeOrDefault( lMbedtlsError ),
                    mbedtlsLowLevelCodeOrDefault( lMbedtlsError ) ) );
    }

The issue is MBED does not guarantee to convert all underlying error codes into MBED meaningful ones. In #43 for instance, a FreeRTOS level networking code ended up coming all the way untranslated up the stack into our code's implementation. Because the code was unknown, all I got was the "/" stuff.

In order to further debug, I had to put in a %d directly into the code and then put out just the lMBedtlsError all by itself.

Could we please change places that do this so we always print out lMBedtlsError, for scenarios like above?

Make it easier to use samples in this repo as a base for custom application

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Try extracting parts of this samples structure and build your own application.
This process is not documented, and trying to do so results in many jumps and still a lot of failures.

Any log messages given by the failure

Expected/desired behavior

Steps to do so should be clear and easy to follow.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

Please add documentation showing how to get the components of these samples and build your own application, not tied to the unified cmake structure implemented here.

cmake commands do not work in Git Bash

OS: Windows 10
Commands Run:

cmake -G Ninja -DVENDOR=ST -DBOARD=b-l475e-iot01a -Bb-l475e-iot01a .

Terminal: Git Bash (inside VS Code)

Notes: I have added ninja to path but git bash does not recognize the location. I have to open up cmd and run the command there.

Connection breaks after an hour or so

I am using SAS key for device authentication (ESP32), and after 60 minutes or so, the connection closes. I know that the token expires after 3600 seconds, but shouldn't it be automatically refreshed as the pxTokenRefresh function is initialized in the SetSymmetricKey function call. Do I explicitly need to call Connect method again after the expiration?

IotHubUnauthorized error with SAS key just after successful DPS (ESP32)

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behaviour that used to work and stopped in a new release)

Minimal steps to reproduce

Hello,

I tried to use the aziotkit to get my ESP connected to Azure IoT Hub. I am running it on a custom board with an ESP32. I am using the Symetric key as seen here: https://youtu.be/PNykfuJ3VDs?t=1567.

I don't understand why the MQTT is unauthorized (noAuth) after the first successful step of the DPS. The ESP crashes on the assert after that.

You can find the log below:

`
00:30:48.328 -> [0;32mI (11509) sample_azureiotkit: Waiting for time synchronization with SNTP server [0m
00:30:52.973 -> W (16139) wifi:idx:0 (ifx:0, 6e:69:eb:7d:a2:e8), tid:0, ssn:3, winSize:64
00:30:53.210 -> [0;32mI (16349) sample_azureiotkit: Notification of a time synchronization event [0m
00:30:53.352 -> [0;32mI (16509) AZ IOT: Creating a TLS connection to global.azure-devices-provisioning.net:8883.

00:30:53.352 -> [0m
00:30:56.519 -> [0;32mI (19679) tls_freertos: (Network connection 0x3ffc6010) Connection to global.azure-devices-provisioning.net established. [0m
00:30:56.519 -> [0;32mI (19679) AZ IOT: 0ne005E2F83%2fregistrations%2ftestingin
00:30:56.519 -> 1652830257 [0m
00:30:56.708 -> [0;32mI (19859) MQTT: Packet received. ReceivedBytes=2. [0m
00:30:56.708 -> [0;32mI (19859) MQTT: CONNACK session present bit not set. [0m
00:30:56.708 -> [0;32mI (19859) MQTT: Connection accepted. [0m
00:30:56.708 -> [0;32mI (19859) MQTT: Received MQTT CONNACK successfully from broker. [0m
00:30:56.708 -> [0;32mI (19879) MQTT: MQTT connection established with the broker. [0m
00:30:56.708 -> [0;32mI (19879) AZ IOT: AzureIoTProvisioning established an MQTT connection with global.azure-devices-provisioning.net [0m
00:30:58.768 -> [0;32mI (21899) AZ IOT: AzureIoTProvisioning attempting to subscribe to the MQTT topic: devices/+/messages/devicebound/# [0m
00:30:58.815 -> [0;32mI (21979) MQTT: Packet received. ReceivedBytes=3. [0m
00:31:01.409 -> [0;32mI (24549) MQTT: Packet received. ReceivedBytes=144. [0m
00:31:01.409 -> [0;32mI (24549) MQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess. [0m
00:31:01.409 -> [0;32mI (24549) MQTT: State record updated. New state=MQTTPublishDone. [0m
00:31:01.409 -> [0;32mI (24559) AZ IOT: $dps/registrations/res/202/?$rid=1&retry-after=3 [0m
00:31:01.409 -> [0;32mI (24579) AZ IOT: {"operationId":"5.18868892921e01xxxxx","status":"assigning"} [0m
00:31:07.972 -> [0;32mI (31119) MQTT: Packet received. ReceivedBytes=466. [0m
00:31:07.972 -> [0;32mI (31119) MQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess. [0m
00:31:07.972 -> [0;32mI (31119) MQTT: State record updated. New state=MQTTPublishDone. [0m
00:31:07.972 -> [0;32mI (31139) AZ IOT: $dps/registrations/res/200/?$rid=1 [0m
00:31:07.972 -> [0;32mI (31139) AZ IOT: {"operationId":"5.18868892xxxx","status":"assigned","registrationState":{"registrationId":"individual","createdDateTimeUtc":"2022-05-17T22:31:02.127779Z","assignedHub":"xxxxxx.azure-devices.net","deviceId":"individual","status":"assigned","substatus":"initialAssignment","lastUpdatedDateTimeUtc":"2022-05-17T22:31:02.3303866Z","etag":"IjVlMDBmNTdhLTAwMDAtMGUwMC0wMDAwxxxxxx="}} [0m
00:31:08.018 -> [0;32mI (31169) AZ IOT: Successfully acquired IoT Hub name and Device ID [0m
00:31:08.018 -> [0;32mI (31189) AZ IOT: Creating a TLS connection to xxxx.azure-devices.net:8883.

00:31:08.065 -> [0m
00:31:10.486 -> [0;32mI (33649) tls_freertos: (Network connection 0x3ffc6090) Connection to xxxxx.azure-devices.net established. [0m
00:31:10.486 -> [0;32mI (33649) AZ IOT: Creating an MQTT connection to xxxxxx.azure-devices.net.

00:31:10.486 -> [0m
00:31:10.486 -> [0;32mI (33659) AZ IOT: xxxxxx.azure-devices.net%2Fdevices%2Findividual%2Fmodules%2Fmainmodule
00:31:10.534 -> 1652830270 [0m
00:31:10.629 -> [0;32mI (33779) MQTT: Packet received. ReceivedBytes=2. [0m
00:31:10.629 -> [0;32mI (33779) MQTT: CONNACK session present bit not set. [0m
00:31:10.629 -> [0;31mE (33779) MQTT: Connection refused: not authorized. [0m
00:31:10.629 -> [0;31mE (33779) MQTT: CONNACK recv failed with status = MQTTServerRefused. [0m
00:31:10.629 -> [0;31mE (33799) MQTT: MQTT connection failed with status = MQTTServerRefused. [0m
00:31:10.676 -> [0;31mE (33799) AZ IOT: Failed to establish MQTT connection: Server=xxxx.azure-devices.net, MQTT error=0x00000006 [0m
00:31:10.676 ->
00:31:10.676 -> assert failed: prvAzureDemoTask sample_azure_iot_pnp.c:418 (xResult == eAzureIoTSuccess)
`

Any log messages given by the failure

I get this message in my log from Azure IoT
{"deviceId":"deviceIDfromDPS","moduleId":"mainmodule","sdkVersion":"c/1.1.0-beta.1(FreeRTOS)","protocol":"Mqtt","authType":null,"maskedIpAddress":"xx.xx.xxx.XXX","statusCode":"401","errorMessage":""}

Expected/desired behavior

The telemetry should start, and I should have the SAS working on my IoT Hub domain (it is public).

OS and Version?

Windows 10, ESP IDF 4.3

Versions

Mention any other details that might be useful

I opened a ticket there: https://docs.microsoft.com/en-us/answers/questions/853365/mqtt-connection-refused-esp-iot-kit-sample-code.html


Thanks! We'll be in touch soon.

Thanks a lot for your help

[ADU] ESP32 crashes when sending agent state with update results (hub name with 13 chars, device id with 17 chars)

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

ESP32 Samples should have certs in kconfig

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Running idf.py menuconfig does not show certs configuration. They need to be done through demo_config.h as of now.

Any log messages given by the failure

Expected/desired behavior

All the configuration of these ESP-IDF-based samples should be done via kconfig.

OS and Version?

N/A

Versions

https://github.com/Azure-Samples/iot-middleware-freertos-samples/tree/634e3790b28f8cdaf24d3e720ee3dd8f60cfdd24

[ADU] ESP32 ADU sample freezes when downgrading the image (1.1 to 1.0)

Please provide us with the following information:

Device froze after receiving this request:

{"desired":{"deviceUpdate":{"service":{"workflow":{"action":255,"id":"nodeployment"}},"__t":"c"},"$version":4},"reported":{"deviceUpdate":{"__t":"c","agent":{"deviceProperties":{"manufacturer":"ESPRESSIF","model":"ESP32-Azure-IoT-Kit","interfaceId":"dtmi:azure:iot:deviceUpdate;1","aduVer":"DU;agent/0.8.0-rc1-public-preview"},"compatPropertyNames":"manufacturer,model","state":0,"installedUpdateId":"{\"provider\":\"ESPRESSIF\",\"name\":\"ESP32-Azure-IoT-Kit\",\"version\":\"1.1\"}","workflow":{"action":3,"id":"d24626b0-647f-4bba-bac5-d94cad6d48ad-5927a9f1010728cb01c4389b415b34280eb65e5e"}},"service":{"ac":406,"av":3,"value":{}}},"$version":8}}

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Dependencies on bash for Windows causes slow building

This issue is for a: (mark with an x)

- [] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Clone the repository and build the solution within VSCode. Currently the tasks.json requires bash to be installed and in the path.

It can be installed from WSL installation, however this version runs exceptionally slow and installing WSL isnt a quick process. The other option is to ask people to set the git bash into their path, or install a version of bash from another location.

Otherwise use powershell, this runs on all platforms.

OS and Version?

Windows 10

[ADU] False positive log message in output stream

While testing early ADU release, I came across the error below.

E (16304) AZ IOT: Failed to send response to writable properties update, length of response is zero.

It seems harmless as the device otherwise is happily going along, but we should (a) make sure it's harmless and (b) cleanup log message as needed.

Azure IoT Hub samples behind firewalls / rtosveth0 and rtosveth1 usage

- [ ] bug report
- [ ] feature request
- [X] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

The setup creates two virtual interfaces, rtosveth0 and rtosveth1, to run simulator on a Linux Debian machine.

Expected/desired behavior

Is there a way to run the application to use natively the physical Ethernet interface without passing through the virtual interfaces? The issue I am having is that the DTLS / MQTT packets sent from the machine to the Azure IoT Hub are originated from a 192.168.1.100 on rtosveth1 IP different from the machine IP. The firewall and NAT have troubles to route packets to that location in response.

OS and Version?

Linux Debian 11

Ubuntu VM has issues staying connected, even though CONNACK is received

I can successfully build / setup Linux following instructions. I’m on an Ubuntu 20.04 honest VM, going straight to IoT Hub, no DPS, with symmetric key. All just golden path from instructions.

I can setup my device to successfully connect, including seeing a CONNACK that seems OK. So far so good. And I put in a dummy device and symmetric and saw that being correctly rejected, so I think to CONNACK I’m fine.

However the next thing I know, I end up getting an error -128 popping to TLS_Socket_Recv(), and this isn’t an mbed error so it can’t print friendly stuff on it. (I hand-added error code.) I debugged some and the error turns out to be pdFREERTOS_ERRNO_ENOTCONN, which is FreeRTOS land. It seems that after I CONNECt the network gets off right away. I get this is very unlikely a middleware issue and either freertos|vm_net|pilot error on my part, but would still be helpful to understand.

Logs below, see "// Jspaith: " for a few places I have extra commentary.

john@john-ubuntu4:~/iot/iot-middleware-freertos-samples$ sudo ./build_linux/demos/projects/PC/linux/iot-middleware-sample.elf


The following network interfaces are available:

Interface 1 - eth0
              (No description)

Interface 2 - veth0
              (No description)

Interface 3 - veth1
              (No description)

Interface 4 - lo
              (No description)

Interface 5 - any
              (Pseudo-device that captures on all interfaces)

Interface 6 - bluetooth-monitor
              (Bluetooth Linux Monitor)

Interface 7 - nflog
              (Linux netfilter log (NFLOG) interface)

Interface 8 - nfqueue
              (Linux netfilter queue (NFQUEUE) interface)


The interface that will be opened is set by "configNETWORK_INTERFACE_TO_USE", which
should be defined in FreeRTOSConfig.h
Attempting to open interface number 3.
[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:189] ---------STARTING DEMO---------

[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:198]

IP Address: 192.168.1.100

[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:201] Subnet Mask: 255.255.255.0

[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:204] Gateway Address: 192.168.1.1

[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:207] DNS Server Address: 1.1.1.1



[INFO] [AzureIoTDemo] [prvConnectToServerWithBackoffRetries:579] Creating a TLS connection to [redacted].azure-devices.net:8883.

[INFO] [AzureIoTDemo] [prvAzureDemoTask:383] Creating an MQTT connection to [redacted].azure-devices.net.

[INFO] [MQTT] [receivePacket:885] Packet received. ReceivedBytes=2.
[INFO] [MQTT] [deserializeConnack:958] CONNACK session present bit set.
[INFO] [MQTT] [logConnackResponse:912] Connection accepted.
[INFO] [MQTT] [receiveConnack:1563] Received MQTT CONNACK successfully from broker.
[INFO] [MQTT] [MQTT_Connect:1829] MQTT connection established with the broker. // JSpaith: Note we connect OK…
error-not-connected // Jspaith: This is an extra message jspaith put into FReeRTOS layer to make sure this was indeed correct error when run outside of debugger.
[ERROR] [TlsTransport] [TLS_Socket_Recv:869] Failed to read data: mbedTLSError= -128, <No-High-Level-Code> : <No-Low-Level-Code>.
[ERROR] [MQTT] [MQTT_GetIncomingPacketTypeAndLength:2395] A single byte was not read from the transport: transportStatus=-128, status=0.
[ERROR] [MQTT] [receiveSingleIteration:1319] Receiving incoming packet length failed. Status=MQTTRecvFailed
[ERROR] [MQTT] [MQTT_ProcessLoop:2191] Exiting process loop due to failure: ErrorStatus=MQTTRecvFailed
[ERROR] [TlsTransport] [TLS_Socket_Send:913] Failed to send data:  mbedTLSError= <No-High-Level-Code> : <No-Low-Level-Code>.
[ERROR] [MQTT] [sendPacket:625] Transport send failed. Error code=-128.
[ERROR] [MQTT] [MQTT_Subscribe:1892] Transport send failed for SUBSCRIBE packet.
[ERROR] [TlsTransport] [TLS_Socket_Send:913] Failed to send data:  mbedTLSError= <No-High-Level-Code> : <No-Low-Level-Code>.
[ERROR] [MQTT] [sendPacket:625] Transport send failed. Error code=-128.
[ERROR] [MQTT] [MQTT_Subscribe:1892] Transport send failed for SUBSCRIBE packet.
[ERROR] [TlsTransport] [TLS_Socket_Send:913] Failed to send data:  mbedTLSError= <No-High-Level-Code> : <No-Low-Level-Code>.
[ERROR] [MQTT] [sendPacket:625] Transport send failed. Error code=-128.
[ERROR] [MQTT] [sendPublish:1414] Transport send failed for PUBLISH header.
[ERROR] [MQTT] [MQTT_Publish:1972] MQTT PUBLISH failed with status MQTTSendFailed.
[INFO] [AzureIoTDemo] [prvAzureDemoTask:424] Attempt to receive publish message from IoT Hub.

error-not-connected
[ERROR] [TlsTransport] [TLS_Socket_Recv:869] Failed to read data: mbedTLSError= -128, <No-High-Level-Code> : <No-Low-Level-Code>.
[ERROR] [MQTT] [MQTT_GetIncomingPacketTypeAndLength:2395] A single byte was not read from the transport: transportStatus=-128, status=0.
[ERROR] [MQTT] [receiveSingleIteration:1319] Receiving incoming packet length failed. Status=MQTTRecvFailed
[ERROR] [MQTT] [MQTT_ProcessLoop:2191] Exiting process loop due to failure: ErrorStatus=MQTTRecvFailed
[INFO] [AzureIoTDemo] [prvAzureDemoTask:441] Keeping Connection Idle...

Call stack from where the FreeRTOS error is hit when running gdb. In general I worry about timing things esp. becaues this was under debugger, but because this reproed at full speed too and same error pretty sure this is right.

#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */

#0  FreeRTOS_recv (xSocket=0x7fffec0018b0, pvBuffer=0x7fffec002af8, uxBufferLength=5, xFlags=0) at _deps/freertos-src/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c:3076
#1  0x00005555555a98c1 in Sockets_Recv (xSocket=0x7fffec0018b0, pucReceiveBuffer=0x7fffec002af8 "\027\003\003", xReceiveBufferLength=5)
    at ../demos/common/transport/sockets_wrapper_freertos_tcpip.c:157
#2  0x00005555555a95fc in mbedtls_platform_recv (ctx=0x7fffec0018b0, buf=0x7fffec002af8 "\027\003\003", len=5) at ../demos/common/utilities/mbedtls_freertos_port.c:132
#3  0x0000555555588758 in mbedtls_ssl_fetch_input (ssl=0x7fffec000c20, nb_want=5) at _deps/freertos-src/FreeRTOS-Plus/ThirdParty/mbedtls/library/ssl_msg.c:2175
#4  0x00005555555895ae in ssl_get_next_record (ssl=0x7fffec000c20) at _deps/freertos-src/FreeRTOS-Plus/ThirdParty/mbedtls/library/ssl_msg.c:4678
#5  0x00005555555893bc in mbedtls_ssl_read_record (ssl=0x7fffec000c20, update_hs_digest=1) at _deps/freertos-src/FreeRTOS-Plus/ThirdParty/mbedtls/library/ssl_msg.c:4040
#6  0x0000555555589e67 in mbedtls_ssl_read (ssl=0x7fffec000c20, buf=0x7ffff4bc9c50 "p\234\274\364\377\177", len=1)
    at _deps/freertos-src/FreeRTOS-Plus/ThirdParty/mbedtls/library/ssl_msg.c:5505
#7  0x00005555555a91bf in TLS_Socket_Recv (pxNetworkContext=0x7ffff4bc9dc8, pvBuffer=0x7ffff4bc9c50, xBytesToRecv=1)
    at ../demos/common/transport/transport_tls_socket_using_mbedtls.c:850
#8  0x00005555555bcbbf in MQTT_GetIncomingPacketTypeAndLength (readFunc=0x5555555a9172 <TLS_Socket_Recv>, pNetworkContext=0x7ffff4bc9dc8, pIncomingPacket=0x7ffff4bc9c50)
    at ../libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt_serializer.c:2359
#9  0x00005555555b727d in receiveSingleIteration (pContext=0x5555555de6a0 <xAzureIoTHubClient>, remainingTimeMs=10, manageKeepAlive=true)
    at ../libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt.c:1297
#10 0x00005555555b8cb6 in MQTT_ProcessLoop (pContext=0x5555555de6a0 <xAzureIoTHubClient>, timeoutMs=10)
    at ../libs/azure-iot-middleware-freertos/libraries/coreMQTT/source/core_mqtt.c:2185
#11 0x00005555555ac72a in AzureIoTMQTT_ProcessLoop (xContext=0x5555555de6a0 <xAzureIoTHubClient>, ulMilliseconds=10)
    at ../libs/azure-iot-middleware-freertos/ports/coreMQTT/azure_iot_core_mqtt.c:182
#12 0x00005555555aa2ef in prvWaitForSubAck (pxAzureIoTHubClient=0x5555555de6a0 <xAzureIoTHubClient>, pxContext=0x5555555de898 <xAzureIoTHubClient+504>, ulTimeoutMilliseconds=9990)
    at ../libs/azure-iot-middleware-freertos/source/azure_iot_hub_client.c:477
#13 0x00005555555aaf5d in AzureIoTHubClient_SubscribeCloudToDeviceMessage (pxAzureIoTHubClient=0x5555555de6a0 <xAzureIoTHubClient>,
    xCallback=0x5555555a7177 <prvHandleCloudMessage>, prvCallbackContext=0x5555555de6a0 <xAzureIoTHubClient>, ulTimeoutMilliseconds=10000)
    at ../libs/azure-iot-middleware-freertos/source/azure_iot_hub_client.c:952
#14 0x00005555555a7784 in prvAzureDemoTask (pvParameters=0x0) at ../demos/sample_azure_iot/sample_azure_iot.c:390
#15 0x000055555555ebef in prvWaitForStart (pvParams=0x7ffff0018968) at _deps/freertos-src/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:435
#16 0x00007ffff7f9a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#17 0x00007ffff7e76293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
`

[ADU] Changing ucScratchBuffer size to less than 600 bytes causes AzureIoTADUClient_SendAgentState to hang

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

change the size of ucScratchBuffer to 560 bytes and run the ESP32 ADU sample.
https://github.com/Azure-Samples/iot-middleware-freertos-samples/blob/ota/demos/sample_azure_iot_adu/sample_azure_iot_adu.c#L173

Any log messages given by the failure

Execution hangs here:

I (99931) AZ IOT: Starting the mbedtls calculation: image size 864816

.............
I (105421) AZ IOT: Done

I (105421) AZ IOT: SHAs match

I (105421) AZ IOT: [ADU] Enable the update image

I (105431) esp_image: segment 0: paddr=00120020 vaddr=3f400020 size=23388h (144264) map
I (105651) esp_image: segment 1: paddr=001433b0 vaddr=3ffb0000 size=04f04h ( 20228)
I (105661) esp_image: segment 2: paddr=001482bc vaddr=40080000 size=07d5ch ( 32092)
I (105721) esp_image: segment 3: paddr=00150020 vaddr=400d0020 size=962f0h (615152) map
I (106631) esp_image: segment 4: paddr=001e6318 vaddr=40087d5c size=0ced4h ( 52948)
I (106701) esp_image: segment 5: paddr=001f31f4 vaddr=50000000 size=00010h (    16)
I (106771) AZ IOT: [ADU] Send property update.

Expected/desired behavior

Execution to proceed to reset the device.

I (106781) AZ IOT: [ADU] Reset the device

Versions

Observed starting with #204
Earlier versions of the code might have been previously affected.

Check that all Windows related samples reference MAX_PATH concerns

Do our samples for Windows centric (e.g. this) should probably reference instructions for relaxing Windows' MAX_PATH as well as git's length requirements since internal customer test ran into issues with this.

Not just doc linked above though but anything Windows touching it should be reviewed to this end.

External dependencies have to be recloned whenever you delete the build folder

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow guide steps here: https://github.com/Azure-Samples/iot-middleware-freertos-samples/tree/main/demos/projects/NXP/mimxrt1060#build-the-image

During the configure step, multiple repositories are cloned into the temporary build directory. There are two disadvantages here:

  1. The repositories need to be recloned every time the build directory is deleted.
  2. Can confuse debugger if files are temporary.

Expected/desired behavior

External repositories to not be stored in temporary build directories, and to be easy to update when needed.

Unable to create file FreeRTOS/Demo/... Filename too long

OS: Windows 10
Note: Building in a OneDrive synced directory.

Logs:

C:\Users\<user>\OneDrive - Microsoft\Documents\bugbash\iot-middleware-freertos-samples>cmake -G Ninja -DVENDOR=ST -DBOARD=b-l475e-iot01a -Bb-l475e-iot01a .
-- No STM32_TOOLCHAIN_PATH specified, using default: /usr
-- No STM32_TARGET_TRIPLET specified, using default: arm-none-eabi
-- The C compiler identification is GNU 10.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin/arm-none-eabi-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin/arm-none-eabi-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- No FREERTOS_PATH specified: Fetching FreeRTOS to path <>
-- Populating freertos
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/<User>/OneDrive - Microsoft/Documents/bugbash/iot-middleware-freertos-samples/b-l475e-iot01a/_deps/freertos-subbuild
[1/9] Creating directories for 'freertos-populate'
[1/9] Performing download step (git clone) for 'freertos-populate'
Cloning into 'freertos-src'...
remote: Enumerating objects: 164040, done.
remote: Counting objects: 100% (239/239), done.
remote: Compressing objects: 100% (149/149), done.
remote: Total 164040 (delta 119), reused 188 (delta 89), pack-reused 163801
Receiving objects: 100% (164040/164040), 125.86 MiB | 2.03 MiB/s, done.
Resolving deltas: 100% (117003/117003), done.
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu0_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu1_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu2_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu3_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu4_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xddr_xmpu5_cfg.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xfpd_slcr_secure.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xfpd_xmpu_sink.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xiou_secure_slcr.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xlpd_slcr_secure.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/includes_ps/xlpd_xppu_sink.h: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/initialise_monitor_handles.c: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata/MakeFSData_proj.sln: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata/MakeFSData_proj.suo: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata/MakeFSData_proj.vcxproj: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata/MakeFSData_proj.vcxproj.filters: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata/MakeFSData_proj.vcxproj.user: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/ST_Code/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_timebase_rtc_alarm_template.c: Filename too long
error: unable to create file FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/ST_Code/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_timebase_rtc_wakeup_template.c: Filename too long
fatal: cannot create directory at 'FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwIP_Demo/lwIP_Apps/apps/httpserver_raw_from_lwIP_download/makefsdata': Filename too long
CMake Error at freertos-subbuild/freertos-populate-prefix/tmp/freertos-populate-gitclone.cmake:40 (message):
  Failed to checkout tag: 'c8fa483b68c6c1149c2a7a8bc1e901b38860ec9b'


FAILED: freertos-populate-prefix/src/freertos-populate-stamp/freertos-populate-download
cmd.exe /C "cd /D "C:\Users\<user>\OneDrive - Microsoft\Documents\bugbash\iot-middleware-freertos-samples\b-l475e-iot01a\_deps" && "C:\Program Files\CMake\bin\cmake.exe" -P "C:/Users/<user>/OneDrive - Microsoft/Documents/bugbash/iot-middleware-freertos-samples/b-l475e-iot01a/_deps/freertos-subbuild/freertos-populate-prefix/tmp/freertos-populate-gitclone.cmake" && "C:\Program Files\CMake\bin\cmake.exe" -E touch "C:/Users/<user?/OneDrive - Microsoft/Documents/bugbash/iot-middleware-freertos-samples/b-l475e-iot01a/_deps/freertos-subbuild/freertos-populate-prefix/src/freertos-populate-stamp/freertos-populate-download""
ninja: build stopped: subcommand failed.
CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1012 (message):
  Build step for freertos failed: 1
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1141:EVAL:2 (__FetchContent_directPopulate)
  C:/Program Files/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1141 (cmake_language)
  cmake/common/utilities.cmake:35 (FetchContent_Populate)
  CMakeLists.txt:18 (free_rtos_fetch)


-- Configuring incomplete, errors occurred!
See also "C:/Users/<user>/OneDrive - Microsoft/Documents/bugbash/iot-middleware-freertos-samples/b-l475e-iot01a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/<user>/OneDrive - Microsoft/Documents/bugbash/iot-middleware-freertos-samples/b-l475e-iot01a/CMakeFiles/CMakeError.log".

[ADU] Quickly delete the deployment from the portal

Scenario

An update is sent out but them immediately deleted. The device will receive the update but it won't be valid any longer. We should have some logic to try only so many times and then report the update is failed. Possibly get the twin again to make sure the twin property is still correct.

Note: there is a bug currently on service if you quickly delete the deployment where the twin property sticks around (although the Azure portal shows device on latest and no more deployment).

Thanks to @alancshi for the scenario experiment.

Cannot build samples

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Tried to build in PowerSheell and in VS Code terminal

Any log messages given by the failure

PS C:\Sources\IoT\iot-middleware-freertos-samples> cmake -G Ninja -DVENDOR=ST -DBOARD=stm32h745i-disco -Bstm32h745i-disco .
-- No STM32_TARGET_TRIPLET specified, using default: arm-none-eabi
-- No FREERTOS_PATH specified: Fetching FreeRTOS to path <>
-- Populating freertos
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Sources/IoT/iot-middleware-freertos-samples/stm32h745i-disco/_deps/freertos-subbuild
[0/7] Performing update step for 'freertos-populate'
[2/7] No patch step for 'freertos-populate'
[3/7] No configure step for 'freertos-populate'
[4/7] No build step for 'freertos-populate'
[5/7] No install step for 'freertos-populate'
[6/7] No test step for 'freertos-populate'
[7/7] Completed 'freertos-populate'
INFOFREERTOS_PATH set to
-- Populating stm32cubeh7
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Sources/IoT/iot-middleware-freertos-samples/stm32h745i-disco/_deps/stm32cubeh7-subbuild
[0/7] Performing update step for 'stm32cubeh7-populate'
[2/7] No patch step for 'stm32cubeh7-populate'
[3/7] No configure step for 'stm32cubeh7-populate'
[4/7] No build step for 'stm32cubeh7-populate'
[5/7] No install step for 'stm32cubeh7-populate'
[6/7] No test step for 'stm32cubeh7-populate'
[7/7] Completed 'stm32cubeh7-populate'
-- Populating lwip
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Sources/IoT/iot-middleware-freertos-samples/stm32h745i-disco/_deps/lwip-subbuild
[0/7] Performing update step for 'lwip-populate'
[2/7] No patch step for 'lwip-populate'
[3/7] No configure step for 'lwip-populate'
[4/7] No build step for 'lwip-populate'
[5/7] No install step for 'lwip-populate'
[6/7] No test step for 'lwip-populate'
[7/7] Completed 'lwip-populate'
INFOLWIP_PATH set to
-- Search for HAL families: STM32H7_M7
-- Search for HAL drivers: adc;can;cec;comp;cortex;crc;dac;dma;exti;flash;gpio;i2c;i2s;irda;iwdg;pcd;pwr;rcc;rtc;smartcard;smbus;spi;tim;tsc;uart;usart;wwdg;eth;hcd;mmc;nand;nor;pccard;sd;sram;cryp;dcmi;hash;rng;hrtim;opamp;sdadc;dfsdm;dma2d;dsi;flash_ramfunc;fmpi2c;lptim;ltdc;qspi;sai;sdram;spdifrx;jpeg;mdios;cordic;fdcan;fmac;dts;gfxmmu;hsem;mdma;ospi;otfdec;pssi;ramecc;swpmi;firewall;lcd;pka;gtzc;icache
-- Search for HAL LL drivers: adc;comp;crc;crs;dac;dma;exti;gpio;i2c;pwr;rcc;rtc;spi;tim;usart;usb;utils;fsmc;sdmmc;rng;fmc;hrtim;opamp;dma2d;lptim;lpuart;ucpd;cordic;fmac;bdma;delayblock;mdma;swpmi;pka

CMake Error at CMakeLists.txt:45 (add_subdirectory):
  The source directory

    C:/Sources/IoT/iot-middleware-freertos-samples/libs/azure-iot-middleware-freertos

  does not contain a CMakeLists.txt file.


-- Configuring incomplete, errors occurred!
See also "C:/Sources/IoT/iot-middleware-freertos-samples/stm32h745i-disco/CMakeFiles/CMakeOutput.log".

Expected/desired behavior

OS and Version?

Windows 10

Versions

PS C:\Sources\IoT\iot-middleware-freertos-samples> ninja --version
1.10.2
PS C:\Sources\IoT\iot-middleware-freertos-samples> cmake --version
cmake version 3.22.1

Mention any other details that might be useful


Thanks! We'll be in touch soon.

DPS connection issue.

I am trying to get the ESP32 example working in DPS mode so that I do not need to pass the Azure IoT Device Symmetric Key for each device. Below is the output I am getting from the ESP32. It keeps rebooting. Just to confirm is "Azure Device Provisioning Service Registration ID" the same as the name of your enrollment group? With this stack, can I get my enrollment group to function with "Symmetric Key" instead a x509 certificate?


ELF file SHA256: b76e6f709c13d9ec<CR><LF>
<CR><LF>
Rebooting...<CR><LF>
ets Jun  8 2016 00:22:57<CR><LF>
<CR><LF>
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)<CR><LF>
configsip: 0, SPIWP:0xee<CR><LF>
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<CR><LF>
mode:DIO, clock div:2<CR><LF>
load:0x3fff0030,len:6616<CR><LF>
load:0x40078000,len:14780<CR><LF>
ho 0 tail 12 room 4<CR><LF>
load:0x40080400,len:3792<CR><LF>
entry 0x40080694<CR><LF>
<ESC>_[0;32mI (29) boot: ESP-IDF v4.4-rc1-dirty 2nd stage bootloader<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: compile time 21:33:58<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: chip revision: 1<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (39) boot.esp32: SPI Speed      : 40MHz<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (44) boot.esp32: SPI Mode       : DIO<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (49) boot.esp32: SPI Flash Size : 4MB<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (53) boot: Enabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (59) boot: Partition Table:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (62) boot: ## Label            Usage          Type ST Offset   Length<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (69) boot:  0 nvs              WiFi data        01 02 00009000 00004000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (77) boot:  1 otadata          OTA data         01 00 0000d000 00002000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (84) boot:  2 phy_init         RF data          01 01 0000f000 00001000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (92) boot:  3 factory          factory app      00 00 00010000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (99) boot:  4 ota_0            OTA app          00 10 00110000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (107) boot:  5 ota_1            OTA app          00 11 00210000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (114) boot: End of partition table<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (119) boot: Defaulting to factory image<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (123) boot_comm: chip revision: 1, min. application chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (130) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=23c64h (146532) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (192) esp_image: segment 1: paddr=00033c8c vaddr=3ffb0000 size=03894h ( 14484) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (198) esp_image: segment 2: paddr=00037528 vaddr=40080000 size=08af0h ( 35568) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (213) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a17b8h (661432) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (452) esp_image: segment 4: paddr=000e17e0 vaddr=40088af0 size=0bf08h ( 48904) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (473) esp_image: segment 5: paddr=000ed6f0 vaddr=50000000 size=00010h (    16) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Loaded app from partition at offset 0x10000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Disabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (495) cpu_start: Pro cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (496) cpu_start: Starting app cpu, entry point is 0x400811e8<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (481) cpu_start: App cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Pro cpu start user code<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: cpu freq: 160000000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Application information:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (516) cpu_start: Project name:     azure_iot_freertos_esp32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (523) cpu_start: App version:      3e01d9e-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (528) cpu_start: Compile time:     Apr  5 2022 14:35:39<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (534) cpu_start: ELF file SHA256:  b76e6f709c13d9ec...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (540) cpu_start: ESP-IDF:          v4.4-rc1-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (546) heap_init: Initializing. RAM available for dynamic allocation:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (553) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (559) heap_init: At 3FFB9758 len 000268A8 (154 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (565) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (572) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (578) heap_init: At 400949F8 len 0000B608 (45 KiB): IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (586) spi_flash: detected chip: generic<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (589) spi_flash: flash io: dio<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (594) cpu_start: Starting scheduler on PRO CPU.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (0) cpu_start: Starting scheduler on APP CPU.<ESC>_[0m<CR><LF>
I (749) wifi:wifi driver task: 3ffaf6c8, prio:23, stack:6656, core=0<CR><LF>
<ESC>_[0;32mI (749) system_api: Base MAC address is not set<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (749) system_api: read default base MAC address from EFUSE<ESC>_[0m<CR><LF>
I (759) wifi:wifi firmware version: 7679c42<CR><LF>
I (759) wifi:wifi certification version: v7.0<CR><LF>
I (759) wifi:config NVS flash: enabled<CR><LF>
I (759) wifi:config nano formating: disabled<CR><LF>
I (769) wifi:Init data frame dynamic rx buffer num: 32<CR><LF>
I (769) wifi:Init management frame dynamic rx buffer num: 32<CR><LF>
I (779) wifi:Init management short buffer num: 32<CR><LF>
I (779) wifi:Init dynamic tx buffer num: 32<CR><LF>
I (789) wifi:Init static rx buffer size: 1600<CR><LF>
I (789) wifi:Init static rx buffer num: 10<CR><LF>
I (789) wifi:Init dynamic rx buffer num: 32<CR><LF>
<ESC>_[0;32mI (799) wifi_init: rx ba win: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (799) wifi_init: tcpip mbox: 32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: udp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp tx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp rx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp mss: 1440<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi RX IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) sample_azureiot: Connecting to Peepal...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07<ESC>_[0m<CR><LF>
I (949) wifi:mode : sta (58:bf:25:93:09:08)<CR><LF>
I (949) wifi:enable tsf<CR><LF>
<ESC>_[0;32mI (959) sample_azureiot: Waiting for IP(s)<ESC>_[0m<CR><LF>

05/04/2022 14:42:18.526 [RX] - I (2999) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1<CR><LF>
I (3759) wifi:state: init -> auth (b0)<CR><LF>
I (3769) wifi:state: auth -> assoc (0)<CR><LF>
I (3769) wifi:state: assoc -> run (10)<CR><LF>
I (3799) wifi:connected with Peepal, aid = 5, channel 6, BW20, bssid = 0c:8e:29:a0:ec:2a<CR><LF>
I (3799) wifi:security: WPA2-PSK, phy: bgn, rssi: -32<CR><LF>
I (3799) wifi:pm start, type: 1<CR><LF>
<CR><LF>
W (3819) wifi:<ba-add>idx:0 (ifx:0, 0c:8e:29:a0:ec:2a), tid:6, ssn:0, winSize:64<CR><LF>
W (3819) wifi:<ba-add>idx:1 (ifx:0, 0c:8e:29:a0:ec:2a), tid:0, ssn:2, winSize:64<CR><LF>
I (3819) wifi:AP's beacon interval = 102400 us, DTIM period = 3<CR><LF>

05/04/2022 14:42:20.160 [RX] - <ESC>_[0;32mI (4639) esp_netif_handlers: sample_azureiot: sta ip: 192.168.1.88, mask: 255.255.255.0, gw: 192.168.1.254<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4639) sample_azureiot: Got IPv4 event: Interface "sample_azureiot: sta" address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4649) sample_azureiot: Connected to sample_azureiot: sta<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4649) sample_azureiot: - IPv4 address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4659) sample_azureiot: my_json_string<CR><LF>
{<CR><LF>
<HT>	"A":<HT>	"testaccount",<CR><LF>
<HT>	"B":<HT>	"1",<CR><LF>
<HT>	"C":<HT>	"176.49.64.63",<CR><LF>
<HT>	"G":<HT>	"1.70",<CR><LF>
<HT>	"Irrigation":<HT>	true,<CR><LF>
<HT>	"Air":<HT>	false<CR><LF>
}<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4669) sample_azureiot: Waiting for time synchronization with SNTP server<ESC>_[0m<CR><LF>

05/04/2022 14:42:22.022 [RX] - <ESC>_[0;32mI (6499) sample_azureiot: @@@@@Notification of a time synchronization event<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (6689) AZ IOT: Creating a TLS connection to global.azure-devices-provisioning.net:8883.<CR>
<CR><LF>
<ESC>_[0m<CR><LF>

05/04/2022 14:42:23.955 [RX] - <ESC>_[0;32mI (8429) tls_freertos: (Network connection 0x3ffca250) Connection to global.azure-devices-provisioning.net established.<ESC>_[0m<CR><LF>
<ESC>_[0;31mE (8429) AZ IOT: AzureIoTProvisioningClient_SetSymmetricKey failed: invalid argument<ESC>_[0m<CR><LF>
<CR><LF>
assert failed: prvIoTHubInfoGet sample_azure_iot_pnp.c:559 (xResult == eAzureIoTSuccess)<CR><LF>
<CR><LF>
<CR><LF>
Backtrace:0x40081a7e:0x3ffca0d00x400884d1:0x3ffca0f0 0x4008f5f9:0x3ffca110 0x400d88e3:0x3ffca230 0x400d8a1f:0x3ffca290 0x4008bbcd:0x3ffca340 <CR><LF>
<CR><LF>
<CR><LF>
<CR><LF>
<CR><LF>
ELF file SHA256: b76e6f709c13d9ec<CR><LF>
<CR><LF>
Rebooting...<CR><LF>
ets Jun  8 2016 00:22:57<CR><LF>
<CR><LF>
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)<CR><LF>
configsip: 0, SPIWP:0xee<CR><LF>
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<CR><LF>
mode:DIO, clock div:2<CR><LF>
load:0x3fff0030,len:6616<CR><LF>
load:0x40078000,len:14780<CR><LF>
ho 0 tail 12 room 4<CR><LF>
load:0x40080400,len:3792<CR><LF>
entry 0x40080694<CR><LF>
<ESC>_[0;32mI (29) boot: ESP-IDF v4.4-rc1-dirty 2nd stage bootloader<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: compile time 21:33:58<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: chip revision: 1<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (39) boot.esp32: SPI Speed      : 40MHz<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (44) boot.esp32: SPI Mode       : DIO<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (49) boot.esp32: SPI Flash Size : 4MB<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (53) boot: Enabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (59) boot: Partition Table:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (62) boot: ## Label            Usage          Type ST Offset   Length<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (69) boot:  0 nvs              WiFi data        01 02 00009000 00004000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (77) boot:  1 otadata          OTA data         01 00 0000d000 00002000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (84) boot:  2 phy_init         RF data          01 01 0000f000 00001000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (92) boot:  3 factory          factory app      00 00 00010000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (99) boot:  4 ota_0            OTA app          00 10 00110000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (107) boot:  5 ota_1            OTA app          00 11 00210000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (114) boot: End of partition table<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (119) boot: Defaulting to factory image<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (123) boot_comm: chip revision: 1, min. application chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (130) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=23c64h (146532) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (192) esp_image: segment 1: paddr=00033c8c vaddr=3ffb0000 size=03894h ( 14484) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (198) esp_image: segment 2: paddr=00037528 vaddr=40080000 size=08af0h ( 35568) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (213) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a17b8h (661432) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (452) esp_image: segment 4: paddr=000e17e0 vaddr=40088af0 size=0bf08h ( 48904) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (473) esp_image: segment 5: paddr=000ed6f0 vaddr=50000000 size=00010h (    16) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Loaded app from partition at offset 0x10000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Disabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (495) cpu_start: Pro cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (496) cpu_start: Starting app cpu, entry point is 0x400811e8<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (481) cpu_start: App cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Pro cpu start user code<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: cpu freq: 160000000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Application information:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (516) cpu_start: Project name:     azure_iot_freertos_esp32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (523) cpu_start: App version:      3e01d9e-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (528) cpu_start: Compile time:     Apr  5 2022 14:35:39<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (534) cpu_start: ELF file SHA256:  b76e6f709c13d9ec...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (540) cpu_start: ESP-IDF:          v4.4-rc1-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (546) heap_init: Initializing. RAM available for dynamic allocation:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (553) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (559) heap_init: At 3FFB9758 len 000268A8 (154 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (565) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (572) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (578) heap_init: At 400949F8 len 0000B608 (45 KiB): IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (586) spi_flash: detected chip: generic<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (589) spi_flash: flash io: dio<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (594) cpu_start: Starting scheduler on PRO CPU.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (0) cpu_start: Starting scheduler on APP CPU.<ESC>_[0m<CR><LF>
I (749) wifi:wifi driver task: 3ffaf6c8, prio:23, stack:6656, core=0<CR><LF>
<ESC>_[0;32mI (749) system_api: Base MAC address is not set<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (749) system_api: read default base MAC address from EFUSE<ESC>_[0m<CR><LF>
I (759) wifi:wifi firmware version: 7679c42<CR><LF>
I (759) wifi:wifi certification version: v7.0<CR><LF>
I (759) wifi:config NVS flash: enabled<CR><LF>
I (759) wifi:config nano formating: disabled<CR><LF>
I (769) wifi:Init data frame dynamic rx buffer num: 32<CR><LF>
I (769) wifi:Init management frame dynamic rx buffer num: 32<CR><LF>
I (779) wifi:Init management short buffer num: 32<CR><LF>
I (779) wifi:Init dynamic tx buffer num: 32<CR><LF>
I (789) wifi:Init static rx buffer size: 1600<CR><LF>
I (789) wifi:Init static rx buffer num: 10<CR><LF>
I (789) wifi:Init dynamic rx buffer num: 32<CR><LF>
<ESC>_[0;32mI (799) wifi_init: rx ba win: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (799) wifi_init: tcpip mbox: 32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: udp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp tx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp rx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp mss: 1440<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi RX IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) sample_azureiot: Connecting to Peepal...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07<ESC>_[0m<CR><LF>
I (949) wifi:mode : sta (58:bf:25:93:09:08)<CR><LF>
I (949) wifi:enable tsf<CR><LF>
<ESC>_[0;32mI (959) sample_azureiot: Waiting for IP(s)<ESC>_[0m<CR><LF>

05/04/2022 14:42:26.990 [RX] - I (2999) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1<CR><LF>
I (3759) wifi:state: init -> auth (b0)<CR><LF>
I (3769) wifi:state: auth -> assoc (0)<CR><LF>
I (3769) wifi:state: assoc -> run (10)<CR><LF>
I (3789) wifi:connected with Peepal, aid = 5, channel 6, BW20, bssid = 0c:8e:29:a0:ec:2a<CR><LF>
I (3789) wifi:security: WPA2-PSK, phy: bgn, rssi: -38<CR><LF>
I (3799) wifi:pm start, type: 1<CR><LF>
<CR><LF>
W (3819) wifi:<ba-add>idx:0 (ifx:0, 0c:8e:29:a0:ec:2a), tid:6, ssn:0, winSize:64<CR><LF>
W (3819) wifi:<ba-add>idx:1 (ifx:0, 0c:8e:29:a0:ec:2a), tid:0, ssn:2, winSize:64<CR><LF>
I (3849) wifi:AP's beacon interval = 102400 us, DTIM period = 3<CR><LF>

05/04/2022 14:42:29.123 [RX] - <ESC>_[0;32mI (5139) esp_netif_handlers: sample_azureiot: sta ip: 192.168.1.88, mask: 255.255.255.0, gw: 192.168.1.254<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (5139) sample_azureiot: Got IPv4 event: Interface "sample_azureiot: sta" address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (5149) sample_azureiot: Connected to sample_azureiot: sta<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (5149) sample_azureiot: - IPv4 address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (5159) sample_azureiot: my_json_string<CR><LF>
{<CR><LF>
<HT>	"A":<HT>	"testaccount",<CR><LF>
<HT>	"B":<HT>	"1",<CR><LF>
<HT>	"C":<HT>	"176.49.64.63",<CR><LF>
<HT>	"G":<HT>	"1.70",<CR><LF>
<HT>	"Irrigation":<HT>	true,<CR><LF>
<HT>	"Air":<HT>	false<CR><LF>
}<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (5169) sample_azureiot: Waiting for time synchronization with SNTP server<ESC>_[0m<CR><LF>

05/04/2022 14:42:33.204 [RX] - <ESC>_[0;32mI (9219) sample_azureiot: @@@@@Notification of a time synchronization event<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (10189) AZ IOT: Creating a TLS connection to global.azure-devices-provisioning.net:8883.<CR>
<CR><LF>
<ESC>_[0m<CR><LF>

05/04/2022 14:42:35.892 [RX] - <ESC>_[0;32mI (11909) tls_freertos: (Network connection 0x3ffc9b70) Connection to global.azure-devices-provisioning.net established.<ESC>_[0m<CR><LF>
<ESC>_[0;31mE (11909) AZ IOT: AzureIoTProvisioningClient_SetSymmetricKey failed: invalid argument<ESC>_[0m<CR><LF>
<CR><LF>
assert failed: prvIoTHubInfoGet sample_azure_iot_pnp.c:559 (xResult == eAzureIoTSuccess)<CR><LF>
<CR><LF>
<CR><LF>
Backtrace:0x40081a7e:0x3ffc99f00x400884d1:0x3ffc9a10 0x4008f5f9:0x3ffc9a30 0x400d88e3:0x3ffc9b50 0x400d8a1f:0x3ffc9bb0 0x4008bbcd:0x3ffc9c60 <CR><LF>
<CR><LF>
<CR><LF>
<CR><LF>
<CR><LF>
ELF file SHA256: b76e6f709c13d9ec<CR><LF>
<CR><LF>
Rebooting...<CR><LF>
ets Jun  8 2016 00:22:57<CR><LF>
<CR><LF>
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)<CR><LF>
configsip: 0, SPIWP:0xee<CR><LF>
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<CR><LF>
mode:DIO, clock div:2<CR><LF>
load:0x3fff0030,len:6616<CR><LF>
load:0x40078000,len:14780<CR><LF>
ho 0 tail 12 room 4<CR><LF>
load:0x40080400,len:3792<CR><LF>
entry 0x40080694<CR><LF>
<ESC>_[0;32mI (29) boot: ESP-IDF v4.4-rc1-dirty 2nd stage bootloader<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: compile time 21:33:58<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (29) boot: chip revision: 1<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (39) boot.esp32: SPI Speed      : 40MHz<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (44) boot.esp32: SPI Mode       : DIO<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (49) boot.esp32: SPI Flash Size : 4MB<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (53) boot: Enabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (59) boot: Partition Table:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (62) boot: ## Label            Usage          Type ST Offset   Length<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (69) boot:  0 nvs              WiFi data        01 02 00009000 00004000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (77) boot:  1 otadata          OTA data         01 00 0000d000 00002000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (84) boot:  2 phy_init         RF data          01 01 0000f000 00001000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (92) boot:  3 factory          factory app      00 00 00010000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (99) boot:  4 ota_0            OTA app          00 10 00110000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (107) boot:  5 ota_1            OTA app          00 11 00210000 00100000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (114) boot: End of partition table<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (119) boot: Defaulting to factory image<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (123) boot_comm: chip revision: 1, min. application chip revision: 0<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (130) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=23c64h (146532) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (192) esp_image: segment 1: paddr=00033c8c vaddr=3ffb0000 size=03894h ( 14484) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (198) esp_image: segment 2: paddr=00037528 vaddr=40080000 size=08af0h ( 35568) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (213) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a17b8h (661432) map<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (452) esp_image: segment 4: paddr=000e17e0 vaddr=40088af0 size=0bf08h ( 48904) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (473) esp_image: segment 5: paddr=000ed6f0 vaddr=50000000 size=00010h (    16) load<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Loaded app from partition at offset 0x10000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (483) boot: Disabling RNG early entropy source...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (495) cpu_start: Pro cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (496) cpu_start: Starting app cpu, entry point is 0x400811e8<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (482) cpu_start: App cpu up.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Pro cpu start user code<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: cpu freq: 160000000<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (512) cpu_start: Application information:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (516) cpu_start: Project name:     azure_iot_freertos_esp32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (523) cpu_start: App version:      3e01d9e-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (528) cpu_start: Compile time:     Apr  5 2022 14:35:39<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (534) cpu_start: ELF file SHA256:  b76e6f709c13d9ec...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (540) cpu_start: ESP-IDF:          v4.4-rc1-dirty<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (546) heap_init: Initializing. RAM available for dynamic allocation:<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (553) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (559) heap_init: At 3FFB9758 len 000268A8 (154 KiB): DRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (565) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (572) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (578) heap_init: At 400949F8 len 0000B608 (45 KiB): IRAM<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (586) spi_flash: detected chip: generic<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (589) spi_flash: flash io: dio<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (594) cpu_start: Starting scheduler on PRO CPU.<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (0) cpu_start: Starting scheduler on APP CPU.<ESC>_[0m<CR><LF>
I (749) wifi:wifi driver task: 3ffaf6c8, prio:23, stack:6656, core=0<CR><LF>
<ESC>_[0;32mI (749) system_api: Base MAC address is not set<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (749) system_api: read default base MAC address from EFUSE<ESC>_[0m<CR><LF>
I (759) wifi:wifi firmware version: 7679c42<CR><LF>
I (759) wifi:wifi certification version: v7.0<CR><LF>
I (759) wifi:config NVS flash: enabled<CR><LF>
I (759) wifi:config nano formating: disabled<CR><LF>
I (769) wifi:Init data frame dynamic rx buffer num: 32<CR><LF>
I (769) wifi:Init management frame dynamic rx buffer num: 32<CR><LF>
I (779) wifi:Init management short buffer num: 32<CR><LF>
I (779) wifi:Init dynamic tx buffer num: 32<CR><LF>
I (789) wifi:Init static rx buffer size: 1600<CR><LF>
I (789) wifi:Init static rx buffer num: 10<CR><LF>
I (789) wifi:Init dynamic rx buffer num: 32<CR><LF>
<ESC>_[0;32mI (799) wifi_init: rx ba win: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (799) wifi_init: tcpip mbox: 32<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: udp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp mbox: 6<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (809) wifi_init: tcp tx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp rx win: 5744<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (819) wifi_init: tcp mss: 1440<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (829) wifi_init: WiFi RX IRAM OP enabled<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) sample_azureiot: Connecting to Peepal...<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (839) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07<ESC>_[0m<CR><LF>
I (949) wifi:mode : sta (58:bf:25:93:09:08)<CR><LF>
I (949) wifi:enable tsf<CR><LF>
<ESC>_[0;32mI (959) sample_azureiot: Waiting for IP(s)<ESC>_[0m<CR><LF>

05/04/2022 14:42:38.927 [RX] - I (2999) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1<CR><LF>
I (3759) wifi:state: init -> auth (b0)<CR><LF>
I (3769) wifi:state: auth -> assoc (0)<CR><LF>
I (3769) wifi:state: assoc -> run (10)<CR><LF>
I (3799) wifi:connected with Peepal, aid = 5, channel 6, BW20, bssid = 0c:8e:29:a0:ec:2a<CR><LF>
I (3799) wifi:security: WPA2-PSK, phy: bgn, rssi: -36<CR><LF>
I (3799) wifi:pm start, type: 1<CR><LF>
<CR><LF>
W (3819) wifi:<ba-add>idx:0 (ifx:0, 0c:8e:29:a0:ec:2a), tid:6, ssn:0, winSize:64<CR><LF>
I (3899) wifi:AP's beacon interval = 102400 us, DTIM period = 3<CR><LF>

05/04/2022 14:42:40.338 [RX] - W (4409) wifi:<ba-add>idx:1 (ifx:0, 0c:8e:29:a0:ec:2a), tid:0, ssn:2, winSize:64<CR><LF>
<ESC>_[0;32mI (4639) esp_netif_handlers: sample_azureiot: sta ip: 192.168.1.88, mask: 255.255.255.0, gw: 192.168.1.254<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4639) sample_azureiot: Got IPv4 event: Interface "sample_azureiot: sta" address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4649) sample_azureiot: Connected to sample_azureiot: sta<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4649) sample_azureiot: - IPv4 address: 192.168.1.88<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4659) sample_azureiot: my_json_string<CR><LF>
{<CR><LF>
<HT>	"A":<HT>	"testaccount",<CR><LF>
<HT>	"B":<HT>	"1",<CR><LF>
<HT>	"C":<HT>	"176.49.64.63",<CR><LF>
<HT>	"G":<HT>	"1.70",<CR><LF>
<HT>	"Irrigation":<HT>	true,<CR><LF>
<HT>	"Air":<HT>	false<CR><LF>
}<ESC>_[0m<CR><LF>
<ESC>_[0;32mI (4669) sample_azureiot: Waiting for time synchronization with SNTP server<ESC>_[0m<CR><LF>

`

How to integrate the middleware into ESP32 Arduino projects?

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Create an Arduino project and add ESP32 Arduino to the Board manager.
Use the middleware source in the project codebase.

Expected/desired behavior

Middleware is available as a custom library.
Can successfully build and flash the project.

OS and Version?

Linux, preferaebly Arch. (Altough, the problem should be distro agnostic.)

Versions

The latest ESP32 Arduino Core.

Mention any other details that might be useful

I am planning to create an Arduino project in a reproducible and in a "click, build, flash, run" way. Meaning I can provide a repository with and Arduino project and the middleware (preferably as a submodule) with related dependencies. The sample ESP32 project in this repository is a very good example when explicitly using ESP-IDF, but I am a little lost how can I integrate this when using the Arduino IDE and the related Arduino API.


Thanks! We'll be in touch soon.

ADU ESPRESSIF ESP-IDF v4.4 Failed to open a new connection: 258

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Working with branch ota (/Azure-Samples/iot-middleware-freertos-samples/tree/ota/demos/projects/ESPRESSIF/adu)
Build with ESP-IDF v4.4, Create manifest and upload to storage account
Create/Update device update deployment with these files
Desired device twin is updated
Monitor device: device receives device twin update, tries to update, but is unable to connect to ADU instance endpoint to fetch files

Any log messages given by the failure

I (13790) AZ IOT: [ADU] Send property update.
I (13820) AZ IOT: [ADU] Invoke HTTP Connect Callback.
I (13820) AZ IOT: Connecting socket to wb24g01-d-adui--wb24g01-d-adu.b.nlu.dl.adu.microsoft.com
E (13820) TRANSPORT_BASE: Failed to open a new connection: 258
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Expected/desired behavior

Correctly update device, as it does when building with ESP-IDF v4.3

OS and Version?

Windows 11

Versions

ESP-IDF v4.3
ota branch

Mention any other details that might be useful

ESP32 Azure custom data transmissions

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow ESP32 connection to Azure guidelines with the firmware package (https://github.com/Azure-Samples/iot-middleware-freertos-samples/tree/main/demos/projects/ESPRESSIF/esp32), and a custom ESP32 PCB
Verify connection with Azure
Receiving transmissions from ESP32 board that read:

image

Any log messages given by the failure

No failure to report

Expected/desired behavior

I would like to send data collected from the custom ESP32 board (simple voltage readings from an ADC instead of the temperature data.
I connected the ESP32 to Azure, and the connection is verified with received data, using the no Plug and Play template. The device is currently registered as a thermometer.
What do I do to send the voltage readings from the ADC to Azure instead of the thermometer data? Is there a seperate device template from the thermometer template that will allow me to send custom data easier? Any sort of guidance in this process is appreciated.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10

Versions

ESP v4.4 updated, April 5th

Mention any other details that might be useful

The board connects, and I've read the voltage readings with accuracy to what is expected in a custom Python software. The hardware is not an issue here, as we are connected to Azure with no problem. I've transmitted the data over Wifi using sockets from the ESP32 board to a Python software, so the ADC data is accurate over WiFi as well. I'm new to Azure and am looking to transmit the same data over WiFi to Azure instead, and was hoping for some guidance in how to make this happen.

Thank you for any help


Thanks! We'll be in touch soon.

CCache error when building

There is an issue with CCache when building the code, giving a "file not found" since it can't generate the file at a long file name.

[ADU] Need to bring down HTTP download verbosity

I get verbose logs are important in bringing stuff up, but... the HTTP download logs for ADU are too much. For an 800KB image - which is large I get but we can handle bigger - I ended up with about 8000 lines of logs relating to the HTTP downloading.

This isn't just general cleanup. On the "DOS" terminal I'd just started ESP out of, there's a 9,999 line limit of how far the buffer will go back. (I'd assume Windows Terminal is better but if you just start ESP from Windows Start, you're put into old-school console mode.) So this could risk losing important log information being pushed out.

If HTTP is settled down, can we make this less chatty?

Failed to perform TLS handshake / example running on Linux PC

This issue is for a:

- [ x] bug report
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression

Minimal steps to reproduce

By following the guide for a Linux PC, I just run the executable with a
sudo ./build_linux/demos/projects/PC/linux/iot-middleware-sample

Any log messages given by the failure

[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:162] ---------STARTING DEMO---------
[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:171]
IP Address: 192.168.1.100
[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:174] Subnet Mask: 255.255.255.0
[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:177] Gateway Address: 192.168.1.1
[INFO] [AzureIoTDemo] [vApplicationIPNetworkEventHook:180] DNS Server Address: 1.1.1.1
[INFO] [AzureIoTDemo] [prvConnectToServerWithBackoffRetries:579] Creating a TLS connection to MYHOSTNAME:8883.
[ERROR] [TlsTransport] [tlsHandshake:573] Failed to perform TLS handshake: lMbedtlsError[-29312]= SSL - The connection indicated an EOF : .
[ERROR] [TlsTransport] [TLS_Socket_Connect:727] Failed to do TLS handshake 4.
[WARN] [AzureIoTDemo] [prvConnectToServerWithBackoffRetries:604] Connection to the IoT Hub failed [4]. Retrying connection with backoff and jitter [133]ms.
[INFO] [AzureIoTDemo] [prvConnectToServerWithBackoffRetries:579] Creating a TLS connection to MYHOSTNAME:8883.

Application continues with multiple retries, with the same error message

Expected/desired behavior

Device has been correctly setup with a SAS authentication method and device name, hostname and device primary key have been added in the demos/projects/PC/linux/config/demo_config.h file
#undef democonfigENABLE_DPS_SAMPLE has been added and democonfigCLIENT_CERTIFICATE_PEM commented out

OS and Version?

Running on Linux Debian 10, x86

Versions

source code from commit 9e83661 (current main branch)

Add new certs to Samples

Samples for middleware must have server certs updated as per C SDK and Embedded C SDK. They can't have only Baltimore, since this is about to be retired.

Tweaks to Linux setup readme

Some feedback on Linux sample landing.

  • Please remove code like comment out line #53 or line #138 references. We don't know how line numbering will change in future, so we should tell what to search for.

  • Do other samples reference specific line numbers, too? If so we should clean them up, too.

  • The last step calls for a run of ./build_linux/demos/projects/PC/linux/iot-middleware-sample.elf; however the generate executable when I just ran this doesn't end in .elf.

Kernal Panic Issue even with ESP-IDF V4.3

Kernal Panic Issue with ESP-IDF

I have tested same Kernal panic issue in V4.3 & V4.4 and below is the outcome.

Any log messages given by the failure

TELE Timer 0 Val is = 3930
TELE Timer 0 Val is = 3931
I (3932412) fota: Running Fota Stack!
E (3933392) tls_freertos: Reading failed, errno= 128
E (3933392) MQTT: A single byte was not read from the transport: transportStatus=-1.
E (3933392) MQTT: Receiving incoming packet length failed. Status=MQTTRecvFailed
E (3933402) MQTT: Exiting process loop due to failure: ErrorStatus=MQTTRecvFailed
E (3933412) AZ IOT: AzureIoTMQTT_ProcessLoop failed: ProcessLoopDuration=500, MQTT error=0x00000004

assert failed: lum_prvAzureDemoTask lum_app_esp32_provisioning.c:416 (xResult == eAzureIoTSuccess)

Backtrace:0x400816a3:0x3ffcea40 0x40089f95:0x3ffcea60 0x40090e7d:0x3ffcea80 0x400dad19:0x3ffceba0 0x4008d465:0x3ffcec50
0x400816a3: panic_abort at D:/Work/1-Projects/3-ESP-IDF-v4.3.3/Espressif/frameworks/esp-idf-v4.3.3/components/esp_system/panic.c:393

0x40089f95: esp_system_abort at D:/Work/1-Projects/3-ESP-IDF-v4.3.3/Espressif/frameworks/esp-idf-v4.3.3/components/esp_system/system_api.c:112

0x40090e7d: __assert_func at D:/Work/1-Projects/3-ESP-IDF-v4.3.3/Espressif/frameworks/esp-idf-v4.3.3/components/newlib/assert.c:85

0x400dad19: lum_prvAzureDemoTask at D:/Work/1-Projects/3-ESP-IDF-v4.3.3/Espressif/frameworks/esp-idf-v4.3.3/iot-middleware-freertos-samples/demos/projects/ESPRESSIF/aziotkit/components/lum_app/src/lum_app_esp32_provisioning.c:416 (discriminator 1)

0x4008d465: vPortTaskWrapper at D:/Work/1-Projects/3-ESP-IDF-v4.3.3/Espressif/frameworks/esp-idf-v4.3.3/components/freertos/port/xtensa/port.c:168

ELF file SHA256: 9e9b6aa864b62428

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:2
load:0x3fff0030,len:7568
load:0x40078000,len:14888
load:0x40080400,len:3688
0x40080400: _init at ??:?

entry 0x4008067c

OS and Version?

Windows 10.

[ADU] ESP32 ADU sample crashes and restart if wifi connection is killed

Please provide us with the following information:

Maybe the device could just go into a "reconnecting" state instead of restarting.

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run the ESP32 ADU sample and let it connect to IoT Hub
Kill the wifi hotspot

Any log messages given by the failure

TBD

Expected/desired behavior

Maybe the device should not crash, it should detect the disconnection and try to reconnect.

ESP32 keep rebooting after parttion change for OTA

Hi

I am using the ESP32 sample.

I would also like to add the OTA feature on my device so I can keep updating the IoT device in the field. Therefore I made a change to the partition to include OTA.

But now, the device keeps outputting the following and rebooting. Can someone advise why this happens?

Rebooting...<CR><LF>
ets Jun  8 2016 00:22:57<CR><LF>
<CR><LF>
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)<CR><LF>
configsip: 0, SPIWP:0xee<CR><LF>
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<CR><LF>
mode:DIO, clock div:2<CR><LF>
load:0x3fff0030,len:6608<CR><LF>
load:0x40078000,len:14780<CR><LF>
load:0x40080400,len:3792<CR><LF>
entry 0x40080694<CR><LF>
<ESC>�[0;32mI (27) boot: ESP-IDF v4.4-rc1 2nd stage bootloader<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (27) boot: compile time 21:23:30<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (27) boot: chip revision: 1<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (30) boot_comm: chip revision: 1, min. bootloader chip revision: 0<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (37) boot.esp32: SPI Speed      : 40MHz<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (42) boot.esp32: SPI Mode       : DIO<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (46) boot.esp32: SPI Flash Size : 4MB<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (51) boot: Enabling RNG early entropy source...<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (56) boot: Partition Table:<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (60) boot: ## Label            Usage          Type ST Offset   Length<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (67) boot:  0 nvs              WiFi data        01 02 00009000 00004000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (75) boot:  1 otadata          OTA data         01 00 0000d000 00002000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (82) boot:  2 phy_init         RF data          01 01 0000f000 00001000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (89) boot:  3 factory          factory app      00 00 00010000 00100000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (97) boot:  4 ota_0            OTA app          00 10 00110000 00100000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (104) boot:  5 ota_1            OTA app          00 11 00210000 00100000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (112) boot: End of partition table<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (116) boot: Defaulting to factory image<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (121) boot_comm: chip revision: 1, min. application chip revision: 0<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (128) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1fe8ch (130700) map<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (184) esp_image: segment 1: paddr=0002feb4 vaddr=3ffb0000 size=00164h (   356) load<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (184) esp_image: segment 2: paddr=00030020 vaddr=400d0020 size=96b40h (617280) map<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (413) esp_image: segment 3: paddr=000c6b68 vaddr=3ffb0164 size=03730h ( 14128) load<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (419) esp_image: segment 4: paddr=000ca2a0 vaddr=40080000 size=148d0h ( 84176) load<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (454) esp_image: segment 5: paddr=000deb78 vaddr=50000000 size=00010h (    16) load<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (464) boot: Loaded app from partition at offset 0x10000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (464) boot: Disabling RNG early entropy source...<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (476) cpu_start: Pro cpu up.<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (476) cpu_start: Starting app cpu, entry point is 0x400811dc<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (463) cpu_start: App cpu up.<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (493) cpu_start: Pr
07/03/2022 22:44:10.462 [RX] - o cpu start user code<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (493) cpu_start: cpu freq: 160000000<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (493) cpu_start: Application information:<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (497) cpu_start: Project name:     azure_iot_freertos_esp32<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (504) cpu_start: App version:      3e01d9e-dirty<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (509) cpu_start: Compile time:     Mar  5 2022 21:22:58<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (515) cpu_start: ELF file SHA256:  2d0f56704c94fb01...<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (521) cpu_start: ESP-IDF:          v4.4-rc1<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (527) heap_init: Initializing. RAM available for dynamic allocation:<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (534) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (540) heap_init: At 3FFB91F0 len 00026E10 (155 KiB): DRAM<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (546) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (552) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (559) heap_init: At 400948D0 len 0000B730 (45 KiB): IRAM<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (566) spi_flash: detected chip: generic<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (570) spi_flash: flash io: dio<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (575) cpu_start: Starting scheduler on PRO CPU.<ESC>�[0m<CR><LF>
<ESC>�[0;32mI (0) cpu_start: Starting scheduler on APP CPU.<ESC>�[0m<CR><LF>
ESP_ERROR_CHECK failed: esp_err_t 0x110d (ESP_ERR_NVS_NO_FREE_PAGES) at 0x4008839c<CR><LF>
file: "../main/azure_iot_freertos_esp32_main.c" line 278<CR><LF>
func: app_main<CR><LF>
expression: nvs_flash_init()<CR><LF>
<CR><LF>
abort() was called at PC 0x4008839f on core 0<CR><LF>
<CR><LF>
<CR><LF>
Backtrace:0x40081a4e:0x3ffbc6f00x400883a9:0x3ffbc710 0x4008f3d2:0x3ffbc730 0x4008839f:0x3ffbc7a0 0x400d7849:0x3ffbc7c0 0x40165331:0x3ffbc7e0 0x4008baa5:0x3ffbc800 <CR><LF>
<CR><LF>

Cannot launch VS Code debugger with STM32

Well, basically nothing works out of the box or by just simply following the instructions:

The first problem is that the PowerShell script simply doesn't work:

image

However, I was able to execute the script manually from the CMD and it successfully fetched the RTOS.

If I skip it I hit the problem with openocd:

image

I tried to add -s command to openocd:
image

I can launch it manually from the power shell:

image

OpenOCD folder looks like this:
image

PATH variable points to C:\ST\OpenOCD-20210729-0.11.0

I have noticed a weird thing...

image

why does it add '-s' and the root folder of the IoT project for the openocd cfg search path?

I couldn't find any JSON settings explicitly doing this.

After I copied folders from the openocd into the root of the project at least the debugger starts.

Since you guys went through this hassle can you see or possibly identify where the problem might be with all those things?

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.