Communication with Arduino from C++ client over ethernet cable

Hello, With my very few knowledge of Ethernet communication, I am going to turn on LED using Ethernet cable. I have done it using serial port but how can i do this over Ethernet cable i am not sure. I went through Ethernet Shield Examples and what i understood is that you have to connect your arduino to router using Ethernet and then you can communicate as Client Server. But what if I want to plug in arduino with my PC through ethernet cables and then sending commands. I am sorry if its too basic , I went through too many links but still not sure how this is going to happen. Any help will be truly appreciated, :slight_smile:

Just to be sure I understand correctly, are you saying you want to connect your Arduino directly to your PC with an Ethernet cable, without using a router?

"I have done it using serial port but how can i do this over Ethernet cable i am not sure."

Do you just want to use the cable, or do you want to make an ethernet network connection between between the arduino and the PC?

I want to connect Arduino to my PC using Ethernet and then send commands.

erric:
I want to connect Arduino to my PC using Ethernet and then send commands.

Still not clear. What people are poking at is whether you will be able to use ordinary ethernet cables or whether you will need a crossover cable.

The key question is: do you intend to have an ethernet cable connecting your Arduino directly to your PC?

If that's your plan, firstly, why? You would need a crossover cable and while it's plugged in, your PC will have lost its internet access (at least if you were using ethernet to get it).

If we're going down the road of guessing at what @erric is trying to accomplish, I should add that the need for a crossover cable will depend on which hardware is used. The W5100 Ethernet controller has auto-MDIX, which means no crossover is needed. The W5500 does not have auto-MDIX. I don't know about the ENC28J60.

I believe the Ethernet controller on the PC side could also have auto-MDIX capabilities, in which case the crossover cable would not be needed.

@pert I have W5100 ethernet controller. But the thing is do i need to use ethernet library to communicate or if any one can suggest how communication over crossover will be done?

If you want to talk Ethernet, then you clearly need the Ethernet library.

This has nothing to do with Crossover.

Please answer: How do you propose to connect this to your PC? Is it the only thing you will be connecting, or are you connecting it to your network "switch" which connects to the Internet and everything else?

This'll be only thing connected to my PC through ethernet cable, i am not using any network switch.

30 years ago you could do this, but now, unless you find special software for your PC, there is no way to make this connection using today's software. So, the question comes down to what version of operating system and software are you using with your PC?

Paul

This subject has been discussed in the forum in the past, but the forum search function just goes to the store, so below might be a place to start.

https://www.google.com/search?as_q=ethernet+direct+connection+windows&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&as_filetype=&as_rights=#spf=1585701642720

I wanted to switch on and off LED on arduino over ethernet cable connected to my PC. My PC has no internet connection so i gave static ip address to my PC and i make the default gateway address same on arduino and PC. My connection was successful this time. I used C++ client library to send commands from my terminal to arduino. Thank you all for your help. My ethernet shield controller is W5100 and so i didn't need any cross over cable.