[BPI-R4] and SFP

What command can I use to interrupt the power to the SFP module?

I would like to restart the module together with the BPI-R4 OpenWrt system. I noticed that it remains powered and is functioning normally.

I have already used “ip link set dev eth2 down” but it does not work.

I would like it, like the BPI-R4 and my Huawei MA5671A, to restart periodically.

Afaik sfp power cannot be controlled by software

Hello I am looking for help with bpi-r4 and SFP+ -LRB 10G fiber transceiver - tx1330/rx1270

Problem looks like after software reboot router via ssh with command reboot. I totally lost connection to my ISP. ethtool -m and ethtool -S, ethtool commands says that everything is very good. But it can’t establish connection anymore. It sends packet but receive 0

i am even thinkin about erased firmware of this transiver becouse sound very strange how reboot can affect physical stability

Temperatures was good all time

And now physicall power off router, unplugging transiever or fiber cable nothing helps

Here is few logs:

ethtool -m eth2
        Identifier                                : 0x03 (SFP)
        Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
        Connector                                 : 0x07 (LC)
        Transceiver codes                         : 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        Transceiver type                          : 10G Ethernet: 10G Base-LR
        Encoding                                  : 0x06 (64B/66B)
        BR, Nominal                               : 10300MBd
        Rate identifier                           : 0x00 (unspecified)
        Length (SMF,km)                           : 20km
        Length (SMF)                              : 20000m
        Length (50um)                             : 0m
        Length (62.5um)                           : 0m
        Length (Copper)                           : 0m
        Length (OM3)                              : 0m
        Laser wavelength                          : 1330nm
        Vendor name                               : OEM
        Vendor OUI                                : 00:00:00
        Vendor PN                                 : SFP+-LRB
        Vendor rev                                : 00
        Option values                             : 0x00 0x00
        BR margin, max                            : 0%
        BR margin, min                            : 0%
        Vendor SN                                 : XC240131111
        Date code                                 : 240131
        Optical diagnostics support               : Yes
        Laser bias current                        : 32.362 mA
        Laser output power                        : 1.0765 mW / 0.32 dBm
        Receiver signal average optical power     : 1.2367 mW / 0.92 dBm
        Module temperature                        : 47.91 degrees C / 118.25 degrees F
        Module voltage                            : 3.3932 V
        Alarm/warning flags implemented           : Yes
        Laser bias current high alarm             : Off
        Laser bias current low alarm              : Off
        Laser bias current high warning           : Off
        Laser bias current low warning            : Off
        Laser output power high alarm             : Off
        Laser output power low alarm              : Off
        Laser output power high warning           : Off
        Laser output power low warning            : Off
        Module temperature high alarm             : Off
        Module temperature low alarm              : Off
        Module temperature high warning           : Off
        Module temperature low warning            : Off
        Module voltage high alarm                 : Off
        Module voltage low alarm                  : Off
        Module voltage high warning               : Off
        Module voltage low warning                : Off
        Laser rx power high alarm                 : Off
        Laser rx power low alarm                  : Off
        Laser rx power high warning               : Off
        Laser rx power low warning                : Off
        Laser bias current high alarm threshold   : 100.000 mA
        Laser bias current low alarm threshold    : 10.000 mA
        Laser bias current high warning threshold : 80.000 mA
        Laser bias current low warning threshold  : 20.000 mA
        Laser output power high alarm threshold   : 2.5118 mW / 4.00 dBm
        Laser output power low alarm threshold    : 0.1122 mW / -9.50 dBm
        Laser output power high warning threshold : 1.9952 mW / 3.00 dBm
        Laser output power low warning threshold  : 0.1412 mW / -8.50 dBm
        Module temperature high alarm threshold   : 100.00 degrees C / 212.00 degrees F
        Module temperature low alarm threshold    : -50.00 degrees C / -58.00 degrees F
        Module temperature high warning threshold : 85.00 degrees C / 185.00 degrees F
        Module temperature low warning threshold  : -40.00 degrees C / -40.00 degrees F
        Module voltage high alarm threshold       : 4.0000 V
        Module voltage low alarm threshold        : 3.0000 V
        Module voltage high warning threshold     : 3.5000 V
        Module voltage low warning threshold      : 3.1000 V
        Laser rx power high alarm threshold       : 1.9952 mW / 3.00 dBm
        Laser rx power low alarm threshold        : 0.0198 mW / -17.03 dBm
        Laser rx power high warning threshold     : 1.5848 mW / 2.00 dBm
        Laser rx power low warning threshold      : 0.0316 mW / -15.00 dBm
