Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can I send the temperature sensor data to AWS IOT cloud using ESP32H2 and Homepod? (CON-1478) #1210

Open
GayathriHommi opened this issue Dec 16, 2024 · 7 comments

Comments

@GayathriHommi
Copy link

I am using ESP32h2, a temperature sensor, homepod and I'm using esp-matter code example- sensors for sending the temperature data to Homepod home application. I want to send this temperature data to AWS iot cloud through VScode can i get any reference code or documents

@github-actions github-actions bot changed the title Can I send the temperature sensor data to AWS IOT cloud using ESP32H2 and Homepod? Can I send the temperature sensor data to AWS IOT cloud using ESP32H2 and Homepod? (CON-1478) Dec 16, 2024
@pimpalemahesh
Copy link
Contributor

@GayathriHommi Please check out this repository for a head start: esp-rainmaker-common.
For more information related to MQTT with ESP-IDF, you can refer to this documentation. A similar approach can be implemented with ESP-Matter as well

@wqx6
Copy link
Contributor

wqx6 commented Dec 18, 2024

Hi, @GayathriHommi you can connect the ESP32-H2 to the cloud server with Homepod as the Apple Homepod supports the NAT64 feature. To use this feature your need to enable the following options in menuconfig:

CONFIG_OPENTHREAD_DNS64_CLIENT=y
CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM=y

After that you can use the common APIs to access Internet.

@pimpalemahesh
Copy link
Contributor

@GayathriHommi Please close the issue if it has been resolved.

@GayathriHommi
Copy link
Author

@wqx6 while trying to connect esp32h2 to aws iot i'm facing some issues but the same code is working fine with esp32s3

esp-tls: couldn't get hostname for :a1q5vtttjz7alq-ats.iot.ap-south-1.amazonaws.com: getaddrinfo() returns 202, addrinfo=0x0
E (90334) esp-tls: Failed to open new connection
E (90334) transport_base: Failed to open a new connection
E (90344) mqtt_client: Error transport connect

Are there any more changes to be made other than this
CONFIG_OPENTHREAD_DNS64_CLIENT=y
CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM=y

@GayathriHommi GayathriHommi reopened this Jan 16, 2025
@wqx6
Copy link
Contributor

wqx6 commented Jan 22, 2025

@wqx6 while trying to connect esp32h2 to aws iot i'm facing some issues but the same code is working fine with esp32s3

Are you using Homepod as the Thread BR for your Thread network? Note that Thread Border Router should support NAT64 so that the End device can resolve an URL's IP address. Currently Homepod supports NAT64 but Nesthub doesn't. Did the ESP32-H2 join the thread network of TBR? Could you upload the log file of ESP32-H2?

Are there any more changes to be made other than this

No, these configurations are enough for a Thread node to connect Internet.

@GayathriHommi
Copy link
Author

GayathriHommi commented Feb 9, 2025

