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.

How to send data from my PC to microcontroller through ethernet?

Hi,

I have managed to run the LwIP demo given here http://processors.wiki.ti.com/index.php/LAUNCHXL2_RM57L:_lwIP_Demo .

I am doing a project where in data would be coming from a sensor with an IP over ethernet. So just to get some footing in that department untill the sensor is ready I am using the PC as  susbtitute to send the message over ethernet. Now I would like to send a simple "Hey" message to the microcontroller and then take the data from the EMAC receive registers and display it through UART in CCS terminal. I am using a static IP for the demo which is 192.168.0.2 and 192.168.0.1 for the microcontroller and the PC respectively. I have tried using Tera Term and also windows NET SEND command but to no avail. Also tried IP Messenger but the assigned IP address of the microcontroller is not coming up in the list of active devices even though the server(microcontroller) is up and running. 

Please guide as to how I can simply send some data to the assigned IP?

Need your help.

Thanks and Regards,

Rishabh 

  • Hi Rishabh,

    I assume you want to send a message over Ethernet using TCP/IP (LwIP in your case), there many things you need to work on.

    1- You need to decide on what internet protocol to use (TCO, UDP or whatever fits your requirements)

    2- You need to know and implement what is known as client/server, where the server is listening to a available port, and the client needs to send the packet to the server IP and the specified port, for the server to receive the message and respond -if needed-. Client/server doesn't necessarily mean (server like Linux or Windows, it is more like a concept)

    3- Some hints to help you start, try to google: client server calls, IP sockets programming

    Regards

    Fouad

  • A good starting point to understand Ethernet, is to download some client/server code examples, compile and run them on your PC, you use local address for the client and server to communicate.

    A good to have tool is Wireshark, which is free tool you can download online, so you can inspect Ethernet packets.

    Regards

    Fouad
  • Thank you Fouad! Good answer. Wireshark is priceless.