Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT message length issue #37

Closed
KimBoendergaard opened this issue May 24, 2019 · 4 comments
Closed

MQTT message length issue #37

KimBoendergaard opened this issue May 24, 2019 · 4 comments

Comments

@KimBoendergaard
Copy link

We have a problem receiving MQTT packages longer than approximately 280 bytes.
Any one having seen a similar problem?

@nrmka
Copy link

nrmka commented Jun 3, 2019

Hi @KimBoendergaard,

I have a similar issue. If complete twin ("desired" + "reported") is longer than 287 bytes, esp32 hangs on receiving it.
In my application I create task with connection to the cloud and updating twin. However, for some messages callback on twin update is never called.

I use low level functions:

void twinUpdateCallback(int statusCode, void* userContext)
{
    (void)userContext;
    printf("Twin update status: %d\r\n", statusCode);
    m_curMsgTxInProgress = false;
}

...
m_curMsgTxInProgress = true;
IoTHubDeviceClient_LL_SendReportedState(m_deviceHandle, (const unsigned char*)msg, strlen(msg), twinUpdateCallback, nullptr);
printf("Wait sent\n");
do
{
    IoTHubDeviceClient_LL_DoWork(m_deviceHandle);
    ThreadAPI_Sleep(100);
} while (m_curMsgTxInProgress);

The application sends my message to the cloud and I can see it there. But the app cannot leave do while.

I started logging in azure sdk and print buffer in mqtt_codec_bytesReceived() from mqtt_code.c. Here is log.txt.

@nrmka
Copy link

nrmka commented Jun 3, 2019

I tried this #39 and it helped me.

@KimBoendergaard
Copy link
Author

I fully agree. #39 fixes the problem. Let's hope the pull request gets merged in

@mahavirj
Copy link
Member

@KimBoendergaard @nrmka Sorry took us while for merging PR. Fixed with 5f421bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants