Close
0%
0%

LinkTrucker

Inspired by other hardware, this Arduino UNO and ENC28J60 checks your Ethernet Link, DHCP, DNS, and connects to a server for < $25!

Similar projects worth following
Having just setup a new network in a big office, I wanted a way to test not only that the wiring was good, but that I was connected to the switch and could see the internet. There are very nice / very expensive tools on the market to do this, but I figured I could whip this up myself for less than $25 in parts and get a bunch of experience with the Arduino Ethernet modules.

This project was inspired by the Fluke LinkSprinter™ Network Tester.
I setup 4 status lights for determining the following:
1. Is the link up - are we connected to a switch / hub?
2. Can we get a DHCP address? If we can't let's assign a Static.
3. Can we perform a DNS lookup? Let's use Google's DNS, but lookup something else.
4. Can we connect to a web page? Does www.google.com respond on port 80?

All 4 items will result in a status of GREEN if we can, and RED if we can't!

The Arduino initializes the Ethernet Module and shows a link or not. It then tries to get a DHCP address (if none defaults to stored IP and warns you). Then it connects to Google DNS at 8.8.4.4 and looks up our friendly neighborhood time server "0.pool.ntp.org" (if it can't find it it warns you). Finally it makes a web connection to "www.google.com" (if it can't it warns). So all green lights mean that we got an IP and we can see then internet!

SunFounder ENC28J60 Ethernet LAN Network Module For Arduino SPI AVR PIC LPC STM32

LinkTrucker.ino

Arduino IDE code for the LinkTrucker! v1.1

ino - 5.44 kB - 01/18/2016 at 01:42

Download

  • 1 × ENC28J60 Development Kits, Boards and Systems / Adapters, Adapter Boards and Sockets
  • 1 × Arduino UNO
  • 4 × Red / Green LED 1080-1109-ND (MV5437) LED GRN/RED DIFF 5MM ROUND
  • 1 × Arduino Project Enclosure PRT-10088
  • 1 × Green Momentary Push Button uxcell 5 x Momentary SPST NO Green Cap Push Button Switch AC 6A/125V 3A/250V

View all 9 components

  • Video Demo

    Kristopher Marciniak01/20/2016 at 17:40 0 comments

    Final Thoughts

    • This is pretty handy to have around!
    • Connecting the activity light allows you to see network traffic.
    • The Arduino Ethernet case is great for this application.
    • I wish the Arduino Ethernet case was better made.
    • I added an overkill DC voltage regulator - as I'm plugging this into $1000+ hardware right?
    • Should run for a couple of days on a 9V.
    • Someone should expand on this and add BlueTooth and a phone app!
    • Arduino Ethernet is easy and cheap - Must make more things!

    - Kris

  • Tight fit (jeez this case)

    Kristopher Marciniak01/20/2016 at 07:31 0 comments

    Maybe I was a little misled by how tiny this case is. Originally designed for the Ethernet shield, I don't think anything extra was supposed to go in. The little battery cover "looks" like a standard 9v size, but it's actually 1/4" smaller than the battery itself. I dislike not having case screws after trimming 4 of the 5 plastic posts, but it fits...

    The Ethernet module is solid and tight, and I may tape the edges from having it pop open, but I'm happy how it turned out.

    I'll follow-up with a demo video tomorrow!

  • Early action video...

    Kristopher Marciniak01/18/2016 at 03:18 0 comments

  • Low memory available, stability problems may occur.

    Kristopher Marciniak01/18/2016 at 01:58 0 comments

    This is how you know your doing Arduino correctly! ;)
    You could delete all the Serial.print lines and disable Serial.begin(9600);
    This should save a bunch of memory and make for a better tomorrow... but "Global variables use 1,558 bytes (76%) of dynamic memory, leaving 490 bytes for local variables. Maximum is 2,048 bytes." seem fine to me as this is all this poor UNO will ever be asked to do.

    - Kris

  • Shorten the DHCP timeout

    Kristopher Marciniak01/18/2016 at 01:33 0 comments

    Inside Dhcp.h, there is a response timeout constant of 60,000. I just changed it to 10,000 (10 seconds), and now timeout occurs about 12-13 seconds after a reset.

    int beginWithDHCP(uint8_t *, unsigned long timeout = 10000, unsigned long responseTimeout = 4000);
    };

    Found here: http://forum.arduino.cc/index.php?topic=105397.0 Hat-tip to jstamour802

  • ENC28J60 Libraries...

    Kristopher Marciniak01/18/2016 at 01:06 0 comments

    After some failed experiments, I found that the Norbert Truchsess library UIPEthernet located here: https://github.com/ntruchsess/arduino_uip is the best for those "ebay" cheap ENC28J60 brakout boards.

    I used the following PIN configuration:
    (4) SO - 12
    (5) SI - 11
    (6) SCK - 13
    (7) CS - 10

    (9) VCC - 3.3V
    (10) GND - GND

