Access Point mode not activated when failed to connect to WiFi



  • Could it be that the AP mode does not start up, if the Omega is set up to certain WiFi that is not in range at the moment? My Omega successfully connects to the network, when in the home network, and it also initiates AP where I can connect to and access it via 192.168.3.1

    However, when I brought it to other place where there's another WiFi that it does not know, and booted it up, it failed to start the AP, so I could not configure it for the other WiFi.

    Is there a good explanation for this, of was it just a glitch? Perhaps the fact that it launches a never-ending Python script via the /etc/rc.local file? Maybe it hinders the Omega from initializing the AP in some way?


  • administrators

    Hi @Pavils-Jurjans, unfortunately, we haven't figured out a good explanation for this. The problem is related to the fact that there is only one physical WiFi interface on he Omega, so the software must divid the wifi signal between two virtual interfaces, for the access point and for the one that connects to your home network. I think when it is unable to connect to your home network, the software that switches between the two interfaces might be stuck trying to send packets on the home network interface.

    We currently already have a solution for this. There is a program called wifi-saint that detects if the home network interface is down, and disables it to allow AP to run. However, this program is run as a cron job every 5 minutes, which means you will need to wait for about 5 minutes for your home wifi to be disabled and for the access point to become enabled.

    We are currently working on something else which will also help with this problem. We are working on a way to store your Wifi information on the Omega itself (just like your computer) so that it will be able to remember the credentials for multiple wifi networks. This way, when you transfer the Omega from one location to another, it should automatically reconnect to a wifi network it has connected to before.

    I hope this is able to answer your questions.
    Happy holidays!



  • Thanks, @Boken-Lin, I'll try out the wifi-saint program meanwhile. 5 minutes is still better than never, or messing with serial connection. Can you, please tell, which package should I install to get this program?

    The framework that keeps WiFi info for several networks is very logical step, and I am looking forward to install it, when it comes ready. It could have the option to fallback to AP mode, if it can not connect to any of the known WiFi networks.


  • administrators

    @Pavils-Jurjans wifi-saint should be installed by default. Just test it out by configuring a wrong wifi setting and wait for 5 minutes or so. The wifi network should disable itself and turn on AP.



  • I'm not sure why and how, but there seems to be no wifi-saint on my Omega, and it does not turn on AP, when not able to connect to home WiFi. At least, writing wifi-saint in command line gives "file not found" error, and find / -name "wifi-saint" does not bring up any matches.



  • Try
    opkg list |grep wifi-saint



  • Sorry with out the - or opkg list |grep wifisaint



  • Must be disabled by default

    root@Omega-170B:/home/omega# opkg list |grep wifisaint
    wifisaint - 0.1-1 - Cron service to create an AP wifi network if all networks are disabled



  • To check wifisaint do the following:

    1. Run opkg list wifisaint
      This should show:
      wifisaint - 0.1-1 - Cron service to create an AP wifi network if all networks are disabled
      This only tells you that opkg knows about wifisaint
      If you get nothing, run opkg update first and try again
    2. To check that wifisaint is installed, run opkg list-installed wifisaint
      If it is installed, this will show:
      wifisaint - 0.1-1
      If it doesn't show this, you need to install it by running:
      opkg update
      opkg install wifisaint
      And check again
    3. Once wifisaint is installed, run the command crontab -l
      The output should at least include a line like:
      */10 * * * * /usr/bin/wifisaint
      which indicates that wifisaint will be run every 10 minutes (not 5 minutes as has been reported elsewhere)
      You can change the frequency at which wifisaint is run by doing the following:
      • Take a copy of the file /etc/crontabs/root (e.g. to /root/ctab)
      • Edit the file /root/ctab) to read (e.g.):
        */2 * * * * /usr/bin/wifisaint
        to run it every 2 minutes (look for crontab usage online for more details of format)
      • Run the command
        crontab /root/ctab
        to start using your new crontab file


  • Thanks for a very detailed answer, @Kit-Bishop ! I found out that the program is indeed installed on my Omega. I was just looking for one with dash (wifi-saint).

    I am not sure it launched the AP after 10 minutes, though - when I experienced the problem. But maybe those 10 minutes have not passed when I stopped trying. I have to test it once again. Could it be that a non-exiting python program (a monitoring script) registered in /etc/rc.local prohibits contrab from launching wifisaint?


  • administrators

    Hi @Pavils-Jurjans The non-exiting python program could be an issue. Can you try launching the python program with an & at the end to let it running in the background?



  • Thanks, the script launches&performs well, I'll need som outside-the-home testing to report whether the wifisaint really activates the AP.


  • administrators

    @Pavils-Jurjans You can test it out by first connecting the Omega to your smartphone's wifi hotspot, and then turning it off to see if the Omega resets its wifi configuration.



  • I've found out, though that 2 minutes is not a good idea. Then it always starts in AP mode. Perhaps at the time when crontab launches wifisaint, the wifi has not yet properly initialized, thus making wifisaint to happily switch on the AP mode. I changed it back to 10 minutes, and now it connects to home WiFi fine. Actually, the premature wifisaint checking (if that's the case) would happen, albeit with much lower probability, also if the crontab is set up with every-10-minutes rule, if one is very unlucky to start Omega exactly few seconds before the 10th minute (ie, at 19:39:47, 13 seconds before the 10th minute).


  • administrators

    @Pavils-Jurjans Running wifisaint on cron is quite an inefficient way to do it. We are working on a wifi manager for the Omega so that it can remember wifi networks and their passwords and also check to see if connections are established correctly. Once it is finished, it will restore connection when connecting to wifi fails instead of doing a check every few minutes.



  • Does wifisaint have some logs I could check? Because I experienced an embarrassing moment when my device would not init as AP in the new years eve, that was painful. I'd like to understand what's going on.


  • administrators

    @Pavils-Jurjans I apologize for causing the embarrassment. Unfortunately wifisaint doesn't have any logs right now. However it does output dmesg when it encounters errors. Can you describe what you were doing?

    Our new wifi setup tool will be released soon, and hopefully it will eliminate all of these issues.

    Thank you for your patience!


Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.