No, you can't (that only, kind of, works for WEP, which isn't supported by OpenWrt at all anymore), it doesn't (and never did) for WPA based encryptions, which need more than the kernel can provide without userspace help.
If you don't have luci (installing it might be sensible), you need to configured /etc/config/wireless correctly.
I guess luci is running but don't have any means of using it at the moment, so it's down to getting the wireless options right...Do I really need to set channel, band and htmode? And if not how do I know the correct values?
As for the wifi-iface, is it correct to set network, mode, encryption to wan, sta, wpa?
I understand that I also need to add this to /etc/config/network
A fresh or Factory Reset device will provide a default config
(Unless you're asking us how to configure your WiFi, then I'm confused)
Is this a reference to WiFi or configuring your WAN interface?
I ask because:
what you posted should be the default for the WAN config; and
you edit /etc/config/wireless to setup WiFi, not the network file
P.S. - I was about to send you a private message to ask a question - then I realized I already sent you one the other day. Please take some time to look at it/respond at your earliest convenience.
No worries, I provided all the information regarding your inquires in the post.*
I'm just inquiring so I understand your skill level - you seem to have forgotten things about OpenWrt, and as you've been a Community Member for quite a few years - I was concerned and asking via Private Message.
I hope it helps.
My apologies, I misunderstood that you were attempting to add DHCP client setting to wireless. My bad - as I noted already:
That config should already exist, so it's unclear why you're inquiring.
I apologize for any confusion and hope that clarifies things. I was writing as if you were aware of that information. I hope this provided clarity.
config wifi-iface 'wifinet1' #<---may differ on yours
option ssid 'upstrream_SSID'
option device 'radio0' #<---may differ in name/band
option mode 'sta'
option key 'xxxxxxxxxxxxx' #<---may differ on yours
option network 'wwan' #<---or use wan, since it already exist
option encryption 'psk2+ccmp'
I noted that there should already be a wifi-device default config, and AP configs, so I hope this helps you setup. I"m not sure what you need exactly, as there should be default wan config (in network) and a default wifi-device settings (in wireless).
Please place your output into a codebox for easy reading by others
The last line in your post seems incomplete - or maybe you didn't pate the complete file?
Next, I'm unsure if this is the complete config - again, there should have been a network default config present which should have been OK (you may need to add wan only WAN)
"Loopback" and "Globals" seems incomplete
There should also be a default wireless config
Yes, this is correct for a WiFi-only wan, per my last post - we can:
config wifi-iface 'wifinet1' #<---may differ on yours
option ssid 'upstrream_SSID'
option device 'radio0' #<---may differ in name/band
option mode 'sta'
option key 'xxxxxxxxxxxxx' #<---may differ on yours
option network 'wan' #<---you used wan
option encryption 'psk2+ccmp'
Be sure to delete the default AP mode interface (since Intel doesn't support AP) and remove the option disabled line from the wifi-device block. Check the log for wifi-related errors. Run iw dev and you should have one device of mode Managed. If it has connected to the AP you'll also see the SSID and channel of operation. Channel 1 is in the 2 GHz band so option band should be 2g.