ENC28j60 connected directly to computer

Hi everyone.

Some time ago I bought ENC28j60 Ethernet module for Arduino and I connected this to my Leonardo. Firstly, I used router with DHCP turned on and everything was fine. I uploaded sketch pings from default sketches and after few seconds I could read Ethernet module's IP address. Other programs worked OK too - rbbb_server, back_soon from examples.

Although it's good, I'd like to connect ENC28j60 module directly to computer, without router. I just connected them with RJ45 crossover cable and now I don't know how to configure network card and which parameters change to succeed. I mean using pings program for example.

P.S. I'm building a weather station project on Leonardo and I would like to send data from sensors to database using Ethernet module, so I wonder how to setup it fine without router.

Any help will be appreciated.

If your computer has one ethernet connector, and you connect it to the ENC28J60, the computer can no longer reach internet.

The only good way is to connect the ENC28J60 to you home network, and that is created by the router.

If you connect the computer to the Arduino, you can use a crossover cable, but sometimes the ethernet connection of a computer or router adapts itself. Give the Arduino a fixed IP number (no us of DHCP) an run a webserver. In the computer open a browser and go to that IP number. That’s all.

Sometimes a computer is fixed to a home network like : 192.168.1.x
And your Arduino could be at : 192.168.0.x
In some Operating Systems that is no problem, but in others you have to adjust the settings of the network.
Perhaps you should check the router what you use now, if for example your home network is at 192.168.3.x and the computer is normally at then give the Arduino the IP or so.