Working DHCP Server Example (WIZnet/EtherMega)


Is there any working DHCP server (serve ip addresses, not receive!) for Arduino? Googled like hell and I tried several projects but didn’t get any of them running or working, even after some hours of changing the source.

What I found yet:
DHCPLite (GitHub - pkulchenko/DHCPLite: DHCP/DNS server for Arduino) : compiles, but doesn’t work. Surely because it uses RedFly shield.

DHCP-Library-Version-0.4 (Arduino DHCP Library: Version 0.4): Couldn’t compile, tried a lot. Think has something to do with changes in Arduino version 1.0 and Client <-> EthernetClient.

I have experienced with Arduino but not with networking at all.
I use EtherMega from freetronics with a WIZnet, which should be compatible with Arduino Ethernet shield.


I’d like to know more about this project where you want the Arduino to return IP addresses based on a supplied host name. Where is it supposed to get that information?

Couldn’t compile, tried a lot. Think has something to do with changes in Arduino version 1.0 and Client <-> EthernetClient.

What errors did you get? What did you try to do to resolve them?

Same her, please explain better what you want to achive. My suspicion is - given your own statement that you don't have networking experience - you are looking at this a bit backwards ;-)

The devices most commonly runnig DHCP servers are routers that sit somewhat in the middle of everything and route IP packets to their approproate destination. These destinations are usually End-devices (for lack of a better name) like an Arduino. There are libraries the implement DHCP clients on an Arduino.

Okay, I have a little experience with networking and Arduino, but not both together. Downplayed a little bit ;-)

My intention: I have a sensor which I would like to read out over TCP/IP or UDP. This is an easy task, there are plenty of examples. But I don't want to set my IP address fix on my notebook, this is inconvenient and annoying. So I can just add a $20 WiFi router and my problem is solved, but I don't like the idea to use an (big) additional device just for DHCP'ing, because I want to carry around this sensor. I known, a WiFi shield could be an option too.

So I would like to plug in my network cable, get an IP address and read out my sensor data with my windows-/mac-application (IP address of my Arduino DHCP server is fix).

Unfortunately, I have deleted all changed projects. DHCPLite looks very good but I had to rewrite the RedFly stuff and use 'default' Ethernet/UDP and failed. (Ethernet.h, EthernetUDP.h)

I take a look again and post the code here with my problems.