Open listout opened 2 years ago
I was able to fix the issue by adding the following defines in my main .c file
#define AWS_IOT_MQTT_CLIENT_ID "aws_esp32_test" ///< MQTT client ID should be unique for every device
#define AWS_IOT_MY_THING_NAME "aws_esp32_test" ///< Thing Name of the Shadow this device is associated with
It would be helpful for a newcomer like (and other) if the maintainers updated the readme about this. I'm sure there would be better method of solving the issue (like including an opting in menuconfig.
Thank you.
I have the same issue with examples thing_shadow and subscribe_publish
@listout can you share your main.c file ?
@listout , client id and thing name are indeed part of Kconfig option with some defaults. The default for client id is sufficient if your AWS IoT policy isn't strict. The README in example also mentions about changing the client id here if required. The Thing shadow example also mentions about thing name here. Can you elaborate what information you could not find in the READMEs?
@shahpiyushv Can you please verify examples are working?
@aleblsv , just tried the subscribe_publish example on esp32/esp32c3 with idf 4.3.1 and it is working fine for me.
I (776) wifi:mode : sta (3c:71:bf:ce:03:c0)
I (776) wifi:enable tsf
I (776) subpub: AWS IoT SDK Version 3.0.1-
I (1396) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (2116) wifi:state: init -> auth (b0)
I (2156) wifi:state: auth -> assoc (0)
I (2166) wifi:state: assoc -> run (10)
I (2256) wifi:connected with xxxxxxxx, aid = 2, channel 6, BW20, bssid = 6e:41:99:eb:ad:e1
I (2256) wifi:security: WPA2-PSK, phy: bgn, rssi: -47
I (2256) wifi:pm start, type: 1
I (2596) wifi:AP's beacon interval = 102400 us, DTIM period = 2
I (3566) esp_netif_handlers: sta ip: 192.168.74.253, mask: 255.255.255.0, gw: 192.168.74.71
I (3566) subpub: Connecting to AWS...
W (4586) wifi:<ba-add>idx:0 (ifx:0, 6e:41:99:eb:ad:e1), tid:0, ssn:3, winSize:64
I (8856) subpub: Subscribing...
I (9466) subpub: Stack remaining for task 'aws_iot_task' is 3588 bytes
I (11216) subpub: Subscribe callback
I (11216) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 0
I (11816) subpub: Subscribe callback
I (11816) subpub: test_topic/esp32 hello from ESP32 (QOS1) : 1
I (11916) subpub: Stack remaining for task 'aws_iot_task' is 3588 bytes
I (13256) subpub: Subscribe callback
I (13256) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 2
I (13866) subpub: Subscribe callback
I (13866) subpub: test_topic/esp32 hello from ESP32 (QOS1) : 3
I (13976) subpub: Stack remaining for task 'aws_iot_task' is 3588 bytes
I (15606) subpub: Subscribe callback
I (15616) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 4
I (16226) subpub: Subscribe callback
I (16226) subpub: test_topic/esp32 hello from ESP32 (QOS1) : 5
I (16326) subpub: Stack remaining for task 'aws_iot_task' is 3588 bytes
I (17656) subpub: Subscribe callback
I (17656) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 6
I (18276) subpub: Subscribe callback
I (18276) subpub: test_topic/esp32 hello from ESP32 (QOS1) : 7
I (18376) subpub: Stack remaining for task 'aws_iot_task' is 3588 bytes
Please remember to set the following
No other changes should be required if your AWS side configuration is also done correctly.
@shahpiyushv can you share your credentials certificate.pem.crt, private.pem.key, CONFIG_AWS_EXAMPLE_CLIENT_ID and CONFIG_AWS_IOT_MQTT_HOST ? Also can you attach the policy ? Thanks
@shahpiyushv I noticed missing line in my log (wifi:enable tsf). So, I have clean all configuration with idf.py set-target esp32 I'm using ESP32-WROVER-E Now I see the wifi:enable tsf and subscribe_publish example works as expected Thanks!
I (665) subpub: Setting WiFi configuration SSID xxxx...
I (665) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (775) wifi:mode : sta (10:52:1c:81:9c:d8)
I (775) wifi:enable tsf
I (775) subpub: AWS IoT SDK Version 3.0.1-
I (1745) wifi:new:<9,0>, old:<1,0>, ap:<255,255>, sta:<9,0>, prof:1
I (2475) wifi:state: init -> auth (b0)
I (2485) wifi:state: auth -> init (1c0)
I (2485) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1
I (4535) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1
I (4535) wifi:state: init -> auth (b0)
I (4545) wifi:state: auth -> assoc (0)
I (4555) wifi:state: assoc -> run (10)
I (4565) wifi:connected with xxxx, aid = 4, channel 9, BW20, bssid = e6:38:08:0b:5e:bf
I (4565) wifi:security: WPA2-PSK, phy: bgn, rssi: -59
I (4575) wifi:pm start, type: 1
I (4625) wifi:AP's beacon interval = 102400 us, DTIM period = 2
I (5565) esp_netif_handlers: sta ip: 192.168.181.115, mask: 255.255.255.0, gw: 192.168.181.183
I (5935) subpub: Connecting to AWS...
W (6465) wifi:
I've checked my certificates and keys, and everything works with a simple Arduino sketch. But I'm getting
E (15513) aws_iot: Failed ! mbedtls_ssl_read returned -0x7880
error when trying the subscribe_publish example. What am I doing wrong?mbedTLS debug log:
Thanks