ENC28J60 SPI Ethernet
Hi everyone,
I want to use a ENC28J60 SPI ethernet board with the latest Raspbian.
It's possible, the driver exists in the kernel source code, and Chris Boot already did-it before.
Can anyone give me some hints on how i can accomplish this ? Do i need to recompile the whole kernel or just the enc28j60.c kernel module ? Any pointers on the kernel source (shall i use the kernel.org image or shall i download a RPi-speciffic one, from where) ?
Thanks a lot.
I want to use a ENC28J60 SPI ethernet board with the latest Raspbian.
It's possible, the driver exists in the kernel source code, and Chris Boot already did-it before.
Can anyone give me some hints on how i can accomplish this ? Do i need to recompile the whole kernel or just the enc28j60.c kernel module ? Any pointers on the kernel source (shall i use the kernel.org image or shall i download a RPi-speciffic one, from where) ?
Thanks a lot.
Re: ENC28J60 SPI Ethernet
sudo apt-get update && sudo apt-get upgrade -y
reboot
git clone --depth 1 https://github.com/raspberrypi/linux.git
cd linux
zcat /proc/config.gz >.config
edit .config and enable
CONFIG_ENC28J6
make modules
sudo make modules_install
sacrifice 1st born
reboot
YMMV
reboot
git clone --depth 1 https://github.com/raspberrypi/linux.git
cd linux
zcat /proc/config.gz >.config
edit .config and enable
CONFIG_ENC28J6
make modules
sudo make modules_install
sacrifice 1st born
reboot
YMMV
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
Re: ENC28J60 SPI Ethernet
Thank you very much.
Thankfully i skiped the last step. And i backed up the old modules.
I somehow managed to compile broken kernel modules. "modinfo" says the are the same as the old ones, "file" says they are the same as the old ones but they are a couple ok Kb smaller and "modprobe" says: "ERROR: could not insert 'enc28j60': Exec format error"
and in "dmesg" i get "enc28j60: no symbol version for module_layout"
s/enc28j60/every_other_newly_compiled_module_i_tried/g
Thankfully i skiped the last step. And i backed up the old modules.
I somehow managed to compile broken kernel modules. "modinfo" says the are the same as the old ones, "file" says they are the same as the old ones but they are a couple ok Kb smaller and "modprobe" says: "ERROR: could not insert 'enc28j60': Exec format error"
and in "dmesg" i get "enc28j60: no symbol version for module_layout"
s/enc28j60/every_other_newly_compiled_module_i_tried/g
Re: ENC28J60 SPI Ethernet
I succesfuly compiled the module
ln -s /wherever/i/downloaded/the/kernel /usr/src/linux
ln -s /usr/src/linux /lib/modules/`uname -r`/build
cd /lib/modules/`uname -r`/build
make -C /lib/modules/`uname -r`/build
i insmod the enc28j60 module aaaand ... nothing.
further reading on the interwebs tells me that for the 3.2.x kernel i have to edit a file somewhere to tell the kernel where my board is physically connected SPI BUS & CS
something like:
and some init code.
http://www.avrfreaks.net/index.php?name ... ic&t=75282
http://ww2.cs.fsu.edu/~rosentha/linux/2 ... e1197.html
http://www.jumpnowtek.com/index.php?opt ... &Itemid=62
But where i'm supposed to put those code snippets and are there any specifics for Raspberry Pi ?
ln -s /wherever/i/downloaded/the/kernel /usr/src/linux
ln -s /usr/src/linux /lib/modules/`uname -r`/build
cd /lib/modules/`uname -r`/build
make -C /lib/modules/`uname -r`/build
i insmod the enc28j60 module aaaand ... nothing.
further reading on the interwebs tells me that for the 3.2.x kernel i have to edit a file somewhere to tell the kernel where my board is physically connected SPI BUS & CS
something like:
Code: Select all
static struct spi_board_info spi1_board_info[] __initdata = {
{
.modalias = "enc28j60",
.mode = SPI_MODE_0,
.irq = AT32_EXTINT(0),
.max_speed_hz = 12000000,
.chip_select = 0,
},
};
http://www.avrfreaks.net/index.php?name ... ic&t=75282
http://ww2.cs.fsu.edu/~rosentha/linux/2 ... e1197.html
http://www.jumpnowtek.com/index.php?opt ... &Itemid=62
But where i'm supposed to put those code snippets and are there any specifics for Raspberry Pi ?
Re: ENC28J60 SPI Ethernet
Success.
file to edit: arch/arm/mach-bcm2708/bcm2708.c
search for "spi_board_info bcm2708_spi_devices" and modify as follows (assuming your ENC28J60 is connected to spi0.0 (CE0):
Recompile kernel & modules as in the previous post
cp arch/arm/boot/zImage /boot/kernel.img
cp drivers/net/ethernet/microchip/enc28j60.ko /lib/modules/`uname -r`/kernel/drivers/net/ethernet/microchip/
shutdown -r now
then after it starts up: modprobe enc28j60
and victory:
Right now, the network card is working "IRQ-less" so the speed is not great ( ~100KB/sec).
Next step - connecting the network card's IRQ signal to a GPIO.
file to edit: arch/arm/mach-bcm2708/bcm2708.c
search for "spi_board_info bcm2708_spi_devices" and modify as follows (assuming your ENC28J60 is connected to spi0.0 (CE0):
Code: Select all
static struct spi_board_info bcm2708_spi_devices[] = {
{
.modalias = "enc28j60",
.max_speed_hz = 12000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
}, {
.modalias = "spidev",
.max_speed_hz = 500000,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
}
};
cp arch/arm/boot/zImage /boot/kernel.img
cp drivers/net/ethernet/microchip/enc28j60.ko /lib/modules/`uname -r`/kernel/drivers/net/ethernet/microchip/
shutdown -r now
then after it starts up: modprobe enc28j60
and victory:
Code: Select all
[ 847.810450] enc28j60 spi0.0: enc28j60 Ethernet driver 1.01 loaded
[ 847.822819] net eth1: enc28j60 driver registered
[ 847.947228] net eth1: link down
[ 847.947297] net eth1: normal mode
[ 847.947331] net eth1: normal mode
[ 847.947558] net eth1: multicast mode
[ 850.154955] net eth1: link up - Half duplex
Next step - connecting the network card's IRQ signal to a GPIO.
Re: ENC28J60 SPI Ethernet
ooh I never knew you could just copy the zImage .... I've been using the imagetoo-uncompressed.py script ...psergiu wrote:...
cp arch/arm/boot/zImage /boot/kernel.img
....
/me goes to change my special build machine
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
Re: ENC28J60 SPI Ethernet
Anybody has a schematics of connection ?
Re: ENC28J60 SPI Ethernet
6 jumper wires:
ENC - RPi
=======
VCC - 3v3
GND - GND
CS - CE0 (gpio 8)
SI - MOSI (gpio 10)
SCK - SCKL (gpio 11)
SO - MISO (gpio 9)
Also, pin INT can be connected to another GPIO pin and the driver configured to use-it as IRQ (haven't done this yet so i cannot tell you exactly how)
ENC - RPi
=======
VCC - 3v3
GND - GND
CS - CE0 (gpio 8)
SI - MOSI (gpio 10)
SCK - SCKL (gpio 11)
SO - MISO (gpio 9)
Also, pin INT can be connected to another GPIO pin and the driver configured to use-it as IRQ (haven't done this yet so i cannot tell you exactly how)
Re: ENC28J60 SPI Ethernet
For those of you who try to use this device with a current kernel:
you will need to configure the interrupt edge outside of the driver.
If you use spi-config to configure the SPI-parts (see: http://www.raspberrypi.org/phpBB3/viewt ... 44&t=57157), then assuming you have:
the above will load the enc28j60 driver (if you have it compiled as a module) and then start it up as "expected"...
Network is up almost immediately - but do not expect an extremely fast network...
Martin
you will need to configure the interrupt edge outside of the driver.
If you use spi-config to configure the SPI-parts (see: http://www.raspberrypi.org/phpBB3/viewt ... 44&t=57157), then assuming you have:
- the IRQ line on GPIO 25
- the ENC28j60 CS on CS1
Code: Select all
echo "25" > /sys/class/gpio/export
echo "falling" > /sys/class/gpio/gpio25/edge
echo "25" > /sys/class/gpio/unexport
modprobe spi-config devices=bus=0:cs=1:modalias=enc28j60:speed=12000000:gpioirq=25
Network is up almost immediately - but do not expect an extremely fast network...
Martin
Re: ENC28J60 SPI Ethernet
Hello!
As I understand the steps are:
Wired connection:
6 jumper wires:
ENC - RPi
=======
VCC - 3v3
GND - GND
CS - CE0 (gpio 8)
SI - MOSI (gpio 10)
SCK - SCKL (gpio 11)
SO - MISO (gpio 9)
1.-
sudo apt-get update && sudo apt-get upgrade -y
reboot
git clone --depth 1 https://github.com/raspberrypi/linux.git
cd linux
zcat /proc/config.gz >.config
edit .config and enable
CONFIG_ENC28J6
2.-
edit: arch/arm/mach-bcm2708/bcm2708.c
search for "spi_board_info bcm2708_spi_devices" and modify as follows (assuming your ENC28J60 is connected to spi0.0 (CE0):
static struct spi_board_info bcm2708_spi_devices[] = {
{
.modalias = "enc28j60",
.max_speed_hz = 12000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
}, {
.modalias = "spidev",
.max_speed_hz = 500000,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
}
};
3.-
ln -s /wherever/i/downloaded/the/kernel /usr/src/linux
ln -s /usr/src/linux /lib/modules/`uname -r`/build
cd /lib/modules/`uname -r`/build
make -C /lib/modules/`uname -r`/build
4.-
cp arch/arm/boot/zImage /boot/kernel.img
cp drivers/net/ethernet/microchip/enc28j60.ko /lib/modules/`uname -r`/kernel/drivers/net/ethernet/microchip/
shutdown -r now
If I'm not forgetting nothing please let me know why I do not have the enc28j60.ko file? Can I use enc28j60.o? And, how? modprobe? insmod?
I tried to recompile the module with this:
make -C /lib/modules/3.10.25+/build M=drivers/net/ethernet/microchip/enc28j60.ko
But just recived a ko directory:
root@raspberrypi:/lib/modules/3.10.25+/build# ls -l drivers/net/ethernet/microchip/
total 132
-rw-r--r-- 1 root root 24982 Mar 18 18:29 built-in.o
-rw-r--r-- 1 root root 45356 Mar 4 18:02 enc28j60.c
-rw-r--r-- 1 root root 8913 Mar 4 18:02 enc28j60_hw.h
drwxr-xr-x 3 root root 4096 Mar 19 12:57 enc28j60.ko
-rw-r--r-- 1 root root 24984 Mar 18 18:29 enc28j60.o
-rw-r--r-- 1 root root 1035 Mar 4 18:02 Kconfig
-rw-r--r-- 1 root root 95 Mar 4 18:02 Makefile
-rw-r--r-- 1 root root 50 Mar 18 23:02 modules.builtin
-rw-r--r-- 1 root root 0 Mar 19 12:40 modules.order
-rw-r--r-- 1 root root 0 Mar 19 12:40 Module.symvers
Thanks.
As I understand the steps are:
Wired connection:
6 jumper wires:
ENC - RPi
=======
VCC - 3v3
GND - GND
CS - CE0 (gpio 8)
SI - MOSI (gpio 10)
SCK - SCKL (gpio 11)
SO - MISO (gpio 9)
1.-
sudo apt-get update && sudo apt-get upgrade -y
reboot
git clone --depth 1 https://github.com/raspberrypi/linux.git
cd linux
zcat /proc/config.gz >.config
edit .config and enable
CONFIG_ENC28J6
2.-
edit: arch/arm/mach-bcm2708/bcm2708.c
search for "spi_board_info bcm2708_spi_devices" and modify as follows (assuming your ENC28J60 is connected to spi0.0 (CE0):
static struct spi_board_info bcm2708_spi_devices[] = {
{
.modalias = "enc28j60",
.max_speed_hz = 12000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
}, {
.modalias = "spidev",
.max_speed_hz = 500000,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
}
};
3.-
ln -s /wherever/i/downloaded/the/kernel /usr/src/linux
ln -s /usr/src/linux /lib/modules/`uname -r`/build
cd /lib/modules/`uname -r`/build
make -C /lib/modules/`uname -r`/build
4.-
cp arch/arm/boot/zImage /boot/kernel.img
cp drivers/net/ethernet/microchip/enc28j60.ko /lib/modules/`uname -r`/kernel/drivers/net/ethernet/microchip/
shutdown -r now
If I'm not forgetting nothing please let me know why I do not have the enc28j60.ko file? Can I use enc28j60.o? And, how? modprobe? insmod?
I tried to recompile the module with this:
make -C /lib/modules/3.10.25+/build M=drivers/net/ethernet/microchip/enc28j60.ko
But just recived a ko directory:
root@raspberrypi:/lib/modules/3.10.25+/build# ls -l drivers/net/ethernet/microchip/
total 132
-rw-r--r-- 1 root root 24982 Mar 18 18:29 built-in.o
-rw-r--r-- 1 root root 45356 Mar 4 18:02 enc28j60.c
-rw-r--r-- 1 root root 8913 Mar 4 18:02 enc28j60_hw.h
drwxr-xr-x 3 root root 4096 Mar 19 12:57 enc28j60.ko
-rw-r--r-- 1 root root 24984 Mar 18 18:29 enc28j60.o
-rw-r--r-- 1 root root 1035 Mar 4 18:02 Kconfig
-rw-r--r-- 1 root root 95 Mar 4 18:02 Makefile
-rw-r--r-- 1 root root 50 Mar 18 23:02 modules.builtin
-rw-r--r-- 1 root root 0 Mar 19 12:40 modules.order
-rw-r--r-- 1 root root 0 Mar 19 12:40 Module.symvers
Thanks.
Re: ENC28J60 SPI Ethernet
I have the ENC28J60 working but not as I want it.
First time I cross-compiled the RPF kernel with the module enabled and the code changes mentioned above I had some problems so I decided to try it with Martin's spi-config (also cross-compiled).
Added spi-config to rc.local (including enabling the irq) and it works great (better than I expected actually).
Now I decided to go back to changing bcm2708.c; using above mentioned change
It compiles fine, but the result is slow and fairly unstable. Don't have a lot of experience with these things, but my guess is that this has something to do with the IRQ.
So my question is: are there any additional changes needed?
Gr.
Dirk.
First time I cross-compiled the RPF kernel with the module enabled and the code changes mentioned above I had some problems so I decided to try it with Martin's spi-config (also cross-compiled).
Added spi-config to rc.local (including enabling the irq) and it works great (better than I expected actually).
Now I decided to go back to changing bcm2708.c; using above mentioned change
Code: Select all
edit: arch/arm/mach-bcm2708/bcm2708.c
search for "spi_board_info bcm2708_spi_devices" and modify as follows (assuming your ENC28J60 is connected to spi0.0 (CE0):
static struct spi_board_info bcm2708_spi_devices[] = {
{
.modalias = "enc28j60",
.max_speed_hz = 12000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
};
<etcetera>
So my question is: are there any additional changes needed?
Gr.
Dirk.
- DougieLawson
- Posts: 42771
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: ENC28J60 SPI Ethernet
It gets easier with the 3.18.y kernel and the device tree.
For 3.12.33 I got it running with this code modification
And in .config
For 3.18.y in .config is all that's needed. The hard work is done in the dts/dtb.Note: 0xB71B00 == 12,000,000. There's no IRQ values in there at all. I've got mine wired on SCLK, MISO, MOSI and pin# 24 SPI CS0.
For 3.12.33 I got it running with this code modification
Code: Select all
#ifdef CONFIG_BCM2708_SPIDEV
static struct spi_board_info bcm2708_spi_devices[] = {
#ifdef CONFIG_SPI_SPIDEV
{
.modalias = "enc28j60", # changed for SPI ethernet
.max_speed_hz = 12000000, # changed for SPI ethernet
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
}, {
.modalias = "spidev",
.max_speed_hz = 500000,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
}
#endif
};
#endif
Code: Select all
CONFIG_ENC28J60=m
...
CONFIG_SPI=y
...
CONFIG_SPI_MASTER=y
...
CONFIG_SPI_BCM2708=y
...
CONFIG_SPI_SPIDEV=y
For 3.18.y
Code: Select all
CONFIG_ENC28J60=m
Code: Select all
spi@7e204000 {
compatible = "brcm,bcm2708-spi";
reg = <0x7e204000 0x1000>;
interrupts = <0x2 0x16>;
clocks = <0x3>;
#address-cells = <0x1>;
#size-cells = <0x0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x4>;
spidev@0 {
compatible = "enc28j60";
reg = <0x0>;
#address-cells = <0x1>;
#size-cells = <0x0>;
spi-max-frequency = <0xb71b00>;
};
spidev@1 {
compatible = "spidev";
reg = <0x1>;
#address-cells = <0x1>;
#size-cells = <0x0>;
spi-max-frequency = <0x7a120>;
};
};
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: ENC28J60 SPI Ethernet
Cheers, Dougie.
I'll give that a go...
Gr.
Dirk.
I'll give that a go...
Gr.
Dirk.
Re: ENC28J60 SPI Ethernet
I've got one of these on order now (delivery in mid january), I'm hoping to use it with my A+ to make a NAS drive.
Doug.
Building Management Systems Engineer.
Building Management Systems Engineer.
- DougieLawson
- Posts: 42771
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: ENC28J60 SPI Ethernet
Good news. The very nice folks who build the kernel are giving us a device tree overlay for the ENC28J60.
https://github.com/raspberrypi/linux/issues/795
https://github.com/raspberrypi/linux/issues/795
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: ENC28J60 SPI Ethernet
So how does one actually make use of the device tree overlay for the enc28j60? Surely it's not just connect the device to the pi as described above and you're essentially plug and play, right?DougieLawson wrote:Good news. The very nice folks who build the kernel are giving us a device tree overlay for the ENC28J60.
https://github.com/raspberrypi/linux/issues/795
Dear forum: Play nice 

- DougieLawson
- Posts: 42771
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: ENC28J60 SPI Ethernet
Don't know yet, because PhilE hasn't finished the code or the docs for it.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: ENC28J60 SPI Ethernet
AIUI you add an entry in config.txt (or possiblly a HAT eeprom) to load the device tree overlay. That overlay tells the kernel to expect an enc28j60 and where to expect it. Then it should just work like any other ethernet controller.
Re: ENC28J60 SPI Ethernet
Ah, my bad, I thought the dts you were refering to in a previous post was the a device tree thing. How are you loading this module right now?DougieLawson wrote:Don't know yet, because PhilE hasn't finished the code or the docs for it.
Dear forum: Play nice 

Re: ENC28J60 SPI Ethernet
Do you know the syntax for it by the way? I notice that in the documentation for the device tree on the raspberrypi github (here) it shows the syntax asplugwash wrote:AIUI you add an entry in config.txt (or possiblly a HAT eeprom) to load the device tree overlay. That overlay tells the kernel to expect an enc28j60 and where to expect it. Then it should just work like any other ethernet controller.
Code: Select all
#device_tree_param=spi=on
Code: Select all
dtparam=spi=on
Dear forum: Play nice 

- DougieLawson
- Posts: 42771
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: ENC28J60 SPI Ethernet
At the moment my A+ is running on WiFi. I'll experiment with the ENC28J60 when the code from PhilE is ready.abishur wrote:Ah, my bad, I thought the dts you were refering to in a previous post was the a device tree thing. How are you loading this module right now?DougieLawson wrote:Don't know yet, because PhilE hasn't finished the code or the docs for it.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: ENC28J60 SPI Ethernet
Both are valid, you can also leave out '=on'. See https://github.com/raspberrypi/document ... short-cutsabishur wrote:Do you know the syntax for it by the way? I notice that in the documentation for the device tree on the raspberrypi github (here) it shows the syntax asplugwash wrote:AIUI you add an entry in config.txt (or possiblly a HAT eeprom) to load the device tree overlay. That overlay tells the kernel to expect an enc28j60 and where to expect it. Then it should just work like any other ethernet controller.
But in the latest version of raspi-config I enabled the device tree and it added an entry like this for SPICode: Select all
#device_tree_param=spi=on
Code: Select all
dtparam=spi=on
-
- Posts: 244
- Joined: Wed Jan 02, 2013 8:28 am
Re: ENC28J60 SPI Ethernet
Hi to all, I write here avoiding open new thread.
I bought ENC28J60 module from web, I connected wires (I left INT on GPIO25) and I added
dtoverlay=enc28j60
on config.txt.
I correctly find new eth1 interface running ifconfig (missing interface if enc28j60 module unconnected).
I use eth0 on dhcp (original dhcpcd.conf) so I supposed to do the same with eth1.
If I connect eth1 to router, router does not detect cable connected, all led (enc28j60 port and router) are off.
Any ideas about issue?
There could be any conflicts in dhcpcd.conf standard file adding enc28j60 module?
Thanks.
I bought ENC28J60 module from web, I connected wires (I left INT on GPIO25) and I added
dtoverlay=enc28j60
on config.txt.
I correctly find new eth1 interface running ifconfig (missing interface if enc28j60 module unconnected).
I use eth0 on dhcp (original dhcpcd.conf) so I supposed to do the same with eth1.
If I connect eth1 to router, router does not detect cable connected, all led (enc28j60 port and router) are off.
Any ideas about issue?
There could be any conflicts in dhcpcd.conf standard file adding enc28j60 module?
Thanks.
Re: ENC28J60 SPI Ethernet
Did you enable SPI with 'sudo raspi-config'?Killertechno wrote: ↑Thu Nov 22, 2018 10:41 amAny ideas about issue?
There could be any conflicts in dhcpcd.conf standard file adding enc28j60 module?
Can you show us how you wired the module?
Are you sure you used the correct pins (using Broadcom numbering, not physical numbering)?
Can you see eth1 with 'ifconfig'?
Can you see the enc28j60 driver with 'lsmod'
Can you see any errors in the log re 'spi', 'enc28j60', 'eth1' (use e.g. dmesg)?
-
- Posts: 244
- Joined: Wed Jan 02, 2013 8:28 am
Re: ENC28J60 SPI Ethernet
Obviously, I followed guides on connecting ENC28J60 on Raspberry forum.
Can you show us how you wired the module?
Are you sure you used the correct pins (using Broadcom numbering, not physical numbering)?
Can you see eth1 with 'ifconfig'?
Can you see the enc28j60 driver with 'lsmod'
Can you see any errors in the log re 'spi', 'enc28j60', 'eth1' (use e.g. dmesg)?
ifconfig output (ENC28J60 is eth1)
Code: Select all
pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:50:10:c0 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 06:96:73:40:e8:39 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 169
eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.31.109 netmask 255.255.255.0 broadcast 158.110.30.255
inet6 fe80::14ba:fa79:7f28:2df3 prefixlen 64 scopeid 0x20<link>
ether 00:00:00:00:00:3c txqueuelen 1000 (Ethernet)
RX packets 1035 bytes 84260 (82.2 KiB)
RX errors 0 dropped 149 overruns 0 frame 0
TX packets 76 bytes 11456 (11.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pi@raspberrypi:~ $
Code: Select all
pi@raspberrypi:~ $ lsmod
Module Size Used by
asix 36864 0
cfg80211 573440 0
rfkill 28672 2 cfg80211
enc28j60 32768 0
spidev 16384 0
evdev 24576 2
joydev 20480 0
snd_bcm2835 32768 0
snd_pcm 98304 1 snd_bcm2835
snd_timer 32768 1 snd_pcm
snd 69632 3 snd_timer,snd_bcm2835,snd_pcm
spi_bcm2835 16384 0
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
ip_tables 24576 0
x_tables 32768 1 ip_tables
ipv6 434176 24
pi@raspberrypi:~ $
Code: Select all
pi@raspberrypi:~ $ dmesg | grep enc
[ 0.001020] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.002900] CPU: Testing write buffer coherency: ok
[ 6.655301] enc28j60 spi0.0: enc28j60 Ethernet driver 1.02 loaded
[ 6.664479] net eth1: enc28j60 driver registered
Code: Select all
pi@raspberrypi:~ $ dmesg | grep eth1
[ 6.664479] net eth1: enc28j60 driver registered
[ 8.385332] net eth1: link down
[ 8.385380] net eth1: multicast mode
[ 8.385660] net eth1: multicast mode
[ 8.385686] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 8.409314] net eth1: multicast mode
[ 8.477722] net eth1: multicast mode
Last edited by Killertechno on Fri Nov 23, 2018 8:38 am, edited 1 time in total.