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.

EK-TM4C1294XL: How to set Static IP Address for TcpEcho Example used on TIRTOS 2.16

Part Number: EK-TM4C1294XL

Tool/software:

Hi,

I have downloaded TcpEcho Example from TI Resource Explorer for EK-TM4C1294XL and It is taking the IP Address automatically from the DHCP Server. However, I wish to set my own static IP Address and wish to disable the DHCP Server.

Could you please guide me on how can I achieve this?

Looking forward to your response.

Thanks & Regards,

Siddhi Upadhyay

  • HI,

      Right click on the .cfg file and open the file with XGCONF and you can configure the NDK using the GUI interface. Go to the Network Layer under NDK and open the IP module.  Next uncheck the DHCP box and enter your own static IP and mask. See below. 

  • Hi Charles,

    Thank you for your support I am now being able to set a static IP address for my code.

    However, once the main is executed, tcpWorker() and tcpHandler() are not being executed. I am not getting any comments on the console assuring, socket creation or send recv printfs. Please find the screenshot attached below.

    Kindly guide me on how can i get the following socket creation and send/recv executed.

    Thanks & Regards,

    Siddhi

  • Hi,

      Can you show a screenshot of your NDK setting for static IP configuration? 

      Is 192.168.0.11 an unused address on your network? You need to make sure you are using an available address that is not leased by your DHCP server on the network?

      When it is running the tcpHandler function, does it fail at any line? Can you single step to confirm if the tcpWorker task is successfully created?

      What client application running on the PC side do you use? 

  • Hi Charles,

    Thank you for your support so far!

    Please find below the screenshot of static IP configuration settings. 

    Yes, 192.168.0.11 is an unused address on my network.  

    When it is running TcpHandler, the code is stopped at accept function, waiting forever to accept a connection. please find the screenshot below.

    In my case, the client application is winsock client running on visual studio.  Kindly guide me on what next steps should i take.

    Will this server be compatible with my windows client? 

    Thanks & Regards,

    Siddhi

  • Hi,

      How did you come up with 192.168.0.11? You are pinging 192.168.0.11 that is probably not on the same network as the PC you are pinging from. On your screenshot, it says Reply from 10.167.21.122. This is an entirely different private address from 192.168.0.11. First find out what is your PC IP address. You can use ipconfig command to find out. If your PC has a IP address like 10.167.21.xx then you should find an unused IP address in the subset for your MCU. For example, an IP address like 10.167.21.5 (only if this is unused) will be on the same subnet as your PC as you use 255.255.255.0 mask on the configuration.