I was marking up the network settings page of the supplied sample web page(s), when I asked myself "why are we reinventing the wheel"? I'd seen the LuCI management interface on a few other OpenWRT devices and thought I'd see if I could install it.
LuCI offers a lot of very cool features, many of which are router specific, but some of which could be leveraged in any sort of project. These include:
- Nice UI for setting up wireless
- Package search and management functions for installing new features
- Firmware image load and backup through the web interface
- View kernel and system logs
- View and manage running processes
- Edit the system crontab to schedule processes
- ... and many more!
The first thing I did was to back up everything currently in /www as installing LuCI would surely overwrite at least some of it.
Next, I ran these two commands:
opkg install luci
This ran pretty quickly. When I refreshed the browser (either pointing at the Plug's !P address on the LAN or through its Weaved http connection), I got the black intermediate landing page which has a link to the actual LuCI content. After a few seconds, my browser opened up "File Save" dialog. It also did this if I clicked on the "LuCI - Lua Configuration Interface" link.
To make a long story short, it is necessary to edit /etc/config/uhttpd and comment out the line containing:
# option cgi_prefix '/v1'
This value has been set to "/v1" for the Weaved web content but it prevented the LuCI content from loading properly. I restarted uhttpd:
This will give an error message:
root@OpenWrt:/etc/init.d# uhttpd restart
Error: No sockets bound, unable to continue
But, just refresh your browser and within seconds you should see the LuCI interface.
My next goal is to bring back the main Weaved UI for index.html and to use LuCI for network and system setup.