Fixed lost wifi pane in flint ax1800 v4 upgrade

Hi
When my flint ax1800 upgraded to v4 i completely lost the “Wireless” pane.
When I clicked in it i got an error in the web browser.
It worked fine before in the old interface. ( v3 )
I managed the wifi via luci and assumed it would be fixed by the next update.
But the v4.2.3 upgrade did not fix it.
So i looked in the nginx error log and saw the problem.
For some reason the reg.get was not being set or the “country” variable was null.
I fixed it by editing line 317 in wifi.lua ( /usr/lib/lua/gl/wifi.lua)
Basically I replaced the variable “country” with the static 2-letter string for the country that I am in.
( ie “JP” “US” “DE” “AU” etc )
I changed
local ranges = reg.get(country)
to
local ranges = reg.get("XY")
for the country that contains the flint ax1800.

I did not even have to restart - as soon as i saved the wifi.lua file then i could click on the “Wireless” tab and go to that page.
Just wanted to share in case anyone else has this issue
Cheers,
nonattribution

1 Like

Nicely done. You didn’t have to reboot because /usr/lib/lua/gl/wifi.lua is a Lua script. OpenWrt Linux, being under the hood of the GL GUI, uses a lot of Lua. Scripts aren’t compiled programs so they’re run ‘on demand’ with whatever they’re found to be containing… like you edit(s).

The country codes appear to be ISO-3166-1/Alpha2 values.

Don’t forget to make a backup of your custom workaround.

1 Like

Fantastic, thanks.
That is the first time i messed with lua other than minor edits to nmap scripts.
I have used reg.set and reg.get before( allegedly ) - so I got lucky in figuring out the work-around.
But that backup how-to is great

1 Like

Cheers. I like to think having a good backup strategy puts a new twist on the ol’ “F███ around & find out” :

1 Like