Open
Description
Hello!
Did you tried to send some MQTT messages with your driver/library using lwIP stack?
I tried myself but after sending a few I can't send anymore and get this errors (lwIP debug):
Sending test message signal
Test message signal sent
Reading signals of messages to be sent
tcp_write(pcb=2000A244, data=200035BF, len=17, apiflags=3)
tcp_write: queuelen: 0
pbuf_alloc(length=1460)
tcp_write : could not allocate memory for pbuf copy size 17
tcp_write: 0 (with mem err)
Failed to send data: -1
If decrease the payload of MQTT message (size of text), I'm able to send more messages before the problem occurs. It seems like some data is not cleaned somehow.
This is the way i send the message:
printf("Reading signals of messages to be sent\n");
uint32_t data = multicore_fifo_pop_blocking();
const char *pub_payload= "tsfdsdfsdfdsfdsfdsfdsfdsfdsfdsfdsfsdfdsfdsfdsfdsfsdfsdfsdfdsfdsdfsd";
err_t sent_error = mqtt_publish(mqtt_client, "iot_topic", pub_payload, strlen(pub_payload), 2, false, message_sent_cb, "cb1");
if (sent_error != ERR_OK) {
printf("Error sending MQTT message: %d\n", sent_error);
}
printf("Sending MQTT test message\n");
I use the same client to receive messages and seems to work without any problem.
Sorry if this is not the right place to post the message, but I'm sure if the problem is related with lwIP stack or your library. I'm still learning how this 2 work together.
<
396A
div height="40px" width="40px" class="Box-sc-g0xbh4-0 LoadingSkeleton-sc-695d630a-0 kqdiwS qthD">
Metadata
Metadata
Assignees
Labels
No labels