ESP-ROM:esp32h2-20221101
Build:Nov 1 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x408460e0,len:0x17ac
load:0x4083cfd0,len:0xf04
load:0x4083efd0,len:0x2ca4
entry 0x4083cfda
I (23) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (24) boot: compile time Feb 9 2025 22:00:29
I (25) boot: chip revision: v0.2
I (27) boot.esp32h2: SPI Speed : 64MHz
I (31) boot.esp32h2: SPI Mode : DIO
I (36) boot.esp32h2: SPI Flash Size : 4MB
I (41) boot: Enabling RNG early entropy source...
I (46) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (57) boot: 0 esp_secure_cert unknown 3f 06 0000d000 00002000
I (64) boot: 1 nvs WiFi data 01 02 00010000 0000c000
I (72) boot: 2 nvs_keys NVS keys 01 04 0001c000 00001000
I (79) boot: 3 otadata OTA data 01 00 0001d000 00002000
I (87) boot: 4 phy_init RF data 01 01 0001f000 00001000
I (94) boot: 5 ota_0 OTA app 00 10 00020000 001e0000
I (102) boot: 6 ota_1 OTA app 00 11 00200000 001e0000
I (109) boot: 7 fctry WiFi data 01 02 003e0000 00006000
I (117) boot: End of partition table
I (121) esp_image: segment 0: paddr=00020020 vaddr=42150020 size=43120h (274720) map
I (214) esp_image: segment 1: paddr=00063148 vaddr=40800000 size=0ced0h ( 52944) load
I (233) esp_image: segment 2: paddr=00070020 vaddr=42000020 size=14ae3ch (1355324) map
I (646) esp_image: segment 3: paddr=001bae64 vaddr=4080ced0 size=053f8h ( 21496) load
I (655) esp_image: segment 4: paddr=001c0264 vaddr=408122d0 size=02378h ( 9080) load
I (659) esp_image: segment 5: paddr=001c25e4 vaddr=50000000 size=00004h ( 4) load
I (666) boot: Loaded app from partition at offset 0x20000
I (667) boot: Disabling RNG early entropy source...
I (684) cpu_start: Unicore app
W (693) clk: esp_perip_clk_init() has not been implemented yet
I (699) cpu_start: Pro cpu start user code
I (700) cpu_start: cpu freq: 96000000 Hz
I (700) cpu_start: Application information:
I (702) cpu_start: Project name: sensors
I (707) cpu_start: App version: 1.0
I (712) cpu_start: Compile time: Feb 9 2025 22:16:27
I (718) cpu_start: ELF file SHA256: 2094d880d...
I (723) cpu_start: ESP-IDF: v5.2.1
I (728) cpu_start: Min chip rev: v0.0
I (733) cpu_start: Max chip rev: v0.99
I (738) cpu_start: Chip rev: v0.2
I (743) heap_init: Initializing. RAM available for dynamic allocation:
I (750) heap_init: At 4082B800 len 00021B80 (134 KiB): RAM
I (756) heap_init: At 4084D380 len 00002B60 (10 KiB): RAM
I (763) spi_flash: detected chip: generic
I (767) spi_flash: flash io: dio
W (771) eFuse: calibration efuse version does not match, set default version to 0
W (785) eFuse: calibration efuse version does not match, set default version to 0
W (787) eFuse: calibration efuse version does not match, set default version to 0
W (795) eFuse: calibration efuse version does not match, set default version to 0
W (803) eFuse: calibration efuse version does not match, set default version to 0
W (812) eFuse: calibration efuse version does not match, set default version to 0
W (820) eFuse: calibration efuse version does not match, set default version to 0
W (834) eFuse: calibration efuse version does not match, set default version to 0
W (836) eFuse: calibration efuse version does not match, set default version to 0
W (844) eFuse: calibration efuse version does not match, set default version to 0
W (852) eFuse: calibration efuse version does not match, set default version to 0
W (861) eFuse: calibration efuse version does not match, set default version to 0
W (869) eFuse: calibration efuse version does not match, set default version to 0
W (883) eFuse: calibration efuse version does not match, set default version to 0
W (885) eFuse: calibration efuse version does not match, set default version to 0
W (893) eFuse: calibration efuse version does not match, set default version to 0
W (901) eFuse: calibration efuse version does not match, set default version to 0
W (909) eFuse: calibration efuse version does not match, set default version to 0
W (918) eFuse: calibration efuse version does not match, set default version to 0
W (932) eFuse: calibration efuse version does not match, set default version to 0
W (934) eFuse: calibration efuse version does not match, set default version to 0
W (942) eFuse: calibration efuse version does not match, set default version to 0
W (950) eFuse: calibration efuse version does not match, set default version to 0
W (958) eFuse: calibration efuse version does not match, set default version to 0
W (967) i2c: This driver is an old driver, please migrate your application code to adapt driver/i2c_master.h
I (978) sleep: Configure to isolate all GPIO pins in sleep state
I (984) sleep: Enable automatic switching of GPIO sleep configuration
I (991) coexist: coex firmware version: 77cd7f8
I (997) main_task: Started on CPU0
I (997) main_task: Calling app_main()
I (1027) button: IoT Button Version: 3.5.0
I (1027) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1037) shtc3: shtc3 initialized successfully
I (1047) gpio: GPIO[3]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
W (1047) esp_matter_core: Server Cluster 0x0000001D on endpoint 0x0000 already exists. Not creating again.
W (1057) esp_matter_core: Attribute 0x00000000 on cluster 0x0000001D already exists. Not creating again.
W (1067) esp_matter_core: Attribute 0x00000001 on cluster 0x0000001D already exists. Not creating again.
W (1077) esp_matter_core: Attribute 0x00000002 on cluster 0x0000001D already exists. Not creating again.
W (1087) esp_matter_core: Attribute 0x00000003 on cluster 0x0000001D already exists. Not creating again.
W (1097) esp_matter_core: Attribute 0x0000FFFC on cluster 0x0000001D already exists. Not creating again.
W (1107) esp_matter_core: Attribute 0x0000FFFD on cluster 0x0000001D already exists. Not creating again.
I (1147) chip[DL]: NVS set: chip-counters/reboot-count = 4 (0x4)
I (1147) chip[DL]: Real time clock set to 946684800 (0100/00/01 00:00:00 UTC)
I (1147) BLE_INIT: Using main XTAL as clock source
I (1157) OPENTHREAD: Host connection mode none
I (1167) BLE_INIT: ble controller commit:[217f1bf]
I (1167) phy: phy_version: 230,2, 9aae6ea, Jan 15 2024, 11:17:12
I (1167) phy: libbtbb version: 944f18e, Jan 15 2024, 11:17:25
I (1197) NimBLE: GAP procedure initiated: stop advertising.

