Banana Pi R3 - Enable SFP to RJ45 Adapters (10/100/1000M)
- (A guide for beginners and hobbyists alike)
System Info
- Banana Pi-R3 (Board v1.1) (BPiR3v1.1)
- OpenWRT version: 24.10.0-rc2 (Kernel 6.6 - MediaTek)
- OWRT v23.05.0 & later supports BPiR3 (Sept 2024 & later)
- Requirements:
- Compatible USB to UART adapter (CP1202, CH340 or FDTI’s )
- Working UART (serial) “Connection” to BPi-R3 console via Putty (Windows / Ubuntu)
- Compatible SFP to RJ45 Adapter (10/100/1000M)
Adapter Types (Tested / Compatible):
- QSFPTEK - QT-SFP-T (SFP 10/100/1000M RJ45)
- Finisar FCLF8522P2BTL Compatible 10/100/1000BASE-T SFP SGMII Copper RJ-45 100m Transceiver Module
- Capacity: 10/100/1000Base-T: 100m
- 1.25G SFP to Ethernet Compatible for Cisco GLC-T/GLC-TE/GLC-TA, Mikrotik S-RJ01. Widely used in fiber switches, routers, NIC, server or other fiber optic equipments with 1Gb SFP ports.
- 10/100/1000BASE-T SFP to RJ45 Copper for Category 5e copper wire. Gigabit SFP to RJ45 Copper Module 10/100/1000M Auto-Negotiation. Compliant with MSA standards. RJ45 connector. Reach 100m.
- 10Gtek - ASF-2G-T (2.5G RJ-45 Copper SFP, 100-m)
- This adapter only works at 2.5G. It connected and was recognized but I do not have a 2.5G network to test it on.
Notes
-
Device References (for this tutorials reference):
- eth1 → SFP1
- sfp2 → SFP2
- WAN → WAN
- LAN 1 -4 → LAN 1-4
Detailed Instructions - Steps to Get SFP1 & SFP2 Part of LAN
- Connect Serial Bpi R3 to the USB Serial Adapter
- (Connection is a crossover connection: Rx → Tx | Rx → Rx | Gnd → Gnd)
- From Putty Serial Console/Terminal, monitor response when inserting the SFP Adapter into the BPI
- Response - Device is working - Go To STEP 4
=> [ 3200.875232] sfp sfp-2: module QSFPTEK QT-SFP-T rev A sn BQT200408060 dc 200420
> [ 3201.127249] mt7530-mdio mdio-bus:1f sfp2: PHY [i2c:sfp-2:16] driver [Marvell 88E1111] (irq=POLL)
- Response - Device needs a driver installed - Go To STEP 3
> [18634.901040] mtk_soc_eth 15100000.ethernet eth1: validation with support 00,00000000,00000000,00000000 failed: -EINVAL
> [18634.911731] sfp sfp-1: sfp_add_phy failed: -EINVAL
> sfp sfp-1: sfp_add_phy failed: -EINVAL
-
Install the marvell driver
Run the following:
> opkg update > opkg install kmod-phy-marvell
Note: When testing this adapter, I noticed BPiR3 was able to read the EEPROM of the Adapter which lead me to believe there was a missing driver. I found this marvell driver after many hours of combing through the forums and it worked immediately. From console, inserted SFP adapter:
> [18634.901040] mtk_soc_eth 15100000.ethernet eth1: validation with support 00,00000000,00000000,00000000 failed: -EINVAL
> [18634.911731] sfp sfp-1: sfp_add_phy failed: -EINVAL
> sfp sfp-1: sfp_add_phy failed: -EINVAL
root@OpenWRT:~# opkg update
root@OpenWRT:~# opkg install ethtool
root@OpenWRT:~# ethtool eth1
Settings for eth1:
Supported ports: [ FIBRE ]
Supported link modes: 2500baseX/Full
2500baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: 2500baseX/Full
2500baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 2500Mb/s
Duplex: Full
Port: FIBRE
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: no
root@OpenWRT:~# ethtool -m eth0
Offset Values
------ ------
0x0000: 03 04 00 00 00 00 08 00 00 00 00 01 0d 00 00 00
0x0010: 20 20 20 20 20
0x0020: 20 20 20 20 01 00 00 00
0x0030: 20 20 20 20 20 20 20 20 41 20 20 20 00 00 c1 5e
0x0040:
0x0050: "Data Removed for this tutorial"
0x0060:
0x0070:
0x0080:
0x0090: 20 00 00 00 00 00 00 00 c3
0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00c0:
0x00d0: 20 20 20 20 ff ff ff ff ff ff ff ff ff ff ff ff
0x00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
root@OpenWRT:~# opkg update
root@OpenWRT:~# opkg install kmod-phy-marvell
> [ 3200.875232] sfp sfp-2: module QSFPTEK QT-SFP-T rev A sn BQT200408060 dc 200420
> [ 3201.127249] mt7530-mdio mdio-bus:1f sfp2: PHY [i2c:sfp-2:16] driver [Marvell 88E1111] (irq=POLL)
> root@OpenWRT:~# ethtool eth1
> Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 22
Transceiver: external
Auto-negotiation: on
MDI-X: Unknown
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
- Configure SFP 2 to a Bridged LAN Port
- From Luci (By Default OPWRT has SFP2 configured as bridged LAN Port): (For Reference)
- Luci - > Network → Interfaces → Devices tab
- br-lan → Configure → Bridge Ports → Select sfp2 (Save, Save & Apply)
- From Luci (By Default OPWRT has SFP2 configured as bridged LAN Port): (For Reference)
- From Config File - Future Addition - To Be Added after tested
- Configure SFP 1 to a Bridged LAN Port
- By Default, OPWRT has SFP1 configured as a bridged WAN Port, we need to remove this & then add SFP1 (eth1) to the br-lan device.
- From Luci
- Luci - > Network → Interfaces → Devices tab
- br-wan → Configure → Bridge Ports → Deselect eth1 (Save)
- Devices Tab → Unconfigure eth1 (Optional)
- br-lan → Configure → Bridge Ports → Select eth1 (Save, Save & Apply)
- From Config File - Future Addition - To Be Added after tested
At this point, if you didn’t make any other changes from the default installation, the ports should work as follows:
(Dev name) Port Name → Port Function
(wan) WAN → WAN
(eth1) SFP 1 → LAN 6
(sfp2) SFP 2 → LAN 5
LAN 1 → LAN 1
LAN 3 → LAN 2
LAN 3 → LAN 3
LAN 4 → LAN 4
Resourceful Links (Misc.)
Banana Pi R3
- Banana Pi R3 - Wiki
- Banana Pi R3 - Introduction
- Banana Pi R3 - Working with BPi R3
- Banana Pi R3 - Everything you need to know
- Banana Pi R3 - Sinovoip BananaPi BPI-R3
OpenWRT
- OpenWRT - Kernel Version - MediaTek
- OpenWRT - Firmware Selector
- OpenWRT - Source Code
- OpenWRT - How to Compile
- OpenWRT - Complete Tutorial Video - How to Compile OWRT
- OpenWRT - Toolchain → Build System Setup
- OpenWRT - Toolchain → Build System Usage
- OpenWRT - Command Line Interpreter
- OpenWRT - UCI System
- OpenWRT - UCI defaults - Use with Firmware Selector
- OpenWRT - Image builder
- OpenWRT - Expanding SD Card Partition
Mediatek / Arm7986a
Software
- Balena Etcher - Flashing Software Download
- Putty - Serial / Console Interface
- Ubuntu Download page
- WinSCP Download (Easily transfer files from Windows to Linux via SFTP)
- TFTPd 64 - Program to transfer files to BPiR3 over Ethernet
- VirtualBox - Virtual Machine Software (OWRT VB - How To)
Please message with edit recommendations