Closed SamsTheNerd closed 4 years ago
Turns out it was due to a scope issue with the republishedShadowTopic variable. It was solved by moving the variable declaration outside of the loop and into the global area. There's more information here if anyone else has this problem
My Code:
` if (device.connect(HOST_ADDRESS, const_cast<char*>(client_id.c_str())) == 0) { Serial.println("Connected To AWS"); delay(1000);
I have 3 topics that I subscribe to and two of them are based off of the username, which changes based on device/user. My testchannel and getAcceptedTopic topics receive messages just fine but the republishedShadowTopic does not receive any messages. If i change it from the republishedShadowTopic variable to the string literal "Lamp/user/rs" in the subscribe method, then it works fine. I'm using the AWS IoT console and I can see that all of the messages and sent but the device is just not receiving them. I'm really not sure what this is because it seems like it should work based on the getAcceptedTopic topic working and being declared the same way? I can send the same messages through and have the same results on each topic respectively, so I know that it doesn't have to do with the message contents. Thanks for any help :)