Wifi Scan



  • Hello

    For some reason it doesn't work to scan for wifi networks while your in the AP network on the webserver of the Omega.
    I tried it over Ajax->PHP->Shell and then returning the json string. It just loads...
    Then I tried the setup wizard just to look how Onion solved this problem, but it's not working there either.

    I don't think scanning for networks on boot or something like that, is a Solution.
    You should be able to scan for networks over a webserver and it works fine if your connected to the omega over the local network.

    Any suggestions?



  • @Fabian-Nydegger-0 You can scan the WiFi networks using a single ubus command:

    ubus call onion wifi-scan "{'device':'ra0'}"
    

    The wifisetup (not setup wizard as you mentioned) gets you through the process of connecting to available AP's. Also, wifisetup utility is an open source program that you can take a look in Our GitHub Repo



  • I want to setup the onion over my own Webserver, the only problem I have is:

    echo shell_exec("ubus call onion wifi-scan \"{'device':'ra0'}\"");
    

    calling this command in the php script over the Webserver while being in the AP Network of the Omega, causes an infinit loop.

    Can I avoid this somehow?



  • I totaly forgot about the Bonjour Service thats why it didn't worked, usally I just set it up using the command-line.

    Is there a way to to scan for Networks while setting up the omega without the Bonjour Service?



  • Finally found a solution:
    If you use your own custom webserver to setup the omega and want to display nearby Networks.

    <?php
    echo shell_exec("ubus call onion wifi-scan \"{'device':'ra0'}\"");
    ?>
    

    ^ This DOESN'T work! because:
    the php-interpreter doesn't have enaught ram to excute the command. It'll take a eternity.

    Solution:
    in /etc/php.ini
    set memory_limit form 8M to 32M

    memory_limit = 32M      ; Maximum amount of memory a script may consume.
    

    now the scan only takes about 5sec.



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