Radio configution options: phy vs path

1,020 views
Skip to first unread message

mord reneth

unread,
Feb 19, 2017, 11:42:00 AM2/19/17
to OpenWISP
Does anyone know the difference between the options 'phy' and 'path'?

Running LEDE on WDR4300, and for hours I was stumped on why my wireless interface wasnt coming up. It was only after seeing in the log 'Could not find PHY for device 'radio0' that i noticed in a working config file had the setting 'option path 'platform/ar934x_wmac''

After setting this, everything started working. I then looked and saw the 'phy' option.....so I removed option path 'platform/ar934x_wmac' and set phy to phy0....again....everything worked....

So, whats the difference, and should there be a preference of one over the other? (I'm guessing phy should be preferred, as that config could be used across multiple but not identical devices)


Just like to add, that the more i play and learn about openwisp, the more i love it :)

Federico Capoano

unread,
Feb 20, 2017, 5:00:45 AM2/20/17
to OpenWISP
From what I understood reading the OpenWRT wireless documentation, phy and path are two attributes used to identify physical radio devices, "phy" is the common attribute which can be used on all drivers, while "path" is specific to the mac80211 driver.

The documentation says:

phy: Specifies the radio phy associated to this section. If present, it is usually autodetected and should not be changed. [bold red added by me]
path: Alternative to phy used to identify the device based paths in /sys/devices

Since the phy / path attribute is automatically detected and set by OpenWRT, in most cases we don't need to change it, and that's why the default value of the "phy" attribute in OpenWISP 2 is an empty string, which is then ignored by netjsonconfig.

Therefore, this radio template:

{
    "radios": [
        {
            "name": "radio0",
            "protocol": "802.11n",
            "phy": "",
            "country": "IT",
            "driver": "mac80211",
            "disabled": false,
            "tx_power": 10,
            "channel": 3,
            "channel_width": 20
        }
    ]
}

Will be converted to UCI by netjsonconfig in the following way:

config wifi-device 'radio0'
option channel '3'
option country 'IT'
option disabled '0'
option htmode 'HT20'
option hwmode '11g'
option txpower '10'
option type 'mac80211'

Notice there's no phy/path attribute.

When openwisp-config will merge this bit of configuration with the local one, the phy/path attribute which was autodetermined by OpenWRT won't be changed. So you can keep the general information in OpenWISP2 and delegate these hardware details entirely to OpenWRT.

Otherwise you can just set phy0 or phy1 (if your devices have a second radio) which are surely easier to fill in than the path attribute.

Federico

PS: thank you for your feedback and appreciation :-)

mord reneth

unread,
Feb 20, 2017, 5:38:34 AM2/20/17
to OpenWISP
Thanks for the info Federico,

This is where I was falling down.

In your examples, you didnt fill in phy or path.....BUT, if merge_config is set to 0, the config wifi-device directive doesnt contain any info on the driver, and therefor will fail to load.

Federico Capoano

unread,
Feb 20, 2017, 6:08:42 AM2/20/17
to OpenWISP
Correct, when merge_config is disabled in openwisp-config the value of phy must be filled in otherwise the radio will stop working.

Federico
Reply all
Reply to author
Forward
0 new messages