View all 6 project logs

  • 1
    Step 1

    Solder 4 Red/Green LED's to a project board.
    Run ~300Ohm resistor to ground pin on all 4 LED's. (Center pin is common on these LED's)
    Wire Green side to PIN 2,3,4,5 of UNO
    Wire Red side to PIN 6,7,8,9 of UNO
    Ground resistors.

  • 2
    Step 2

    Solder the +V pin from the Green LED on the RJ45 Ethernet connector.
    Connect this to A0 on the UNO
    Yes - there IS possibly a way to do this in software, but I am a hardware hacker and this works great!

  • 3
    Step 3

    Download the UIPEthernet Library: https://github.com/ntruchsess/arduino_uip
    Edit the timeout on DHCP to something more reasonable than 60 seconds.
    Download the code - I'm using Arduino IDE 1.6.5 here.

View all 3 instructions

Enjoy this project?

Share

Discussions

castleon wrote 09/15/2019 at 19:30 point

Am I missing something, I don't see the how-to hook up all the wires?  Those 3 steps seem vague to me.  Are there better details somewhere?

  Are you sure? yes | no

ArduinoFreak wrote 05/04/2017 at 02:14 point

This is Great project, If you really want GUI and more advance option check this youtube video

  Are you sure? yes | no

Chief Points wrote 02/01/2016 at 04:12 point

After seeing that there aren't that many resources left over for additions to the tool, I decided to try this out on a breadboarded ATmega1284P. Works solidly and gives you a lot more room to grow, just need to adjust the pin assignments. The DIP version is a bit big, but there is a surface mount version available. I think I may work out a board for this around the 1284P chip, or use one like this: https://github.com/JChristensen/mini1284

Here's the resource using for the sketch on the 1284P:

Sketch uses 25,464 bytes (19%) of program storage space. Maximum is 130,048 bytes.
Global variables use 1,558 bytes (9%) of dynamic memory, leaving 14,826 bytes for local variables. Maximum is 16,384 bytes.

Again, thanks for springboarding some ideas here!

  Are you sure? yes | no

robscott wrote 01/26/2016 at 22:08 point

I've built this project, however I'm having real problems making it work consistently. It always seems to be able to get DHCP and DNS, however sometimes the final web lookup fails and sometimes it doesn't, mostly doesnt.  My Serial Monitor log for the failure is as below. Any idea what could be up with it? Any help would be appreciated.

Rob

Ethernet link is active!
My IP address: 192.168.1.246.
Using DHCP IP
ntp = 194.71.144.71
Connection failed

  Are you sure? yes | no

Kristopher Marciniak wrote 01/28/2016 at 16:03 point

The web connect "occasionally" doesn't work for me. I'd try a different site - or the router web page. More than that - I'd look at the Ethernet Web Client example from the Arduino libraries. Good luck! - Kris

  Are you sure? yes | no

danjovic wrote 01/22/2016 at 22:38 point

Your project is amazing. Congratulations!

  Are you sure? yes | no

Psyrax wrote 01/22/2016 at 19:14 point

Awesome project, might do one, already got the case.

  Are you sure? yes | no

Chief Points wrote 01/22/2016 at 17:52 point

Don't forget adding wireless access point locator/tester, with readout/key entry on the phone ;) Lots of possibilities for upgrades - love it! I definitely see a similar build in my near future, one of those projects that never stops growing. Suddenly seeing a use for all those little tft displays I have laying around ;)

  Are you sure? yes | no

Kristopher Marciniak wrote 01/22/2016 at 17:41 point

Front Page! ^_^
Before comments roll in - 

Yep - there are lots of better ways to run the LED's (Addressable, RGB, etc) but I had Red/Green laying around.
I think there might be a way in software to detect HALF / FULL duplex? Something for someone else to try.
You CAN buy a POE version of the ENC28J60 - Checking for Power over Ethernet is another thing that the more expensive testers do - that could be easily added!
You could also add serial BlueTooth and have even more functionality with your phone!
Please use this as a launchpad for your next Arduino Ethernet project!

- Kris

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates