Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Direct connection between laptop and arduino via ethernet

I made a project with the Arduino and the ethernet-shield. The Arduino is hosting a website which I can open via the browser on my laptop. The Arduino is connected to the router via ethernet. All of this works just fine.

Now I have to present this project at school. To prevent unpleasant surprises I wanted to connect the Arduino directly with the laptop via ethernet. My problem is that I am really not well informed about this topic. Please, if possible, tell me what I should do.

like image 784
derwahre_tj Avatar asked Jan 08 '14 14:01

derwahre_tj


People also ask

Can I use Ethernet cable for Arduino?

The Arduino software includes a Wire library to simplify use of the TWI bus; see the documentation for details. For SPI communication, use the SPI library. The board also can connect to a wired network via ethernet.

Can we directly connect Ethernet cable to laptop?

Ethernet cables are internationally recognised and all computer manufacturers support their use. They can be used with most hardware, apart from a few ultra-modern laptops. You can still connect these devices to an Ethernet cable you just need to get an Ethernet adapter.

Can I directly connect two computers with Ethernet?

The simplest method to connect two computer systems without using the internet is through an ethernet cable. Once the connection is established the two systems can share files between them and also view and edit those files.


1 Answers

If you take the router out of the loop you will need to:

Assign a manual IP address to the laptop's Ethernet connection say 192.168.0.1

Subnet mask 255.255.255.0

Assign a manual IP address to the Arduino's Ethernet say 192.168.0.2

Subnet mask 255.255.255.0

default Gateway empty

Use a cross-over cable to link the two (a standard patch lead will NOT work)

You should then be able to get your Arduino site up on http://192.168.0.2 from the laptop.

To look smart :) edit your hosts table on the laptop (C:\windows\system32\drivers\etc\hosts for windows) (/etc/hosts for linux) and make an entry:

192.168.0.2 my.arduino

Then you can access it with http://my.arduino

Good luck

like image 182
Despatcher Avatar answered Sep 30 '22 17:09

Despatcher