ENC28J60 stability

In my quest for the exploration of the IOT I came across a piece of hardware for connecting the Arduino to ethernet, namely this thing: ENC28J60. It’s a very cheap alternative for the Arduino shields and works, almost as good as them.

I combined this port with a couple of LDR’s (see my LDR debounce posts) to measure light and graph it in the wonderful app of Blynk which now features history graphing and raw data logging. This is an end to a means of automating lights somehow.

Anyway, the ethernet library I use is the UIPethernet ethernet. This is the most practical in use and works very good with this adapter. However, I do noticed some stability issues. The board it self is based on the SPI protocol and therefor is really easy to attach to your device.

I modified the ENC28J60Network.cpp file according to some source on the internet als follows. There is a procedure in there called “sendPacket()” with the following piece of  code in it:

Somehow that doesn’t do the trick and my ethernet disconnects after a day or two, sometimes sooner. The “Internet” suggested I change this like so:

And that’s it, for now it runs smoothly so I have good hopes it will stay running so I can record my light levels in the living room, normalize them and attach a relay or LED lamp to it!

Leave a Reply