I'm working on a project where the ESP32 connects to wifi, gathers data from its sensors, converts sensor data to units, compiles a MQTT message, connects to AWS IoT, and publishes it to a topic. It connects to Wifi just fine, and I am able to see it on my router. The 3 key and cred files are in its proper directory, but I keep getting this error message:
Code: Select all
I (293) wifi: wifi firmware version: 59e5fab
I (293) wifi: config NVS flash: enabled
I (293) wifi: config nano formating: disabled
I (293) system_api: Base MAC address is not set, read default base MAC address f
rom BLK0 of EFUSE
I (303) system_api: Base MAC address is not set, read default base MAC address f
rom BLK0 of EFUSE
I (333) wifi: Init dynamic tx buffer num: 32
I (333) wifi: Init data frame dynamic rx buffer num: 32
I (333) wifi: Init management frame dynamic rx buffer num: 32
I (343) wifi: wifi driver task: 3ffbf0e0, prio:23, stack:4096
I (343) wifi: Init static rx buffer num: 10
I (343) wifi: Init dynamic rx buffer num: 32
I (353) wifi: wifi power manager task: 0x3ffc5460 prio: 21 stack: 2560
I (363) subpub: Setting WiFi configuration SSID TP-LINK_46DD56...
W (363) phy_init: failed to load RF calibration data (0x1102), falling back to f
ull calibration
I (533) phy: phy_version: 366.0, ba9923d, Oct 31 2017, 18:06:17, 0, 2
I (543) wifi: mode : sta (30:ae:a4:02:49:44)
I (1273) wifi: n:6 2, o:1 0, ap:255 255, sta:6 2, prof:1
I (1573) gps: CHAR ?`?8
Latitude is , . Longitude is , .
before
I (2253) wifi: state: init -> auth (b0)
after
fail to read from sensor
I (2253) subpub: AWS IoT SDK Version 2.1.1-
I (2253) wifi: state: auth -> assoc (0)
I (2263) wifi: state: assoc -> run (10)
I (2423) wifi: connected with TP-LINK_46DD56, channel 6
I (4233) event: sta ip: 192.168.0.101, mask: 255.255.255.0, gw: 192.168.0.254
I (4233) subpub: Connecting to AWS...
E (4403) aws_iot: failed! mbedtls_net_connect returned -0x52
E (4403) subpub: Error(-23) connecting to :8883
I (5263) wifi: pm start, type:0
E (5563) aws_iot: failed! mbedtls_net_connect returned -0x52
E (5563) subpub: Error(-23) connecting to :8883
E (6723) aws_iot: failed! mbedtls_net_connect returned -0x52
E (6723) subpub: Error(-23) connecting to :8883
E (7883) aws_iot: failed! mbedtls_net_connect returned -0x52
E (7883) subpub: Error(-23) connecting to :8883
E (9043) aws_iot: failed! mbedtls_net_connect returned -0x52
E (9043) subpub: Error(-23) connecting to :8883
E (10203) aws_iot: failed! mbedtls_net_connect returned -0x52
E (10203) subpub: Error(-23) connecting to :8883