publish works well, but subscribe does not work.
aws_iot_mqtt_subscribe(&client, SUB_TOPIC, SUB_TOPIC_LEN, QOS0, iot_subscribe_callback_handler, NULL) returns SUCCESS, but iot_subscribe_callback_handler callback function is not called when I publish to topic "1" in the aws iot console.
Of course, I set SUB_TOPIC to "1" and remainders(CA, policy, attach and so on..) appropriately.
Ia not AWS Iot subscribe implemented yet?
it is impossible to subscribe in the aws_iot/subscribe_publish example..
Re: it is impossible to subscribe in the aws_iot/subscribe_publish example..
Hi JoonDong,
Subscribe is supported. The example works for me (unmodified) on the current master branch. ie if I log into AWS IoT Console and subscribe to "test_topic/esp32" then I see the "hello from ESP32" messages published from the ESP32, and if I then click the "Publish to Topic" button in the console then I see that message in the ESP32 console.
It looks like you're running different code to the example, though. If you're still have problems, please post your full code and we can take a look.
Angus
Subscribe is supported. The example works for me (unmodified) on the current master branch. ie if I log into AWS IoT Console and subscribe to "test_topic/esp32" then I see the "hello from ESP32" messages published from the ESP32, and if I then click the "Publish to Topic" button in the console then I see that message in the ESP32 console.
Code: Select all
I (217435) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 164
I (217625) subpub: Subscribe callback
I (217625) subpub: test_topic/esp32 {
"message": "Hello from AWS IoT console"
}
I (218105) subpub: Subscribe callback
I (218105) subpub: test_topic/esp32 hello from ESP32 (QOS1) : 165
I (218195) subpub: -->sleep
I (219855) subpub: Subscribe callback
I (219855) subpub: test_topic/esp32 hello from ESP32 (QOS0) : 166
Angus
Who is online
Users browsing this forum: devlat and 118 guests