Look at this:
https://github.com/openwisp/netjsonconfig/blob/master/tests/openwrt/test_wireless.py#L947-L975

See "arbitrary_id"? Add the same attribute but put wlan0 and wlan1 to the
respective interface and the existing interfaces should be replaced.

Ups, seems this is not documented :(
http://netjsonconfig.openwisp.org/en/latest/backends/openwrt.html#wireless-settings

Let me know if it solves your problem.

F.

On Fri, Jul 31, 2020 at 5:35 PM Mirza Arnaut <[email protected]>
wrote:

> Hello Federico,
>
> When I boot it after running *firstboot* the following config is present:
>
> */etc/config/network*
> *config interface 'loopback'*
> *        option ifname 'lo'*
> *        option proto 'static'*
> *        option ipaddr '127.0.0.1'*
> *        option netmask '255.0.0.0'*
>
> *config globals 'globals'*
> *        option ula_prefix 'fd00:a5a0:8fe0::/48'*
> *        option packet_steering '1'*
>
> *config interface 'lan'*
> *        option type 'bridge'*
> *        option ifname 'eth0.1'*
> *        option proto 'static'*
> *        option ipaddr '192.168.15.1'*
> *        option netmask '255.255.255.0'*
> *        option ip6assign '60'*
>
> *config device 'lan_eth0_1_dev'*
> *        option name 'eth0.1'*
> *        option macaddr '7a:11:dc:1b:1a:63'*
>
> *config interface 'wan'*
> *        option ifname 'eth0.2'*
> *        option proto 'dhcp'*
>
> *config device 'wan_eth0_2_dev'*
> *        option name 'eth0.2'*
> *        option macaddr '78:11:dc:1b:1a:63'*
>
> *config interface 'wan6'*
> *        option ifname 'eth0.2'*
> *        option proto 'dhcpv6'*
>
> *config switch*
> *        option name 'switch0'*
> *        option reset '1'*
> *        option enable_vlan '1'*
>
> *config switch_vlan*
> *        option device 'switch0'*
> *        option vlan '1'*
> *        option ports '1 4 6t'*
>
> *config switch_vlan*
> *        option device 'switch0'*
> *        option vlan '2'*
> *        option ports '0 6t'*
>
> *config interface 'usbwan'*
> *        option proto 'dhcp'*
> *        option ifname 'usb0'*
> *        option metric '800'*
>
> */etc/config/wireless*
> *config wifi-device 'radio0'*
> *        option type 'mac80211'*
> *        option hwmode '11a'*
> *        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'*
> *        option htmode 'VHT80'*
> *        option disabled '0'*
> *        option country 'CN'*
> *        option txpower 'auto'*
> *        option channel 'auto'*
>
> *config wifi-device 'radio1'*
> *        option type 'mac80211'*
> *        option hwmode '11g'*
> *        option path 'platform/10180000.wmac'*
> *        option htmode 'HT20'*
> *        option disabled '0'*
> *        option country 'CN'*
> *        option txpower 'auto'*
> *        option channel 'auto'*
>
> *config wifi-iface 'wifinet0'*
> *        option device 'radio0'*
> *        option network 'lan'*
> *        option mode 'ap'*
> *        option ssid 'X-WRT_1A63'*
> *        option encryption 'psk2'*
> *        option skip_inactivity_poll '1'*
> *        option wpa_group_rekey '0'*
> *        option wpa_pair_rekey '0'*
> *        option wpa_master_rekey '0'*
> *        option key '88888888'*
>
> *config wifi-iface 'wifinet1'*
> *        option device 'radio1'*
> *        option network 'lan'*
> *        option mode 'ap'*
> *        option ssid 'X-WRT_1A63'*
> *        option encryption 'psk2'*
> *        option skip_inactivity_poll '1'*
> *        option wpa_group_rekey '0'*
> *        option wpa_pair_rekey '0'*
> *        option wpa_master_rekey '0'*
> *        option key '88888888'*
>
> After installing openwisp and connecting it I get the following configs:
>
> */etc/config/network*
>
>
>
> *... (same as above)config interface 'wlan1'        option auto '1'
> option enabled '1'        option ifname 'wlan1'        option mtu '1500'
>     option proto 'none'config interface 'wlan0'        option auto '1'
>   option enabled '1'        option ifname 'wlan0'        option mtu '1500'
>       option proto 'none'*
>
> */etc/config/wireless*
>
>
>
> *... (same as above)config wifi-iface 'wifi_wlan0'        option device
> 'radio0'        option disabled '0'        option encryption 'psk2'
> option hidden '0'        option ifname 'wlan0'        option isolate '0'
>     option key 'test1234'        option macfilter 'disable'        option
> mode 'ap'        option ssid 'Narouter'        option wds '0'        option
> wmm '1'config wifi-iface 'wifi_wlan1'        option device 'radio1'
> option disabled '0'        option encryption 'psk2'        option hidden
> '0'        option ifname 'wlan1'        option isolate '0'        option
> key 'test1234'        option macfilter 'disable'        option mode 'ap'
>     option ssid 'Narouter'        option wds '0'        option wmm '1'*
>
> The log after running *wifi* is:
> Sat Aug  1 00:28:05 2020 daemon.notice netifd: radio0 (12042): Command
> failed: Invalid argument
> Sat Aug  1 00:28:05 2020 daemon.notice netifd: radio1 (12043): Command
> failed: Invalid argument
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.779600] br-lan: port
> 2(wlan0) entered disabled state
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.796972] br-lan: port
> 3(wlan1) entered disabled state
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.820131] device wlan0
> left promiscuous mode
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.824690] br-lan: port
> 2(wlan0) entered disabled state
> Sat Aug  1 00:28:05 2020 kern.warn kernel: [  418.830516]
> {natflow}:natflow_netdev_event(): catch NETDEV_UNREGISTER event for
> dev=wlan0
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.847009] device wlan1
> left promiscuous mode
> Sat Aug  1 00:28:05 2020 kern.info kernel: [  418.851649] br-lan: port
> 3(wlan1) entered disabled state
> Sat Aug  1 00:28:05 2020 kern.warn kernel: [  418.857420]
> {natflow}:natflow_netdev_event(): catch NETDEV_UNREGISTER event for
> dev=wlan1
> Sat Aug  1 00:28:07 2020 daemon.notice netifd: radio0 (12085): sh:
> acs_survey: out of range
> Sat Aug  1 00:28:07 2020 daemon.notice netifd: radio0 (12085): sh:
> acs_survey: out of range
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: Configuration file:
> /var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.374436] IPv6:
> ADDRCONF(NETDEV_UP): wlan0: link is not ready
> Sat Aug  1 00:28:08 2020 kern.warn kernel: [  421.380582] warning:
> (zone_netdev_event:346)dev=wlan0 set zone=127 type=0
> Sat Aug  1 00:28:08 2020 kern.warn kernel: [  421.387524]
> {natflow}:natflow_netdev_event(): catch NETDEV_UP event for dev=wlan0, add
> ingress hook
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.475438] br-lan: port
> 2(wlan0) entered blocking state
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.480990] br-lan: port
> 2(wlan0) entered disabled state
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.486804] device wlan0
> entered promiscuous mode
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: ctrl_iface exists and
> seems to be in use - cannot override it
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: Delete
> '/var/run/hostapd/wlan0' manually if it is not used anymore
> Sat Aug  1 00:28:08 2020 daemon.err hostapd: Failed to setup control
> interface for wlan0
> Sat Aug  1 00:28:08 2020 daemon.err hostapd: wlan0: Unable to setup
> interface.
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: nl80211: deinit
> ifname=wlan0 disabled_11b_rates=0
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.518082] device wlan0
> left promiscuous mode
> Sat Aug  1 00:28:08 2020 kern.info kernel: [  421.522872] br-lan: port
> 2(wlan0) entered disabled state
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: wlan0:
> CTRL-EVENT-TERMINATING
> Sat Aug  1 00:28:08 2020 daemon.err hostapd: hostapd_free_hapd_data:
> Interface wlan0 wasn't started
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: wlan0:
> CTRL-EVENT-TERMINATING
> Sat Aug  1 00:28:08 2020 daemon.err hostapd: hostapd_free_hapd_data:
> Interface wlan0 wasn't started
> Sat Aug  1 00:28:08 2020 daemon.notice netifd: radio0 (12085): Command
> failed: Invalid argument
> Sat Aug  1 00:28:08 2020 daemon.notice hostapd: Configuration file:
> /var/run/hostapd-phy1.conf (phy wlan1) --> new PHY
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  421.632090] ieee80211 phy1:
> rt2800_rf_self_txdc_cal: Info - RF Tx self calibration start
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  421.640920] ieee80211 phy1:
> rt2800_rf_self_txdc_cal: Info - RF Tx self calibration end
> Sat Aug  1 00:28:10 2020 daemon.notice netifd: radio0 (12085): WARNING
> (wireless_add_process): executable path /usr/sbin/wpad does not match
> process  path (/proc/exe)
> Sat Aug  1 00:28:10 2020 daemon.notice netifd: radio0 (12085): Command
> failed: Invalid argument
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.614783] ieee80211 phy1:
> rt2800_loft_iq_calibration: Info - LOFT Calibration Done!
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.627667] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Start!
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.649021] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Done! CH = 0, (gain= 1, phase=3f)
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.659264] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Start!
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.680586] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Done! CH = 1, (gain= f, phase=3e)
> Sat Aug  1 00:28:10 2020 kern.info kernel: [  423.689946] ieee80211 phy1:
> rt2800_loft_iq_calibration: Info - TX IQ Calibration Done!
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.714003] ieee80211 phy1:
> rt2800_rxiq_calibration: Info - RXIQ G_imb=1, Ph_rx=5
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.731908] ieee80211 phy1:
> rt2800_rxiq_calibration: Info - RXIQ G_imb=3, Ph_rx=-7
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.749495] IPv6:
> ADDRCONF(NETDEV_UP): wlan1: link is not ready
> Sat Aug  1 00:28:11 2020 kern.warn kernel: [  423.755627] warning:
> (zone_netdev_event:346)dev=wlan1 set zone=127 type=0
> Sat Aug  1 00:28:11 2020 kern.warn kernel: [  423.762585]
> {natflow}:natflow_netdev_event(): catch NETDEV_UP event for dev=wlan1, add
> ingress hook
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.781021] br-lan: port
> 2(wlan1) entered blocking state
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.786460] br-lan: port
> 2(wlan1) entered disabled state
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.792358] device wlan1
> entered promiscuous mode
> Sat Aug  1 00:28:11 2020 daemon.notice hostapd: ctrl_iface exists and
> seems to be in use - cannot override it
> Sat Aug  1 00:28:11 2020 daemon.notice hostapd: Delete
> '/var/run/hostapd/wlan1' manually if it is not used anymore
> Sat Aug  1 00:28:11 2020 daemon.err hostapd: Failed to setup control
> interface for wlan1
> Sat Aug  1 00:28:11 2020 daemon.err hostapd: wlan1: Unable to setup
> interface.
> Sat Aug  1 00:28:11 2020 daemon.notice hostapd: nl80211: deinit
> ifname=wlan1 disabled_11b_rates=0
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.801095] device wlan1
> left promiscuous mode
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.805878] br-lan: port
> 2(wlan1) entered disabled state
> Sat Aug  1 00:28:11 2020 daemon.notice hostapd: wlan1:
> CTRL-EVENT-TERMINATING
> Sat Aug  1 00:28:11 2020 daemon.err hostapd: hostapd_free_hapd_data:
> Interface wlan1 wasn't started
> Sat Aug  1 00:28:11 2020 daemon.notice hostapd: wlan1:
> CTRL-EVENT-TERMINATING
> Sat Aug  1 00:28:11 2020 daemon.err hostapd: hostapd_free_hapd_data:
> Interface wlan1 wasn't started
> Sat Aug  1 00:28:11 2020 daemon.notice netifd: radio1 (12084): Command
> failed: Invalid argument
> Sat Aug  1 00:28:11 2020 daemon.notice netifd: radio1 (12084): WARNING
> (wireless_add_process): executable path /usr/sbin/wpad does not match
> process  path (/proc/exe)
> Sat Aug  1 00:28:11 2020 daemon.notice netifd: radio1 (12084): Command
> failed: Invalid argument
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  423.965955] IPv6:
> ADDRCONF(NETDEV_UP): wlan0: link is not ready
> Sat Aug  1 00:28:11 2020 kern.warn kernel: [  423.972088] warning:
> (zone_netdev_event:346)dev=wlan0 set zone=127 type=0
> Sat Aug  1 00:28:11 2020 kern.warn kernel: [  423.979359]
> {natflow}:natflow_netdev_event(): catch NETDEV_UP event for dev=wlan0, add
> ingress hook
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  424.143854] br-lan: port
> 2(wlan0) entered blocking state
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  424.149363] br-lan: port
> 2(wlan0) entered disabled state
> Sat Aug  1 00:28:11 2020 kern.info kernel: [  424.155265] device wlan0
> entered promiscuous mode
> Sat Aug  1 00:28:13 2020 kern.info kernel: [  424.455727] ieee80211 phy1:
> rt2800_rf_self_txdc_cal: Info - RF Tx self calibration start
> Sat Aug  1 00:28:13 2020 kern.info kernel: [  424.464588] ieee80211 phy1:
> rt2800_rf_self_txdc_cal: Info - RF Tx self calibration end
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.353880] ieee80211 phy1:
> rt2800_loft_iq_calibration: Info - LOFT Calibration Done!
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.366676] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Start!
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.388038] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Done! CH = 0, (gain= 0, phase=3e)
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.398294] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Start!
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.419641] ieee80211 phy1:
> rt2800_iq_search: Info - IQCalibration Done! CH = 1, (gain= 0, phase=3e)
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.429035] ieee80211 phy1:
> rt2800_loft_iq_calibration: Info - TX IQ Calibration Done!
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.453232] ieee80211 phy1:
> rt2800_rxiq_calibration: Info - RXIQ G_imb=0, Ph_rx=5
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.471156] ieee80211 phy1:
> rt2800_rxiq_calibration: Info - RXIQ G_imb=3, Ph_rx=-7
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.487074] IPv6:
> ADDRCONF(NETDEV_UP): wlan1: link is not ready
> Sat Aug  1 00:28:14 2020 kern.warn kernel: [  426.493204] warning:
> (zone_netdev_event:346)dev=wlan1 set zone=127 type=0
> Sat Aug  1 00:28:14 2020 kern.warn kernel: [  426.500212]
> {natflow}:natflow_netdev_event(): catch NETDEV_UP event for dev=wlan1, add
> ingress hook
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.663688] br-lan: port
> 3(wlan1) entered blocking state
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.669180] br-lan: port
> 3(wlan1) entered disabled state
> Sat Aug  1 00:28:14 2020 kern.info kernel: [  426.675135] device wlan1
> entered promiscuous mode
>
> I hope I will be able to set it up, since I really like the idea behind
> your tool!
>
> Best regards
> M
>
>
> On Friday, July 31, 2020 at 5:08:25 PM UTC+2, Federico Capoano wrote:
>>
>> Hi Mirza,
>>
>> could you please share the configuration in /etc/config/wireless and the
>> relevant error output of logread after you run the command "wifi" or
>> "reload_config" (the latter works only after changing the wireless
>> configuration).
>>
>> F.
>>
>> On Fri, Jul 31, 2020 at 4:25 AM Mirza Arnaut <[email protected]> wrote:
>>
>>> I wanted to try using OpenWRT for my Xiaomi Routers, but found out, that
>>> the Mi WiFi R3 is not officially supported. But I found out, that the
>>> Chinese fork, called X-WRT has images for it, hence I used it, thinking
>>> that not much would be changed in the image.
>>> Now I have a Redmi AC2100 which works perfectly with OpenWisp, so does
>>> the R3 for basic configurations (Timezone, Hostnam, etc.).
>>> Since I am a lazy person, I wanted to make a 2.4 and 5 GHz network and
>>> apply it on both of them, but it fails to do so on the X-WRT router.
>>> Has someone successfully got it working? I suppose the config
>>> differences are causing this behaviour, since the default name for wifi
>>> interfaces are not wifi_wlanX but wifinetX for example.
>>> Thanks in advance!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "OpenWISP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web, visit
>>> https://groups.google.com/d/msgid/openwisp/c63b10e4-6980-4c46-907c-c2be01384d46n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/openwisp/c63b10e4-6980-4c46-907c-c2be01384d46n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/b23c1464-38f4-4283-be35-b4506500061do%40googlegroups.com
> <https://groups.google.com/d/msgid/openwisp/b23c1464-38f4-4283-be35-b4506500061do%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAERYH6VciNX8XdDeyKauj05SY5RJa1%2BiNz1hWxhPcLoU_%2B8ijg%40mail.gmail.com.

Reply via email to