MQTT Library v2.0.0
Hello guys, this is my first post on this forum.
The last 2 weeks I've been working on an MQTT application. I'm using the microchip AVR IoT development board with the ATMega4808 mcu. Although this board was developed for an cloud mqtt connection I'm using the MQTT Library v2.0.0 to build my own application in my local home network. I have an MQTT broker installed on an Raspberry Pi also running Openhab.
I am able to make a connection to the Broker and publish messages on a specific topic. This all works fine. However when I try to subscribe to a topic things go wrong. After sending the subscribe message I never get a subscribe acknowledgement from the Broker. Because connection and publishing is working fine I'm guessing the problem is with my mcu applicaiton.
Below my code to build the subscribe packet:
static void app_buildSubscribePacket(void)
uint8_t topicCount = 0;
//memset(&appSubscribePacket, 0, sizeof(mqttSubscribePacket));
appSubscribePacket.packetIdentifierLSB = 11;
appSubscribePacket.packetIdentifierMSB = 0;
for(topicCount = 0; topicCount < NUM_TOPICS_SUBSCRIBE; topicCount++)
uint16_t topicLen = strlen(mqttSubscribeTopic);
appSubscribePacket.subscribePayload[topicCount].topic = (uint8_t *)mqttSubscribeTopic;
appSubscribePacket.subscribePayload[topicCount].topicLength = topicLen;
appSubscribePacket.subscribePayload[topicCount].requestedQoS = 0;
if(MQTT_CreateSubscribePacket(&appSubscribePacket) == true)
subscribed = true;
Is there anybody already using the MQTT Library v2.0.0. There are no posts on this forum about it. I'm currently troubleshooting the Library code but so for haven't found any problems. The only unusual thing I came up on was that the topic lengths were very long. But this is also the case for the publish packets which work fine...
All help is very welcome...!
Thanks in advance,