ethtool -S eth2
NIC statistics:
     tx_bytes: 11461
     tx_packets: 76
     tx_skip: 0
     tx_collisions: 0
     rx_bytes: 0
     rx_packets: 0
     rx_overflow: 0
     rx_fcs_errors: 0
     rx_short_errors: 0
     rx_long_errors: 0
     rx_checksum_errors: 0
     rx_flow_control_packets: 0
     rx_xdp_redirect: 0
     rx_xdp_pass: 0
     rx_xdp_drop: 0
     rx_xdp_tx: 0
     rx_xdp_tx_errors: 0
     tx_xdp_xmit: 0
     tx_xdp_xmit_errors: 0
     rx_pp_alloc_fast: 18818
     rx_pp_alloc_slow: 33
     rx_pp_alloc_slow_ho: 0
     rx_pp_alloc_empty: 33
     rx_pp_alloc_refill: 272
     rx_pp_alloc_waive: 0
     rx_pp_recycle_cached: 0
     rx_pp_recycle_cache_full: 0
     rx_pp_recycle_ring: 17075
     rx_pp_recycle_ring_full: 0
     rx_pp_recycle_released_ref: 0
ethtool eth2
Settings for eth2:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseLR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseLR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

Have bought a SFP+ module ONTi ONT-C11TE-R01 When I try to use it with the latest snapshot it beaks Luci UI … and do freezes in ssh console if I try to call ifconfig. dmesg shows that system identified it as OEM SPF-10G-T rev 02 … and nothing else Any ideas how to deal with it?

PS It seams that the problem with autoneg … after some time it finally interface starts but it shows 10G (ethtool eth1 shows “Speed: 10000Mb/s”) where a client has only 2.5G NIC card. And in dmesg “mtk_soc_eth 15100000.ethernet eth1: selection of interface failed, advertisement 00,00000000,00000000,00006248”

Hello, I’m planning to buy this module to replace my Alcatel G-010S-P which completely lose connection if bpi-r4 perform a soft reboot. Had to re-plug power cable to make it work again.

Can you confirm that your router has no problem establishing PPPoE through this Huawei one after a ‘reboot’ command? Thanks.

So now a solution is implemented in mainline by Russell:

[PATCH net-next 2/3] net: pcs: pcs-mtk-lynxi: implement pcs_inband_caps() method - Russell King (Oracle)

That is great news!

Edit: @dangowrt & @frank-w

But shouldn’t it report it cannot LINK_INBAND_ENABLE with PHY_INTERFACE_MODE_2500BASEX and maybe PHY_INTERFACE_MODE_1000BASEX ???

1 Like

The patch is afaik (if i understood correctly) only for sfp not supporting in-band-management (daniel told me only some with broadcom phy).

The in-band-management itself should only report link-state,not speed,duplex, etc. Kernel needs to know supported speeds from eeprom,if eeprom does not contain some speeds we have added them (or forced to one) with quirks.

https://lore.kernel.org/all/[email protected]/

From the first series I quote:

Phylink’s handling of in-band has been deficient for a long time, and people keep hitting problems with it. Notably, situations with the way- to-late standardized 2500Base-X and whether that should or should not have in-band enabled. We have also been carrying a hack in the form of phylink_phy_no_inband() for a PHY that has been used on a SFP module, but has no in-band capabilities, not even for SGMII.

When phylink is trying to operate in in-band mode, this series will look at the capabilities of the MAC-side PCS and PHY, and work out whether in-band can or should be used, programming the PHY as appropriate.

net: phylink: add negotiation of in-band capabilities Support for in-band signalling with Serdes links is uncertain. Some PHYs do not support in-band for e.g. SGMII. Some PCS do not support in-band for 2500Base-X. Some PCS require in-band for Base-X protocols.

Simply using what is in DT is insufficient when we have hot-pluggable PHYs e.g. in the form of SFP modules, which may not provide the in-band signalling.