I (1197) NimBLE: Failed to restore IRKs from store; status=8

I (1197) CHIP[DL]: BLE host-controller synced
I (1217) OPENTHREAD: OpenThread attached to netif
I(1217) OPENTHREAD:[N] Mle-----------: Role disabled -> detached
I (1237) chip[DL]: OpenThread ifconfig up and thread start
I (1237) chip[DL]: OpenThread started: OK
I (1237) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1247) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1247) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1257) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1267) chip[DL]: Setting OpenThread device type to ROUTER
I (1287) OT_STATE: netif up
I(1557) OPENTHREAD:[N] Mle-----------: Role detached -> router
I(1557) OPENTHREAD:[N] Mle-----------: Partition ID 0x2f9f9ff3
I (1607) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1607) chip[DL]: Posting ESPSystemEvent: IP Event with eventId : 3
I (1617) chip[DL]: SRP Client was started, detected server: fdaa:7ea8:f74a:fb26:0000:00ff:fe00:fc11
I (1627) OT_STATE: Set dns server address: FDEE:40D5:7DBE:FFFF::808:808
E (1717) chip[DMG]: Endpoint 0, Cluster 0x0000_0031 not found in IncreaseClusterDataVersion!
E (1717) chip[DMG]: Endpoint 0, Cluster 0x0000_0031 not found in IncreaseClusterDataVersion!
I (1727) chip[SVR]: Subscription persistence not supported
I (1737) chip[SVR]: Server initializing...
I (1737) chip[TS]: Last Known Good Time: 2025-02-09T17:15:09
I (1747) chip[FP]: Fabric index 0x1 was retrieved from storage. Compressed FabricId 0x4E70FEE47DA606EF, FabricId 0x000000003994C3F7, NodeId 0x00000000911611E3, VendorId 0x1349
I (1767) chip[FP]: Fabric index 0x2 was retrieved from storage. Compressed FabricId 0x4A1C9AE1031C1E83, FabricId 0x000000007F33EB20, NodeId 0x0000000027A222BE, VendorId 0x1384
I (1777) chip[DMG]: AccessControl: initializing
I (1787) chip[DMG]: Examples::AccessControlDelegate::Init
I (1787) chip[DMG]: AccessControl: setting
I (1797) chip[DMG]: DefaultAclStorage: initializing
I (1797) chip[DMG]: DefaultAclStorage: 2 entries loaded
I (1807) chip[SVR]: WARNING: mTestEventTriggerDelegate is null
I (1827) chip[ZCL]: Using ZAP configuration...
I (1837) esp_matter_cluster: Cluster plugin init common callback
I (1837) chip[DMG]: AccessControlCluster: initializing
I (1837) chip[ZCL]: 0x42155d2c ep 0 clus 0x0000_0030 attr 0x0000_0000 not supported
I (1847) chip[ZCL]: Initiating Admin Commissioning cluster.
I (1857) chip[SVR]: Fabric already commissioned. Disabling BLE advertisement
I (1857) chip[IN]: CASE Server enabling CASE session setups
I (1867) chip[SVR]: Joining Multicast groups
I (1877) chip[SVR]: Server Listening...
I (1877) chip[DIS]: Updating services using commissioning mode 0
E (1887) chip[DIS]: Failed to remove advertised services: 3
I (1887) chip[DIS]: Advertise operational node 4E70FEE47DA606EF-00000000911611E3
E (1897) chip[DIS]: Failed to advertise operational node: 3
I (1907) chip[DIS]: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=0 cp=0
E (1917) chip[DIS]: Failed to advertise extended commissionable node: 3
E (1927) chip[DIS]: Failed to finalize service update: 3
I (1927) esp_matter_core: Dynamic endpoint 0 added
I (1937) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000003's Attribute 0x00000001 is 0 **********
I (1947) esp_matter_core: Dynamic endpoint 1 added
I (1957) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000003's Attribute 0x00000001 is 0 **********
I (1967) esp_matter_core: Dynamic endpoint 2 added
I (1967) esp_matter_attribute: ********** R : Endpoint 0x0003's Cluster 0x00000003's Attribute 0x00000001 is 0 **********
I (1977) esp_matter_attribute: ********** R : Endpoint 0x0003's Cluster 0x00000406's Attribute 0x00000001 is 0 **********
I (1987) esp_matter_attribute: ********** R : Endpoint 0x0003's Cluster 0x00000406's Attribute 0x00000002 is 1 **********
I (2007) esp_matter_core: Dynamic endpoint 3 added
E (2017) system_api: 0 mac type is incorrect (not found)
I (2027) AWS_IOT: Unhandled event ID
I (2027) main_task: Returned from app_main()
I (2497) chip[DIS]: Updating services using commissioning mode 0
I (2497) chip[DIS]: Advertise operational node 4E70FEE47DA606EF-00000000911611E3
I (2497) chip[DL]: advertising srp service: 4E70FEE47DA606EF-00000000911611E3._matter._tcp
I (2507) chip[DIS]: Advertise operational node 4A1C9AE1031C1E83-0000000027A222BE
I (2517) chip[DL]: advertising srp service: 4A1C9AE1031C1E83-0000000027A222BE._matter._tcp
I (2527) chip[DIS]: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=0 cp=0
I (2537) chip[DL]: advertising srp service: E0DD8F70EB73C473._matterc._udp
I (2547) chip[SVR]: Server initialization complete
I (2547) chip[SWU]: Stopping the watchdog timer
I (2557) chip[SWU]: Starting the periodic query timer, timeout: 86400 seconds
I (2557) esp_matter_attribute: ********** R : Endpoint 0x0000's Cluster 0x0000002A's Attribute 0x00000002 is 0 **********
I (2577) esp_matter_attribute: ********** R : Endpoint 0x0000's Cluster 0x0000002A's Attribute 0x00000002 is 0 **********
I (2587) esp_matter_attribute: ********** W : Endpoint 0x0000's Cluster 0x0000002A's Attribute 0x00000002 is 1 **********
I (2677) esp_matter_attribute: ********** R : Endpoint 0x0000's Cluster 0x0000002A's Attribute 0x00000003 is null **********
I (7037) shtc3: Temperature Raw= 0,0
I (10037) shtc3: humidity Raw= 0,0
I (10037) shtc3: t float= -47.349998
I (10037) shtc3: RH float= 4294967296.000000
I (10037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is null **********
I (10047) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (10057) app_main: AWS_temp -47.349998
I (10067) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
I (12037) shtc3: Temperature Raw= 0,0
I (15037) shtc3: humidity Raw= 0,0
I (15037) shtc3: t float= -47.349998
I (15037) shtc3: RH float= 4294967296.000000
I (15037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (15047) app_main: AWS_temp -47.349998
I (15047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
W (16507) esp-tls: Failed to open new connection in specified timeout
E (16507) transport_base: Failed to open a new connection
E (16507) mqtt_client: Error transport connect
I (16507) AWS_IOT: Unhandled event ID
W (16517) AWS_IOT: MQTT disconnected, retrying...
I (16517) mqtt_client: Client force reconnect requested
I (16527) AWS_IOT: Unhandled event ID
I (17037) shtc3: Temperature Raw= 0,0
I (20037) shtc3: humidity Raw= 0,0
I (20037) shtc3: t float= -47.349998
I (20037) shtc3: RH float= 4294967296.000000
I (20037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (20047) app_main: AWS_temp -47.349998
I (20047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
I (22037) shtc3: Temperature Raw= 0,0
I (25037) shtc3: humidity Raw= 0,0
I (25037) shtc3: t float= -47.349998
I (25037) shtc3: RH float= 4294967296.000000
I (25037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (25047) app_main: AWS_temp -47.349998
I (25047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
I (27037) shtc3: Temperature Raw= 0,0
I (30037) shtc3: humidity Raw= 0,0
I (30037) shtc3: t float= -47.349998
I (30037) shtc3: RH float= 4294967296.000000
I (30037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (30047) app_main: AWS_temp -47.349998
I (30047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
W (30397) esp-tls: Failed to open new connection in specified timeout
E (30397) transport_base: Failed to open a new connection
E (30397) mqtt_client: Error transport connect
I (30397) AWS_IOT: Unhandled event ID
W (30407) AWS_IOT: MQTT disconnected, retrying...
I (30407) mqtt_client: Client force reconnect requested
I (30417) AWS_IOT: Unhandled event ID
I (32037) shtc3: Temperature Raw= 0,0
I (35037) shtc3: humidity Raw= 0,0
I (35037) shtc3: t float= -47.349998
I (35037) shtc3: RH float= 4294967296.000000
I (35037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (35047) app_main: AWS_temp -47.349998
I (35047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
W(36517) OPENTHREAD:[W] Mle-----------: Failed to process UDP: Duplicated
W(36527) OPENTHREAD:[W] Mle-----------: Failed to process UDP: Duplicated
I (37037) shtc3: Temperature Raw= 0,0
I (40037) shtc3: humidity Raw= 0,0
I (40037) shtc3: t float= -47.349998
I (40037) shtc3: RH float= 4294967296.000000
I (40037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (40047) app_main: AWS_temp -47.349998
I (40047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
I (42037) shtc3: Temperature Raw= 0,0
I (45037) shtc3: humidity Raw= 0,0
I (45037) shtc3: t float= -47.349998
I (45037) shtc3: RH float= 4294967296.000000
I (45037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (45047) app_main: AWS_temp -47.349998
I (45047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
W (45707) esp-tls: Failed to open new connection in specified timeout
E (45707) transport_base: Failed to open a new connection
E (45707) mqtt_client: Error transport connect
I (45707) AWS_IOT: Unhandled event ID
W (45717) AWS_IOT: MQTT disconnected, retrying...
I (45717) mqtt_client: Client force reconnect requested
I (45727) AWS_IOT: Unhandled event ID
I (47037) shtc3: Temperature Raw= 0,0
E (49707) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x4310
I (49707) esp-tls-mbedtls: Certificate verified.
E (49707) esp-tls: Failed to open new connection
E (49707) transport_base: Failed to open a new connection
E (49717) mqtt_client: Error transport connect
I (49727) AWS_IOT: Unhandled event ID
W (49727) AWS_IOT: MQTT disconnected, retrying...
I (49737) mqtt_client: Client force reconnect requested
I (49737) AWS_IOT: Unhandled event ID
I (50037) shtc3: humidity Raw= 0,0
I (50037) shtc3: t float= -47.349998
I (50037) shtc3: RH float= 4294967296.000000
I (50037) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000402's Attribute 0x00000000 is -4735 **********
E (50047) app_main: AWS_temp -47.349998
I (50047) esp_matter_attribute: ********** R : Endpoint 0x0002's Cluster 0x00000405's Attribute 0x00000000 is null **********
I (52037) shtc3: Temperature Raw= 0,0

@GayathriHommi
Copy link
Author

homepod is of latest model MQJ73HNJA, device connected to thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants