Controlling a pin over ethernet?

Does anyone know a way of controlling pins with a enc20j60 over ethernet, it's really driving me insane!!!

For months now, I'm trying to find a way to control my lights and boiler without a my (apache) server, So i could use my router for that!

Due hardware incompatibility, mainly 5v vs 3.3v its not an option to solder it in to my router (and it has no usb). So i ordered a enc20j60.

I found a interesting example that worked: But its to difficult for me to change (need push buttons) and its probably to big, to add another library on a pro mini.

I also found this, what i think is the best way to use an external web-server? http://,76125.0.html But it won't compile!!!

Alternative i was thinking to, use udp but i cant find an example of using it. I know linux, so i probably can link the web-page with netcat or some proxy. (understanding udp works similar? Please correct me when wrong!)

For now i really don't care what protocol, the only thing is that it can be done over ethernet. (with the enc20j60) ...Telnet maybe??? And the best way, should be something like: echoing "Pin13,HI" for example?

So please help me in the right direction!


I'm not sure how your router came to be involved, but Arduino plus an Ethernet shield with a sketch implementing a web server that accepted commands to control output pins would seem like a feasible solution. You'd have to write the sketch yourself, but you'll find examples showing how to do that using the Ethernet shield.

What your asking is pretty easy http meth post works pretty well here is a code example from one of my pet projects (excuse the sloppy code :)

char* params;
 if (params = e.serviceRequest())
    if (strcmp(params, "?cmd=up") == 0) { TempSet++; }
    else if (strcmp(params, "?cmd=down") == 0) { TempSet--; }
    else if (strcmp(params, "?cmd=high") == 0) { PumpState = 2; }
    else if (strcmp(params, "?cmd=low") == 0) { PumpState = 1; }
    else if (strcmp(params, "?cmd=off") == 0) { PumpState = 0; }

I'm setting one of two variables a temperature set point and a pump state, obviously you can expand that out to however many commands as you want. I'm using the etherShield.h and ETHER_28J60.h libraries for talking to that Ethernet chip.

@ PeterH

I'm not sure how your router came to be involved? I have a linux based (openwrt) router with a serial port.

@ silasmoeckel

I'm going to try that tomorrow.