In order to address this, we have introduced phy_inband_caps() and pcs_inband_caps() functions to allow phylink to retrieve the capabilities from each end of the PCS/PHY link. This commit adds code to resolve whether in-band will be used in the various scenarios that we have: In-band not being used, PHY present using SGMII or Base-X, PHY not present. We also deal with no capabilties provided.

So, I understood, here we can tell phylink the pcs does not support inband at 2500-basex and have phylink negotiate if it can link PCS to PHY using this limitation.

I did the same in my crude patch, but this is much better ofcourse. He mentioned a while back he was working on it, so I did not go any further with my patch, waiting for his work to be mainlined.

I have exactly the same issue with this module. After a soft or hard reboot it would occasionally lose link until unplugged and replugged into the router. Like this time:

[   96.130345] sfp sfp1: module OEM              SFP-2.5G-T-R-RM  rev 1.0  sn 2405070065       dc 240507  
[  100.866956] mtk_soc_eth 15100000.ethernet eth2: Link is Up - 2.5Gbps/Full - flow control rx
[  158.718349] mtk_soc_eth 15100000.ethernet eth2: Link is Down

Does anyone have any tips for troubleshooting it?

Edit.: I’m running the latest mainline OpenWrt.

tI am connected using PPPoE at the moment. The only issue I had to do is create a script to restart the LAN port after 120 seconds, after initiation. Through investigation I realized that there is a normal delay in establishing the PPPoE connection, creating the possibility of not propagating IPv6 PDs through the LAN port, because it started before the creation of PPP0E_WANv6 was established. Sometimes it doesn’t even propagate IPv4.

But this is independent of whether I used the SPF or UNO module, I always needed this trick.

It is not yet a definitive solution to the problem, but it is what I have at the moment.

Call at startup: sh /etc/ifup_delayed.sh

Script: #!/bin/sh sleep 120 ifup lan

So the establishment with PPPoe is normal, my problem is in DHCP propagation.

I got the same module and it seems to work perfectly (on openwrt 24.10 rc2), without such delay. Your case is probably ISP-related. Try setting up a stand-along DHCPv6 alias of WAN instead of letting it negotiate a temporary one every time. Also check your firewall rules.

I had actually deleted DHCPv6 from the LAN, but I believe that is not possible from the WAN, since it is the ISP that defines this. But following some of your tips, I reactivated DHCPv6 from the LAN and continued to receive IPv6-DP, which is the public IPv6 as I intended.

Another issue that influences this is that my BPI-R4 is not my final router, there is a XIAOMI AX6000 that does Wi-Fi propagation via bypass. It is connecting to the 2.4Gb ethernet module on eth1.

I tried setting this, but it doesn’t seem to work for me.

ethtool -a eth2
Pause parameters for eth2:
Autonegotiate:  off
RX:             on
TX:             on

Still stuck in autonegotiation.

ethtool eth2
Settings for eth2:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: no

Thanks for that. My stick has exactly that name. It’s a luleey XPON stick with a product number LL-XS2510. But they just resell whatever this is.

So I might try playing around with that.

Why you set TX: on when you have: Supported pause frame use: Symmetric Receive-only? It should be off.

I only copied the suggestion. I will try this.

Hey guys, I would love to get your help I’m using frank awesome debian image for my bananapi r4 and I’ve set it all up properly. not i’m struggeling connecting the SFP. i’ve realized that SFP1 is eth2 and tried to connect an SFP device that my ISP supplied: GPON ONT SFP Class 1 Laser (G-010S-A) by Nokia:

the things is that the dmesg logs alway shows that this device is getting removed:

[  208.972980] sfp sfp1: module removed
[  208.976702] sfp sfp1: module removed
[  209.149293] sfp sfp1: module removed
[  209.152929] sfp sfp1: module removed
[  209.325598] sfp sfp1: module removed
[  209.329300] sfp sfp1: module removed
[  209.644431] sfp sfp1: module ALCATELLUCENT    3FE46541AA       rev 0001 sn ALCLF948A1D1     dc 210327  
[  209.678229] sfp sfp1: module removed
[  209.682047] sfp sfp1: module removed
[  209.854584] sfp sfp1: module removed
[  209.858220] sfp sfp1: module removed

whenever I’m connecting my sfp I see this:

[ 2222.496514] sfp sfp1: EEPROM extended structure checksum failure: 0x36 != 0x54
[ 2222.503749] sfp EE: 00000000: 03 04 01 00 00 00 02 00 00 00 00 03 20 00 28 ff  ............ .(.
[ 2222.512443] sfp EE: 00000010: 00 00 00 00 41 4c 43 41 54 45 4c 4c 55 43 45 4e  ....ALCATELLUCEN
[ 2222.521143] sfp EE: 00000020: 54 20 20 20 00 20 20 20 33 46 45 34 36 35 34 31  T   .   3FE46541
[ 2222.529833] sfp EE: 00000030: 41 41 20 20 20 20 20 20 30 30 30 31 05 1e ff bc  AA      0001....
[ 2222.538518] sfp EE: 00000040: 00 1a 00 00 41 4c 43 4c 47 73 ff ff ff ff ff ff  ....ALCLGs......
[ 2222.547219] sfp EE: 00000050: 20 20 20 20 32 31 30 33 32 37 20 20 68 f0 05 54      210327  h..T
[ 2222.555916] sfp sfp1: module ALCATELLUCENT    3FE46541AA       rev 0001 sn  dc 
[ 2222.663898] sfp sfp1: module removed
[ 2222.667597] sfp sfp1: module removed
[ 2222.840252] sfp sfp1: module removed

I tried sudo modprobe sfp ignore_eeprom=1 but without success

some more info:

ginnie@ginnie-hub:~$ sudo ethtool -m eth2
	Identifier                                : 0x03 (SFP)
	Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
	Connector                                 : 0x01 (SC)
	Transceiver codes                         : 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00
	Transceiver type                          : Ethernet: 1000BASE-LX
	Encoding                                  : 0x03 (NRZ)
	BR, Nominal                               : 3200MBd
	Rate identifier                           : 0x00 (unspecified)
	Length (SMF,km)                           : 40km
	Length (SMF)                              : 25500m
	Length (50um)                             : 0m
	Length (62.5um)                           : 0m
	Length (Copper)                           : 0m
	Length (OM3)                              : 0m
	Laser wavelength                          : 1310nm
	Vendor name                               : ALCATELLUCENT
	Vendor OUI                                : 20:20:20
	Vendor PN                                 : 3FE46541AA
	Vendor rev                                : 0001
	Option values                             : 0x00 0x1a
	Option                                    : RX_LOS implemented
	Option                                    : TX_FAULT implemented
	Option                                    : TX_DISABLE implemented
	BR margin, max                            : 0%
	BR margin, min                            : 0%
	Vendor SN                                 : ALCLF948A1D1
	Date code                                 : 210327

ginnie@ginnie-hub:~$ ethtool -i eth2
driver: mtk_soc_eth
version: 6.11.0-bpi-r4-main
firmware-version: 
expansion-rom-version: 
bus-info: 15100000.ethernet
supports-statistics: yes
supports-test: no

ginnie@ginnie-hub:~$ sudo ethtool eth2
Settings for eth2:
	Supported ports: [ FIBRE ]
	Supported link modes:   2500baseX/Full
	                        1000baseX/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseX/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Auto-negotiation: on
	Port: FIBRE
	PHYAD: 0
	Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
	Link detected: no

Link is never detected. my end goal is to be able to connect it to my ISP with PPPoE, I was able to make the PPPoE connection work on the wan port via “DLink Media Converter - G01LC” but my wish is to connect the SFP directly to the banana pi.

If anyone can help me investigate and shed more light over this riddle I will very thankful

Sfp seems to be correctly recognized (the many removed messages are stange anyway,butaybe it needs some time for bootup like many ont sfp).

Have you tried setting the mac up and disable autoneg (force speed settings to either 1g or 2.5g)?

How much time are we talking about? Cause I’ve waited a few minutes…

Anyway, I’m not sure what you mean by set the Mac up but I did try:

ethtool -s eth2 autoneg off speed 1000 duplex full

Also you can see that the EEPROM checksum failed, not sure if it’s related or even when configured to ignore it helped

Anything else I can try or any logs I can provide to contribute?

I’ve found this about my SFP module:

do you think it can help in making this compatible? I don’t want to solder the pin6 to ground, hopefully i don’t need, but i saw some firmware there that might help maybe.