Switching between AP and STA

I think I mixed up the file when posting. This should be the original from the openwrt build;

Network;

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd17:78ff:5e34::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option device '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 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0 6t'

Wireless;

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/10300000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

Correct, the original has an AP but no client.

I'm sorry that I lose track at times. My posts get so long and so many it's hard to keep up.
It does work but there are some errors now and then and sometimes a missing gateway.
Mostly, I wanted to finally post my network files because I'd been told several times they didn't look right and wanted to fix that.

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/10300000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option disabled '0'
        option country 'XX'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-iface 'wifinet2'
        option ssid 'xxxxxxxxxx'
        option device 'radio0'
        option mode 'sta'
        option key 'xxxxxxxxx'
        option network 'wwan'
        option encryption 'none'

Hope this helps.

Also, don't forget to recall:

  • You should be good to go - let us know your results.
  • (Using LuCI to make the config, then looking at it could have helped with that issue - I used LuCI to ensure the STA syntax above was 100% correct/identical)

Thank you. I'll re-read your last comment and check the links.
Yes, I have the country code in mine now.

the STA's channel must be determined by connecting to the upstream AP first.

How can I avoid this if I'm just taking the router to a friends house and don't have access to the command line? I won't have luci on my final build. And yes, I'll use luci from now on, it's a good tip I never really understood the reason for before. I understand now that luci creates the file and I can just copy that later.

The only error I'm seeing now is lots of;

Thu Jun 22 21:16:29 2023 daemon.notice hostapd: handle_probe_req: send failed

I think it's when I do not have any credentials in the wireless file and they are still option disabled = 0.

  • The Travelmate package - perhaps(?)
  • "Just taking the router to a friends house" is not a very clear description regarding the use case of the device
  • You don't explain why you won't have access to the command line - and why that is relevant to the use case

I apologize we never communicated that clearly to you.

OK...maybe others can look at this error and respond.