This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Internet Down event (using LWIP stack with LM3S6432 controller)

Other Parts Discussed in Thread: LM3S6432

I have used lwIP TCP/IP stack with LM3S6432 CONTROLLER.(S2E referenace kit).

This is part of revision 8555 of the RDK-S2E Firmware Package.

I have problem regarding internet link down and step is below:

1. I am able to get DHCP IP (local IP) using this stack.

2. I also able to get our online server IP using URL "XYZ.com" (using DNS)

3. I am able to connect with our server using HTTP (server port - 80)

4. our device communicate with our online server.

5.sometimes internet link get down and our device not able to detect this internet link down event.

Can we detect internet link down event into lwIP TCP/IP stack with LM3S6432 CONTROLLER?

  • Hi,

    Any one have idea regarding internet connection event and internet disconnection event using LWIP stack and stellaris LM3S6432 controller?

    Thanks in advance for any suggession.

  • I'm using Stellarisware and lwip on LM3S9D96.

    I have implemented this to detect link down:

    void
    lwIPHostTimerHandler(void)
    {
      unsigned long ulIPAddress;
      int bLinkStatusUp;

      ulIPAddress = lwIPLocalIPAddrGet();

      bLinkStatusUp = ((ROM_EthernetPHYRead(ETH_BASE, PHY_MR1) & PHY_MR1_LINK) == 0) ? false : true;
      if (bLinkStatusUp != g_bLinkStatusUp)
      {
        //
        // Save the new link status.
        //
        g_bLinkStatusUp = bLinkStatusUp;

        if(!bLinkStatusUp)
        {
          if(g_pfnLWIPStatus)
          g_pfnLWIPStatus(TCPIP_STATUS_DISCONNECTED);
        }
        else
        {
          if(ulLastIPAddress)
          {
            if(g_pfnLWIPStatus)
              g_pfnLWIPStatus(TCPIP_STATUS_READY);
          }
        }
      }

      //
      // Check if IP address has changed
      //
      if(ulLastIPAddress != ulIPAddress)
      {
        ulLastIPAddress = ulIPAddress;
        ulIPAddress = lwIPLocalNetMaskGet();
        ulIPAddress = lwIPLocalGWAddrGet();

        if(g_pfnLWIPStatus)
          g_pfnLWIPStatus(TCPIP_STATUS_READY);
      }
    }

     

  • hi,

    thanks for your valuable reply. but i havn't issue related to local IP link. I have issue related to internet connectivity. that time I have local link but only internet connection is down.

    please see below example related my issue.

    1. My device is connected with router through RJ-45 cable. i got internet connectivity through router.

    2. if i remove WAN cable then my device lose internet connectivity and failed to online communication. that time I have local IP because that ip assign by router.so i havn't any problem related to local IP and local LINK.

    3. I have issue related to online(intrnet) communication stop. because WAN cable remove from router so all device under this router stop online communication.

    4. same my device stop online communication when router lose internet connectivity.

    5. I need solution regarding to this issue. any event possible when lose internet connectivity? 

  • We have implemented ping for detecting internet connectivity.

    Our device was behind router and link status was now enough.

    If ping to our server failed we knew that internet connection was down.

    If you find out a better solution please let me know.

    Best regards 

  • Hi,

    Can you give me detail API or syntax for ping?

    How to ping and how to get link status into ping response using stellaris device?

    please give me example so it is clear to me.

    Thanks.

  • We used ARM7 -> NXP LPC2366 for this functionality.

     

  • we used stellaris cortex-M3 --> LM3S6432.

    can you explain syntax for ping functionality?

  • @dcr

    I don't use LWIP yet , but ...

    Do you know that "ping" is a part of the ICMP protocol (echo & echo reply )

    Maybe that is what you should search for in LWIP.

    /Bingo

  • @Bingo

    Thanks for information regarding ICMP protocol.

    I will try to find regarding ICMP protocol (echo & echo reply ) into LWIP. 

  • Hi dcr,

    Are you able to solve out internet down problem?

    I am struggling on this for Tiva C series board. I tried to add ping.c (e2e.ti.com/.../251327)

    But not able to get any callback in case internet is down. Can you please guide how to achieve this?

    Thanks,

    Bhavesh