gluon icon indicating copy to clipboard operation
gluon copied to clipboard

targets/lantiq-xrx200: add device Arcadyan VGV7510KW22 aka o2 Box 6431

Open maurerle opened this issue 2 years ago • 1 comments

I have this device working and would like to integrate it into Gluon upstream

  • [x] Must be flashable from vendor firmware
    • [x] Web interface
    • [ ] TFTP
    • [x] Other: serial (some people connect the serial without opening the case) in combination with tftp worked for @4ludwig4 (updated openwrt wiki for this device: https://openwrt.org/toh/arcadyan/vgv7510kw22) but there are also reports that people got it working without using the serial port.
  • [x] Must support upgrade mechanism
    • [x] Must have working sysupgrade
      • [x] Must keep/forget configuration (sysupgrade [-n], firstboot)
    • [x] Gluon profile name matches autoupdater image name (lua -e 'print(require("platform_info").get_image_name())')
  • [x] Reset/WPS/... button must return device into config mode
  • [x] Primary MAC address should match address on device label (or packaging) (https://gluon.readthedocs.io/en/latest/dev/hardware.html#notes)
    • When re-adding a device that was supported by an earlier version of Gluon, a factory reset must be performed before checking the primary MAC address, as the setting from the old version is not reset otherwise.
  • Wired network
    • [x] should support all network ports on the device
    • [x] must have correct port assignment (WAN/LAN)
      • LAN as WAN like other lantiq devices: https://gluon.readthedocs.io/en/latest/user/supported_devices.html#lan-as-wan
  • Wireless network (if applicable)
    • [x] Association with AP must be possible on all radios
    • [x] Association with 802.11s mesh must work on all radios
    • [x] AP+mesh mode must work in parallel on all radios
  • LED mapping
    • Power/system LED
      • [x] Lit while the device is on
      • [x] Should display config mode blink sequence (https://gluon.readthedocs.io/en/latest/features/configmode.html)
    • Radio LEDs
      • [x] Should map to their respective radio
      • [ ] Should show activity
    • Switch port LEDs
      • [x] Should map to their respective port (or switch, if only one led present)
      • [x] Should show link state and activity
      • this works very good
  • Outdoor devices only:
    • [ ] Added board name to is_outdoor_device function in package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua

The LEDs for WLAN, Internet, Info are not active. Power-LED and plugged in LAN cables are working correctly, so this seems to be the only open issue. Of course, if someone has the idea for the LAN-Ports I am all ears but otherwise I'd like to have upstream support for this device :)

Original thread: https://github.com/freifunk-gluon/gluon/pull/2006

maurerle avatar Aug 06 '22 17:08 maurerle

@maurerle Is there an upstream issue regarding the wifi-LED? Is see, you provided @blocktrron with the triggers last year:

Available LEDs:

root@node:~# ls /sys/class/leds
rt2800pci-phy0::assoc       vgv7510kw22:green:info      vgv7510kw22:green:wlan
rt2800pci-phy0::quality     vgv7510kw22:green:internet  vgv7510kw22:red:info
rt2800pci-phy0::radio       vgv7510kw22:green:power     vgv7510kw22:red:internet
vgv7510kw22:green:dsl       vgv7510kw22:green:telefon   vgv7510kw22:red:power

Available triggers:

root@node:~# cat /sys/class/leds/vgv7510kw22\:green\:info/trigger 
[none] timer heartbeat default-on netdev switch0 phy0rx phy0tx phy0assoc phy0radio phy0tpt 

Originally posted by @maurerle in https://github.com/freifunk-gluon/gluon/issues/2006#issuecomment-861041203

AiyionPrime avatar Aug 07 '22 06:08 AiyionPrime

What this PR is also missing is the docs enty for that device (take a look at other device support PRs).

And since lantiq-xrx200 was switched from swconfig to DSA it should be possible to define one port as WAN (usually the first). You can take a look at #2651 or #2557 how that is done.

herbetom avatar Oct 08 '22 00:10 herbetom

Closing due to lack of response.

blocktrron avatar Oct 21 '22 10:10 blocktrron

This issue is still relevant. I just did not have time to make new firmware with the DSA config to validate what is needed there.

maurerle avatar Oct 21 '22 11:10 maurerle

@maurerle Don't let the closed PR discourage you, whenever you're ready to pick this up again, just reopen it :) Thanks for your contribution!

AiyionPrime avatar Oct 21 '22 11:10 AiyionPrime

image

thats how my current config looks like on gluon22.

Here any port works as WAN, currently the second port is used Should i add it like `lan_ifname, wan_ifname = 'lan2 lan3 lan4', 'lan1'

or how do you think is this possible?

maurerle avatar Oct 24 '22 16:10 maurerle

Is there an upstream issue regarding the wifi-LED?

yes, currently the Power LED and the correct LAN LED blinks, but no WIFI LED and "Internet". Do you have an idea what is needed to support this device? @AiyionPrime

Is O2 the Manufacturer of the device?

So it should be like this in supported_devices?

* O2
* 
  - Box 6431

maurerle avatar Oct 24 '22 16:10 maurerle

Should i add it like `lan_ifname, wan_ifname = 'lan2 lan3 lan4', 'lan1'

The OpenWRT page suggests the device has four lan ports and one wan (usually working as dsl, but might work as ethernet as well)

You did already confirm that does not work right? (e.g. with a recent OpenWRT image)

Looking at your log above I would've expected it to work. Sidenote: please do not paste logs or commandlineoutput as images, they are hard to quote.

yes, currently the Power LED and the correct LAN LED blinks, but no WIFI LED and "Internet". Do you have an idea what is needed to support this device?

As @blocktrron suggested in your last issue, and I reminded you above you should check the available LEDs whether they are working at all (in OpenWRT, when you set them manually).

For the list blocktrron provided, you could report, which LEDs you can switch on manually.

Is O2 the Manufacturer of the device?

o2 is not the manufacturer.

So it should be like this in supported_devices?

* O2
* 
  - Box 6431

I'd stick with what the upstream project suggests, as the Manufacturer is Arcadian/Astoria and while your device is rebranded as o2, Arcadyan might as well sell it to another of its customers like Telekom or Vodafone under a different name.

I'd put the o2 reference in either a footnote or in brackets similar to the "microuter" the former being cleaner imho, and the second easier to read. No strong opinion on my side.

* Arcadyan

  - VGV7510KW22 (o2 Box 6431)

AiyionPrime avatar Oct 24 '22 17:10 AiyionPrime

Currently I have to plug the WAN-Cable into any of the LAN ports, the WAN port does not work for the device currently:

  • here wan@eth0 is used as WAN and a LAN cable to my computer is plugged into lan3@eth0 (which is correctly up)
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::4e09:d4ff:fe29:7295/64 scope link 
       valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
4: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-wan state LOWERLAYERDOWN group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-wan state LOWERLAYERDOWN group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
6: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-wan state LOWERLAYERDOWN group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-wan state UP group default qlen 1000
    link/ether 4c:09:d4:29:72:95 brd ff:ff:ff:ff:ff:ff
8: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 46:25:bd:7c:e4:55 brd ff:ff:ff:ff:ff:ff

If i plug WAN into lan1@eth0 and my laptop cable into lan3, i am connected to my home network through LAN.

The names of the LED changed a little with vgv7510kw22 removed:

root@node:~# ls /sys/class/leds
green:dsl                green:internet           green:telefon            red:info                 red:power                rt2800pci-phy0::quality
green:info               green:power              green:wlan               red:internet             rt2800pci-phy0::assoc    rt2800pci-phy0::radio

I can change the LED behavior manually using something like echo default-on > /sys/class/leds/red:power/trigger

That also works with none, timer, and heartbeat, phy0rx and phy0rx but not with netdev or phy0radio - there it just stays off. I tested this with gluon but I can test if the Wifi LED works with an associated radio in openwrt too if that is of any help?

maurerle avatar Oct 25 '22 00:10 maurerle

I would like to have this PR reopened, as it seems that one does not see new commits on the branch of a closed PR..

maurerle avatar Oct 25 '22 00:10 maurerle

I can confirm that the

	lan_ifname, wan_ifname = 'lan1 lan2 lan3 lan4', 'wan'

helped and the box works now as intended with WAN as WAN and the four lan ports as LAN. So the only issue left is the LEDs where I don't know how to fix them.

The WLAN Led is currently not running. And the DSL or Internet LED should show the activity of the WAN port.

The LAN Port LEDs and Power LED work fine.

maurerle avatar Dec 11 '22 22:12 maurerle

The LED green:wlan should be mapped to phy0radio. [1] And here's the dts. [2]

You could start by testing whether the wireless LED works in OpenWrt. Maybe @blocktrron can tell what's missing.

I would not expect the WAN LED to work, as upstream does not recognize the port as WAN.

[1] https://github.com/openwrt/openwrt/blob/b974293efa24b8e1bf859b1ed253ca0042ab273e/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds#L30-L35 [2] https://github.com/openwrt/openwrt/blob/master/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi

AiyionPrime avatar Dec 11 '22 22:12 AiyionPrime

Using Openwrt 22.03.2 the LEDs are working for Power, LAN, and WIFI:

root@OpenWrt:~# uci show system | grep "system.led"
system.led_wifi=led
system.led_wifi.name='wifi'
system.led_wifi.sysfs='green:wlan'
system.led_wifi.trigger='phy0radio'
system.led_dsl=led
system.led_dsl.name='dsl'
system.led_dsl.sysfs='green:dsl'
system.led_dsl.default='0'
system.led_internet=led
system.led_internet.name='internet'
system.led_internet.sysfs='green:internet'
system.led_internet.trigger='netdev'
system.led_internet.mode='link tx rx'
system.led_internet.dev='pppoe-wan' 
root@OpenWrt:~# ls /sys/class/leds/
green:dsl                green:power              red:info                 rt2800pci-phy0::assoc
green:info               green:telefon            red:internet             rt2800pci-phy0::quality
green:internet           green:wlan               red:power                rt2800pci-phy0::radio
root@OpenWrt:~# cat /sys/class/leds/green:wlan/trigger 
none timer heartbeat default-on netdev phy0rx phy0tx phy0assoc [phy0radio] phy0tpt

But looking into Gluon v2022 the Wifi and WAN LED does not work, despite phy0radio being set:

~# cat /sys/class/leds/green:wlan/trigger 
none timer heartbeat default-on netdev phy0rx phy0tx phy0assoc [phy0radio] phy0tpt

As i added support for the WAN device (on Port wan/DSL, so all 4 LAN ports are usable for LAN) - i did add support for the WAN Led using: echo wan > /sys/class/leds/green:internet/device_name which previously was pppoe-wan which does not exist

also setting echo phy0tpt > /sys/class/leds/green:wlan/trigger works fine and shows the wifi rx activity. So I don't know what is wrong with phy0radio.

To make this "reboot-safe" is tried the following:

uci set system.led_internet.dev='wan'
uci set system.led_wifi.trigger='phy0tpt'
uci commit system
# gluon-reconfigure would overwrite my changes again
reboot

which did work

Can someone give me advice how I can inject those changes into gluon? But it seems to me, that I need to fix the 'wan' LED in the openwrt LED config (setting pppoe-wan to wan). I don't know how to fix the phy0radio issue

maurerle avatar Dec 22 '22 21:12 maurerle

I created a PR for OpenWRT to fix the WAN LED name: https://github.com/openwrt/openwrt/pull/11594

Might be, that after merging the PR, building gluon from latest openwrt would work with all LEDs

maurerle avatar Dec 22 '22 21:12 maurerle

The openwrt commit is merged - so this is waiting for the next gluon update to latest openwrt master to be merged.

maurerle avatar Jan 05 '23 02:01 maurerle

That looks promising and was probably the longest you had to wait for a merge regarding this matter.

The next step is to backport it to the OpenWrt's 22.03 branch, as gluon is not built from master.

AiyionPrime avatar Jan 05 '23 12:01 AiyionPrime

Backport made it through the mailinglist:

https://patchwork.ozlabs.org/project/openwrt/patch/[email protected]/

Originally posted by @AiyionPrime in wrong PR...

AiyionPrime avatar Jan 05 '23 22:01 AiyionPrime

@maurerle: I hope I didn't mess up the updates. If #2753 runs through successfully and is merged, this PR should be ready to be rebased.

edit yep. I did.

AiyionPrime avatar Jan 06 '23 22:01 AiyionPrime

@maurerle

The openwrt commit is merged - so this is waiting for the next gluon update to latest openwrt master to be merged.

That should be it. Ready to rebase and test again.

AiyionPrime avatar Jan 08 '23 15:01 AiyionPrime

Soo the WAN now works - but even now on gluon master with the updated openwrt 22.03 branch the wifi led does not blink if set to phy0radio or phy0assoc - the other triggers (phy0rx phy0tx phy0tpt) are working.

This works fine using the latest OpenWrt 22.03 release.

The config looks fine:

root@ffac-o2-6431:~# cat /sys/class/leds/green:wlan/trigger
none timer heartbeat default-on netdev phy0rx phy0tx phy0assoc [phy0radio] phy0tpt

uci led config is the same as OpenWrt which I posted in the thread once (but now the wan is fixed)

root@ffac-o2-6431:~# uci show system | grep "system.led"
system.led_wifi=led
system.led_wifi.name='wifi'
system.led_wifi.sysfs='green:wlan'
system.led_wifi.trigger='phy0radio'
system.led_dsl=led
system.led_dsl.name='dsl'
system.led_dsl.sysfs='green:dsl'
system.led_dsl.default='0'
system.led_internet=led
system.led_internet.name='internet'
system.led_internet.sysfs='green:internet'
system.led_internet.trigger='netdev'
system.led_internet.mode='link tx rx'
system.led_internet.dev='wan'

I did not find anything related in gluons source - is there any other difference? @blocktrron

This might be related to a difference in the wireless driver if any?

maurerle avatar Jan 08 '23 23:01 maurerle

I am getting crazy. I could not reproduce a working phy0radio trigger on:

  • 08.01.2023 snapshot
  • 22.03.3
  • 22.03.2
  • 22.03.1
  • 21.02.5
  • 08.01.2023 gluon-master
  • gluon-v2022.1.1

I was very sure that it worked when I tested it three weeks ago.. But it seems that this device will only get Broken support then without the Wifi LED.. :|

maurerle avatar Jan 09 '23 01:01 maurerle

When the radio is set to phy0radio, it sometimes stays on at boot - thats what I assumed working - but if you turn wifi off and then on again, it does not work anymore. This behavior is also documented here: https://github.com/openwrt/openwrt/issues/7757

Setting it to phy0tpt works well. LED blinks with wifi and typing wifi down && wifi up stops the led for a moment and starts it again. I tested it using a firmware build from gluon-master with the applied patch.

This is now merged into openwrt master here: https://github.com/openwrt/openwrt/pull/11749

And will be backported hopefully soon. When we update openwrt sources in modules the next time, we can hopefully merge this finally :)

maurerle avatar Jan 14 '23 08:01 maurerle

blocked by https://patchwork.ozlabs.org/project/openwrt/patch/AM5PR04MB312356604CAB304C9C110F19E8C09@AM5PR04MB3123.eurprd04.prod.outlook.com/

AiyionPrime avatar Jan 16 '23 20:01 AiyionPrime

Well then. The OpenWrt patch has been accepted, I started a modules update in #2766. Once it's merged this can be rebased and tested (hopefully for the last time).

AiyionPrime avatar Jan 22 '23 12:01 AiyionPrime

@maurerle #2766 has been merged. As you wrote in ffmuc, you tested the changes. Please report your findings in the checklist on top.

AiyionPrime avatar Jan 24 '23 13:01 AiyionPrime

I squashed and rebased and updated the checklist. I have two working gluon devices now correctly running with WAN and WIFI LED :)

maurerle avatar Jan 25 '23 12:01 maurerle

Successfully created backport PR for v2022.1.x:

  • #2876

github-actions[bot] avatar Apr 21 '23 17:04 github-actions[bot]