AnsweredAssumed Answered

LWIP + ETH: Degrading performance

Question asked by Francisco Expósito on Apr 13, 2016
Latest reply on Apr 18, 2016 by Francisco Expósito
Hi everyone,

I’ve implemented a websocket client that runs on a STM32F4 with FreeRTOS and lwIP 1.4.1.

The client is supposed to send the machine status to the server each 5 seconds (plain text message).

I let the client run for 2.5 days and the result is the following:
       
  • After 2 hours running smoothly, the client starts experiencing delays. For example: it doesn’t send anything during 15 seconds and all of a sudden it sends 3  status messages in a 1 second period.
  •    
  • Things get worse until server raises a timeout and disconnects the client because it is not able to send anything in a 30 second period.
  •    
  • The client is able to reconnect, but (since delays persist) it is disconnected again by the server. I’ve got a ~ 12 hour period of connection/delay/disconnection.
  •    
  • After this period of instability, I’ve got a ~ 12 hour period during which everything runs smoothly (status messages are delivered each 5 seconds).
  •    
  • And so on so forth.
I logged everything: OS tasks memory and CPU consumption and LWIP stats. Everything seems to be fine:
       
  • OS tasks don’t run out of memory and CPU consumption is under control.
  •    
  • All lwIP memory indicators are below the “available” marker and they have no errors triggered.
  •    
  • lwIP sys indicators remain below the maximum level and no errors are triggered.
  •    
  • The only thing that points to an error is the ETHARP log:
       
             
    • XMIT remains stable at 5.
    •        
    • RECV counter increases until 65.461 and then drops to 0 (I assume it is a 16 bit counter).
    •        
    • CACHEHIT increases linearly.
    •        
    • PROTERR and DROP get regularly incremented until a final value of 28.
    •    
Asking into the lwIP mailing list, a user pointed me to this thread where a possible bug in the ST ETH driver is exposed.

Anyone has experienced a similar problem? Anyone has found a solution?

Thank you very much!

Fran



Outcomes