lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #59049] MQTT in FreeRTOS tasks give error on TCP-write


From: Dejan
Subject: [lwip-devel] [bug #59049] MQTT in FreeRTOS tasks give error on TCP-write/output
Date: Wed, 30 Sep 2020 13:58:18 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

Follow-up Comment #3, bug #59049 (project lwip):

Hi David, Andre,

I am having the same issue here. I am using Lwip + FreeRtos + Mqtt on
STM32F746 MCU. I have noticed strange behavior when packets to be sent by Mqtt
are bigger than one TCP packet (something like > 1450 bytes). Then in
mqtt_output_send() I have altcp_sndbuf(tcpb) returning ZERO. and nothing gets
send, and furthermore, my ringbuf gets filled-up by next consequential atempts
and eventualy I end up  with MEM ERROR (but this is product of the first
corruption of course. 

However to make things even worse, this only happens sometimes, and only
happens on public networks. On local network connection (to localhost MQTT
Broker) things work just fine for days and days.

As soon as I connect to public network on a dedicated broker (broker listening
just my device - NOT a PUBLIC BROKER but proprietary located on DigitalOcean
servers) the system works until the first MCU soft reset... when the library
simply would not send packets bigger than 1450 bytes anymore, or in other
words segmenting the big packet paylod to several will not even start cause
mqtt_output_send has issues and I cannot seem to catch what exacly happens,
its hard to debug even why altcp_sndbuf(tcpb) is returning ZERO??...

Obviously it not thread safe to call mqtt functions from third-party thread in
freertos, but I dont know what minimum effort I need to make to restructure
the code ... which thread I need to call my mqtt functions from?

I have this list of threads running in freertos:
IDLE
TCP/IP
DHCP
EthIf
HTTP
myMQTT

The last two are my tasks, and I call mqtt lib functions from myMQTT. 
I would happily restructure it and place it to any other thread but I would
appreciete any help on this on the minimal approach.

I am not at all an expert in lwip, so its even harder to trace things around
for me.

Please help


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?59049>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]