Ok I have searched and searched and cannot find an answer here.
I'm looking for a decent library to use with my nuelectronics-style ENC28J60 board (made by ekitszone). This seems to be a popular board so I'm stumped as to why it's so hard to find a good library.
I have the ekitszone library working for webserver and ping server only but it is outdated, buggy and lacks outbound connectivity. Andy's library seems to be aimed at the smaller arduino boards and has additional functionality for outbound but I cannot get his library to work. I have adjusted the enc28j60.cpp and .h and ip_config.h files accordingly with the new pinout but it still does nothing when run.
I've been googling for hours and come up with nothing. Can someone either point me in the right direction with how to fix this library or to another library that works well? Thank you in advance!
Except that is defined in ip_config.h ... which enc28j60.c does not include.
Adding a #include "ip_config.h" to the top of enc28j60.c and it magically starts working, assuming that the appropriate PIN defines are made to the top of enc28j60.h:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define DEFAULT_ENC28J60_CONTROL_CS 53
#define SPI_SS 53
#define SPI_MOSI 51
#define SPI_MISO 50
#define SPI_SCK 52
#else
// Default CS pin is 10, for the unmodified shield.
// Can be changed in init function to use another pin
// But SPI_SS needs to be setup correctly too
#define DEFAULT_ENC28J60_CONTROL_CS 10
#define SPI_SS 10
#define SPI_MOSI 11
#define SPI_MISO 12
#define SPI_SCK 13
#endif
Not to keep replying to my own post, but I verified with Andy's latest GIT release and the problem still exists.
Applying the previous 2 modifications fixes the problem, and to get the webserver demo working you need to add the first 3 lines if you have a microsd card on the board: