hwti / G-010S-A

All about Nokia G-010S-A GPON SFP
186 stars 34 forks source link

Enable ethernet/ssh without plugging in a fibre #24

Open andreluis034 opened 1 year ago

andreluis034 commented 1 year ago

I have a Nokia G-010S-A with the firmware 3FE46398BGCB22 and I got it working with my ISP, however it is a pain in the ass to work with when debugging issues or trying to get the HSGMII to work because the "ethernet" port on the device will only start once a fibre is plugged in.

I have seen other modules on the internet that do not have this requirement and its port is easily accessible from the start. Is there anyway to change/configure my SFP module to work in a similar manner?

Or am I simply mistaken and all G-010S-As require the fibre cable to be plugged in?

hwti commented 1 year ago

(H)SGMII should be enabled even without the fibre being connected, but it takes time (especially with original firmwares, the boot is slow).

Which device is it plugged into ? Did you do the pin 6 mod ?

What does uci get gpon.gtc.nDyingGaspEnable output ?

andreluis034 commented 1 year ago

Thank you for the comment.

I have the pin 6 mod. I am using a CRS305 running RouterOS 7.5 and I am connecting the NOKIA G-010S-A to the 2nd SFP+ port. I have the auto-negotiation disabled and set it to 1gbps full duplex. I have also tried connecting the NOKIA to a media converter and to an Intel X520 but the behaviour is the same. This is the output of interface/ethernet/monitor sfp-sfpplus2 while the fiber is not plugged in:

                  status: no-link
        auto-negotiation: disabled
      sfp-module-present: yes
             sfp-rx-loss: yes
            sfp-tx-fault: no
                sfp-type: SFP-or-SFP+
      sfp-connector-type: SC
      sfp-link-length-sm: 40km
         sfp-vendor-name: ALCATELLUCENT
  sfp-vendor-part-number: 3FE46541AA
     sfp-vendor-revision: 0001
       sfp-vendor-serial: ALCLF84EF959pro
  sfp-manufacturing-date: 170417p
          sfp-wavelength: 1312.55nm
         sfp-temperature: 35C
      sfp-supply-voltage: 3.299V
     sfp-tx-bias-current: 6mA
         eeprom-checksum: good

And the same command with the fiber plugged in:

                    name: sfp-sfpplus2
                  status: link-ok
        auto-negotiation: disabled
                    rate: 1Gbps
             full-duplex: yes
         tx-flow-control: no
         rx-flow-control: no
      sfp-module-present: yes
             sfp-rx-loss: no
            sfp-tx-fault: no
                sfp-type: SFP-or-SFP+
      sfp-connector-type: SC
      sfp-link-length-sm: 40km
         sfp-vendor-name: ALCATELLUCENT
  sfp-vendor-part-number: 3FE46541AA
     sfp-vendor-revision: 0001
       sfp-vendor-serial: ALCLF84EF959pro
  sfp-manufacturing-date: 170417p
          sfp-wavelength: 1312.55nm
         sfp-temperature: 36C
      sfp-supply-voltage: 3.299V
     sfp-tx-bias-current: 7mA
            sfp-tx-power: 2.281dBm
            sfp-rx-power: -18.827dBm
         eeprom-checksum: good

I assume the dying gasp is disabled as uci get gpon.gtc.nDyingGaspEnable returns 0

hwti commented 1 year ago

I have a CRS305, but I currently don't have the pin 6 mod, since it prevents using the UART to recover the SFP. Without it, sfp-module-present stays disabled and nothing works.

Here maybe the issue is sfp-rx-loss, if the CRS305 automatically disables the link when it's signaled.

Do you lose the link when you uplug the fibre ?

You can try onu onu_los_pin_cfg_set -1, but I don't know if you could still keep the connection (the pin might be floating). Then gpio_setup.sh 5 low or gpio_setup.sh 5 high to test.

itfan1 commented 1 year ago

The ethernet interface of the Nokia G-010S-A module is always active (with or without a connected fiber; it takes about two minutes for it to show up after a reboot, but then it's there). The problem is that many devices block access to this ethernet interface as soon as the module indicates to them that the fiber is disconnected. MikroTik devices (routers and switches) do that and so do many SFP to RJ45 media converters. In the context of media converters, this behavior is part of a feature that is usually called "Link Fault Pass Through" (or LFP, for short).

It is possible to access the ethernet interface without connecting the module to an active fiber by using appropriate hardware. The simplest way is to use an SFP to RJ45 media converter that DOES NOT IMPLEMENT LFP. Getting one can be tricky (because reliable fully detailed specs aren't always available when buying media converters), but I managed to get a pair of such "non LFP" media converters by ordering from the following AliExpress link: https://www.aliexpress.com/item/33000229240.html

Another way is to use the 10Gtek G0200-SFP SFP to SFP media converter that can be ordered from the following AliExpress link: https://www.aliexpress.com/item/1005002547053835.html If one inserts the Nokia G-010S-A module into one port of this G0200-SFP device and then connects the other port to a MikroTik switch (such as the CRS305) by using a passive DAC cable, it becomes possible to access the ethernet interface of the Nokia G-010S-A without connecting a fiber. Since the DAC cable is passive, this type of connection is otherwise very similar to a direct insertion of the G-010S-A module into the port of the MikroTik switch. In particular, the connection can be attained at all rates that are supported by both the G-010S-A module and the MikroTik switch (namely, the connection can be attained at either 1G or 2.5G).

hwti commented 1 year ago

So it's probably the rxloss pin, as I supposed.

But there might be software solutions : depending on what happens with the commands I suggested, it might be disabled by a setting, or require a firmware mod.

andreluis034 commented 1 year ago

Sorry for not replying sooner, I was quite busy this week and didn't really have time to give it a try. I've ordered a fiber splitter as without it I am limited to the time of day I can test this with, hopefully it will arrive this week.

Do you lose the link when you uplug the fibre ?

Yes, when the fiber is unplugged I lose the link

You can try onu onu_los_pin_cfg_set -1, but I don't know if you could still keep the connection (the pin might be floating). Then gpio_setup.sh 5 low or gpio_setup.sh 5 high to test.

Some good news, after plugging in the fiber, and connecting via SSH to the module and running onu onu_los_pin_cfg_set -1 && gpio_setup.sh 5 low I no longer lose the link after unplugging the fiber. Of course if I restart the module I will no longer have link anymore and need to plug the fiber back in to run the command. Any ideas on how to turn this permanent?

It is possible to access the ethernet interface without connecting the module to an active fiber by using appropriate hardware. The simplest way is to use an SFP to RJ45 media converter that DOES NOT IMPLEMENT LFP.

That's quite interesting to know, I've been using an old TPLink media converter to gigabite rj45 and it appears to implement LFP. However a friend has supposedly the "same" converter although quite more recent (with the new logo) and with his converter works with module no problem. So at some point TPLink supported LFP but not anymore?

Do you have any idea if it is possible to ignore the RX_LOSS pin on an Intel X520 card running under linux?

hwti commented 1 year ago

I've ordered a fiber splitter as without it I am limited to the time of day I can test this with, hopefully it will arrive this week.

You shouldn't connect two ONT at the same time, your ISP might block you.

Some good news, after plugging in the fiber, and connecting via SSH to the module and running onu onu_los_pin_cfg_set -1 && gpio_setup.sh 5 low I no longer lose the link after unplugging the fiber. Of course if I restart the module I will no longer have link anymore and need to plug the fiber back in to run the command. Any ideas on how to turn this permanent?

Does onu onu_los_pin_cfg_set -1 work alone, or do you need gpio_setup.sh 5 low too ?

There is a way to avoid the pin configuration at boot :

uci set $(uci show sfp_pins | sed -n "s/\(@pin\[[0-9]\+\]\)\.name=los$/\1/p").pin=-1
uci commit

But :

itfan1 commented 1 year ago

So at some point TPLink supported LFP but not anymore?

This is not unreasonable. While LFP is advantageous in some usage scenarios, it is disadvantageous in others.

Do you have any idea if it is possible to ignore the RX_LOSS pin on an Intel X520 card running under linux?

Unfortunately, I have no idea.

GhostlyCrowd commented 1 year ago

I Flashed this to my unit to see if I could make some headway. I cannot for the life of me get 192.168.1.10 at all now.

FIber plugged in or not plugged in. it was getting to the ip before flashing and booting the new image.

Any ideas?

hwti commented 1 year ago

I Flashed this to my unit to see if I could make some headway. I cannot for the life of me get 192.168.1.10 at all now.

FIber plugged in or not plugged in. it was getting to the ip before flashing and booting the new image.

Any ideas?

Do you mean executing the uci set $(uci show sfp_pins | sed -n "s/\(@pin\[[0-9]\+\]\)\.name=los$/\1/p").pin=-1 ? If you cannot get a link any more, and you can't use another device which would ignore the LOS pin, then you would need to recover using the bootloader.

GhostlyCrowd commented 1 year ago

I Flashed this to my unit to see if I could make some headway. I cannot for the life of me get 192.168.1.10 at all now. FIber plugged in or not plugged in. it was getting to the ip before flashing and booting the new image. Any ideas?

Do you mean executing the uci set $(uci show sfp_pins | sed -n "s/\(@pin\[[0-9]\+\]\)\.name=los$/\1/p").pin=-1 ? If you cannot get a link any more, and you can't use another device which would ignore the LOS pin, then you would need to recover using the bootloader.

I'll have to hunt around for an older switch or something.

Curiously though my Unifi gear does see it I expected id be able to get to it with fiber plugged in but i still cannot. I have a very old TP link switch but i'd have to pin 6 mod to get it to detect but maybe this is the path of least resistance.

Delitants commented 1 year ago

I can confirm that TP-LINK MC220L gives access without fiber connected. Mikrotik is being quiet annoying.

larcho commented 1 year ago

I can confirm that TP-LINK MC220L gives access without fiber connected. Mikrotik is being quiet annoying.

I have the same TP-LINK but no ping. Is the FX Link supposed to be on without fiber connected? I assume no, right?