• AVR Freaks

Hot!connect() keep returning error 119 - EINPROGRESS

Author
gilo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2010/08/12 06:04:47
  • Location: 0
  • Status: offline
2019/04/07 06:56:11 (permalink)
0

connect() keep returning error 119 - EINPROGRESS

Hi, 

Our 32MZ2048EFM100 MCU runs wolfmqtt-1.1.0 client with wolfssl-3.15.3 (TLSv1.2) on our customized company board (not an evaluation board). We are using Harmony v1.08 and configured it half-manually (without using the MPLAB Harmony configurator). 

The TCPIP communication is done over Microchip's berkeley sockets api. 

The client communicates with server perfectly except for a special scenario that we observe: 

The problem arises when we run a test that network shuts down (router is powered off and then back on again). When the network comes back again, sometimes the MCU fails to reconnect to network. 

After some exhausting debug (it does not reproduce every time) we discovered that "connect()" callback in file berkeley_api.c keep returning error 119 - EINPROGRESS forever and never recovers. 

I noticed that it usually happens when we power the router off after at least 20 minutes of continuous successful connection between client and MQTT server (called broker) without any data transfer (just MQTT keep alives). 

Can you please help me understand what the problem is? 

Regards, 

Gil
#1

1 Reply Related Threads

    aschen0866
    Super Member
    • Total Posts : 4423
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    Re: connect() keep returning error 119 - EINPROGRESS 2019/04/07 19:41:12 (permalink)
    0
    gilo
    ...When the network comes back again, sometimes the MCU fails to reconnect to network. ...

    I can only guess that in this scenario, sometimes you get a bogus DNS result from your router. Since the connect() call fails, that means the TLS handshake hasn't happened yet so the problem can't be at the TLS layer or the MQTT layer above.
     
    A network TAP device running Wireshark capture will definitely help you figure out what is going on.
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5