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.

TM4C1294NCPDT: Enet_TCP_ECHO SERVER

Part Number: TM4C1294NCPDT

Tool/software:

Hello, i am trying to run Enet_TCP_ECHO SERVER example provided in examples with tivaware.

When i first run the program i realized it didn't work, because it got stuck reading the mac address which i have not programmed in.
So i  removed the mac address reading part and added it  manually.

Fullscreen
1
2
3
4
5
6
pui8MACArray[0] = 0x70;
pui8MACArray[1] = 0xFF;
pui8MACArray[2] = 0x76;
pui8MACArray[3] = 0x1F;
pui8MACArray[4] = 0x83;
pui8MACArray[5] = 0x79;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


After this change the pf4 led started blinking and pn0,pf0 was always on but i could not connect my tcp server with putty

i have entered  168.168.1.100 and port 23 in putty with telnet selected.

But it kept refusing the connection.
I looked the program and i saw it was waiting for me to give ip address, so i have changed to use static address.

Fullscreen
1
2
3
4
5
6
7
#define IPADDR(a,b,c,d) ((uint32_t)((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)))
#define STATIC_IP_ADDRESS IPADDR(168,168,1,100)
#define NETMASK IPADDR(255,255,255,0)
#define GATEWAY IPADDR(168,168,1,1)
lwIPInit(g_ui32SysClock, pui8MACArray, STATIC_IP_ADDRESS, NETMASK, GATEWAY, IPADDR_USE_STATIC);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


i use the IPADDR function to change the values into little endian also changed values in lwipopts.h ;


#define LWIP_AUTOIP                    0

#define LWIP_DHCP                       0



But currently it is still refusing connection. 










  • Hi,

      Have you tried to run your modified example on a LaunchPad? Does it work?

      Have you tried the DHCP address? Does it work?

      Why do you use 168.168.1.100 instead of 192.168.1.100? Could this be a problem? 192.168.0.0 – 192.168.255.255 is a valid range for private IP4 addresses. I'm not aware of a private address starting with 168. Are you sure this is the address you want to statically assign to your server?

    https://whatismyipaddress.com/ip/168.168.1.100

  • yes the program itself reaches the main loop fine, its probably an issue with the lwip configuration.

    no i did not, i want to use a static address for my project.

    ill try changing it and see the results.

  • By the way is there example udp socket project for lwip ? 

  • There are some Ethernet examples in this app note. TM4C129x Ethernet Applications for Lightweight IP (lwIP)

  • Thank you, this is gonna be a question  about udpecho_client_lwip project

    i have programmed the mac adress and see the output from uart (I am using it with DHCP configuration).

    after a while it assigns itself an ip, but i cant ping the ip it gives me over uart.

    also when i look at ipconfig it shows that the media is disconnected even though i can see  the connection in Ethernet settings. 

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :

    i have connected the Ethernet cable to my computer and the uart.
    I am using the default configurations of the projects and it gives me an ip to connect.

    Are there more steps involved with this process ?







  • If you are getting an auto IP such as 169.254.xxx.xxx then it means there is no DHCP server on the network to assign an IP address to you. The stack picks a auto IP for itself. You need to find out if you have a DHCP server on you network. You can talk to your IT support.