How to connect two Arduino directly via Ethernet cable
How to create connection between two Arduino directly via Ethernet without router/AP?
Answer
To create communication between two Arduino directly via Ethernet, we need to:
- Use two Ethernet shield
- Use a crossover Ethernet cable
- Config static IP for both Ethernet shield. Gateway of this shield is the IP address of other shield. For example
Arduino #1 (Ethernet Shield) | Arduino #2 (Ethernet Shield) | |
---|---|---|
IP address | 10.101.1.210 | 10.101.1.211 |
Subnet mask | 255.255.255.0 | 255.255.255.0 |
Gateway | 10.101.1.211 | 10.101.1.210 |
DNS | 0.0.0.0 | 0.0.0.0 |
And then create a TCP connection between two Arduino: one Arduino acts as TCP server and the other acts as TCP client
For detail about TCP creation, please refer to communication between two Arduino via TCP
Disclosure: Some links in this section are Amazon affiliate links. If you make a purchase through these links, we may earn a commission at no extra cost to you.
Additionally, some links direct to products from our own brand, DIYables.
Additionally, some links direct to products from our own brand, DIYables.