OpenWrt Forum Archive

Topic: LuCi fails to properly reboot

The content of this topic has been archived between 4 Feb 2018 and 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Wow!  I honestly do not understand what you have done, nor did I expect a full rewrite. 

Thinking you may have some questions on the logic I spent some time flow charting the process.  While it's pretty much the same, I did make some changes to the logic around checking connections and the current status of the station to keep it from getting bounced unnecessarily.  Hopefully you can also find a better approach to the timing of the first scan.  My approach is setting a delay based on testing the boot time.  Hopefully you can incorporate this with out too much additional work.
https://www.dropbox.com/s/8end3znv3unj8 … 2.ppt?dl=0

My reference to the new function was wifiMgr.sh. 

Let me know if you have any more questions.  I look forward to seeing the results.

great job on the flow chart, that's just what I need to complete the dispatcher smile

Great, I am happy this is of some value.

I should point out that the flowchart covers logic related to the checking and selecting of the saved APs.  It does not cover the need to configure a new AP (unsaved location).  While LuCi can configure a new AP, the wifiMgr needs to support this.  The issue that I had was the BSSID, which I deleted during the STA change.  It appears that you are including BSSID in your field set, but I do not see it in the config file.  I do not expect you are planning an alternative tool to Luci, but the current approach is cumbersome at best.  At worst one can end up with a STA and no Client (or access).

I did not call out the PingSleep in the flowchart, and I see you have something called ## TEST IF NETWORK IS UP ##.  Is this the gray box at the top of the flowchart? I put "2" as the value to repeat this check.  Not sure how it works, if this is a good value or needed.  Set as you see fit.

I see a function ## SORT SCANNED NETWORKS AND CREATE A TABLE... ##.  What options are there for sorting?  Is there such a thing as signal strength?  Otherwise I am inclined to use natural order. 

Do you see this being something that will be deployed with OPKG INSTALL ...?

It may be worth changing the name slightly to differentiate your effort from the original product. I'll leave it up to you.
Some alternatives:  wifimgr2, wifimanager, connectionmanager, wwanmanager

I'm not sure what effort you are willing to put here, please let me know if this is pushing.  As this is mostly designed for  travel routers, it would be helpful if there was an alternative (Web) GUI for mobile (ie no PC).  Luci is not mobile friendly.  I know GLI has a GUI on top of OpenWRT.  I'm not sure how feasible this is or if it's even the same tool set.  I though that I would put this on the table now in case it has any design impact.  Call it phase II

I think we can assume the user would only need to use this to connect to a "new" location, so...
1 - check credentials
2 - perform a scan
3 - select result
4 - confirm connection
5 - option to save location
I do not see a need to for this do any thing else.  Not looking for this to config the app or the router.  Just make a new connection with the least amount of key strokes.

I have altered the ##TEST IF NETWORK IS UP## function to use ubus, no timeout is needed, it just runs a repeat until loop which checks over and over until the network is up...

New connections must be configured with luci, however, you will notice a function called add network, this function is called after a connection to the net is confirmed, it then checks the table of Trusted Networks from the config file, if the SSID is not present then its added to the config with all the necessary fields smile ...

BSSID is captured during the scan ...

Yes, I do grab the signal info but I am currently not using it, its the for future updates ...

Yes I will create an ipk and also add it to my git repo so it can be compiled as well ...

I will likely rename it to luci-app-wifimanager ...

as for the mobile interface ... possibly later on

(Last edited by hostle19 on 19 Feb 2016, 03:12)

Thanks for the update.  Sounds good, though I am a little concerned about the AP list getting filled with "one -offs".  I guess it's easier to delete from the config file as opposed to adding.

I put the current logger output to a "Tab".  Will it be possible to capture similar in the new design?
http://www.gl-inet.com/forums/topic/wif … post-11938

I look forward to testing....

Logging will have 1-5 levels and can be turned off or on, alarm,crit and alert messages will always be posted but all notice, info and debug msg's will be optional and set depending on the log level.

Here is a little sample output..

Fri Feb 19 05:35:08 2016 daemon.info wifimanger: INITIAL BOOT
Fri Feb 19 05:35:08 2016 daemon.info wifimanger: WWAN NETWORK IS NOW UP !!
Fri Feb 19 05:35:08 2016 daemon.info wifimanger: INITIAL BOOT PASSED
Fri Feb 19 05:35:08 2016 daemon.info wifimanger: NETWORK CONNECTION TEST PASSED !!
Fri Feb 19 05:35:08 2016 daemon.alert wifimanger: SSID: Bae-watch ALREADY EXISTS
RangerZ wrote:

Thanks for the update.  Sounds good, though I am a little concerned about the AP list getting filled with "one -offs".  I guess it's easier to delete from the config file as opposed to adding.

There will be an option to enable/disable the auto network add functionality within the interface

Excellent!

Do you plan any maintenance capabilities to the actual APs in the config file from the GUI?

you can add/delete and edit  APs from the GUI

Sounds like a winner......

the new package can  be downloaded at my web site here --> http://fire-wrt.com/forums/showthread.p … =60#post60

you will need to resister and provide me with the username you use to register so I can approve you. I have added a few extra options ...most notably the add AP option which allows the option to auto configure a wireless ap once a client connection is achieved.

I have tested it for basic functionality and everything seems to work ok, I also set it up as a mobile app, you will notice the "mobile" and "administration"  tabs, mobile shows only the wifimanager menus and of course admin show the regular menu's. I have done my best to make the gui mobile friendly by using list menus and check boxes where possible.

One thing that I changed in my local luci repo was the position of the delete button , for some reason it is normally located ontop of the section it pertains to... this makes it hard to tell what section it belongs to so i changed it in my local repo so it is at the bottom which in my opinion is where it should be. To achieve this you will need to replace the contents of the  "/usr/lib/lua/luci/view/cbi/tsection.htm" with the following ...

/usr/lib/lua/luci/view/cbi/tsection.htm

<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
    <% if self.title and #self.title > 0 then -%>
        <legend><%=self.title%></legend>
    <%- end %>
    <div class="cbi-section-descr"><%=self.description%></div>
    <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
        

        <%- section = k; isempty = false -%>

        <% if not self.anonymous then -%>
            <h3><%=section:upper()%></h3>
        <%- end %>

        <%+cbi/tabmenu%>

        <fieldset class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>">
            <%+cbi/ucisection%>
        </fieldset>
        <br />
    
    <% if isempty then -%>
        <em><%:This section contains no values yet%><br /><br /></em>
    <%- end %>
    <% if self.addremove then -%>
            <div class="cbi-section-remove right">
                <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" onclick="this.form.cbi_state='del-section'; return true" value="<%:Delete%>" class="cbi-button" />
            </div>
    <%- end %>
    <%- end %>    
    <% if self.addremove then -%>
        <% if self.template_addremove then include(self.template_addremove) else -%>
        <div class="cbi-section-create">
            <% if self.anonymous then -%>
                <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
            <%- else -%>
                <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
                <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" />
                <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script>
                <input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" />
                <% if self.invalid_cts then -%>
                    <br /><%:Invalid%></div>
                <%- end %>
            <%- end %>
        </div>
        <%- end %>
    <%- end %>
</fieldset>

the package is compiled for ar71xx 15.05, if you need a different arch or branch let me know and I will whip it up so you can test

@hostle19

@hostle19, Using RangerZ.

Slick!  Looks like your open for business!! 

I am also using a MT7620N and RT5350F, but the ar71xx and MT7620N are what I plan to test on for now.

You should have access now, lets just use the ar71xx for now until we get everything running nice and  stable, then once its ready I will compile for other archs ...the less variables the better for now. I have been testing for 24 hours with out a hiccup so hopefully not much more work is needed before its ready to possibly push to LuCI. Seeing how the pkg is only 7kb I am debating on complimenting the ping check pkg by br-101 for internet checks( https://github.com/br101/pingcheck ), it would be a little cleaner. I am pretty happy with the way it turned out, I may redo the interface later on but I am a little busy until may so we'll have to see

@hostle19, please contact me by email

The discussion might have continued from here.