The KiwiSDR 2 online store is open for orders! Please visit kiwisdr.nz

KiwiSDR on wifi

Got my Kiwi to connect to my local wifi network. But it seems it is treating the wifi connection (wlan0) as a non local connection, even if ip adresses are local. Local network 192.168.1.X. Kiwi is given 192.168.1.225 by dhcp.

How to treat the wifi connection as local?

Wifi connection seems a better choice as less chance of hash via the ethernet cable and only the 5 V supply to consider.

73 de Olaf - LA3RK

Comments

  • jksjks
    edited October 2020
    If your WiFi card really appears to the system as "wlan0" then the Kiwi code should treat ip addresses assigned to it as "local". Support for this was added a long time ago.

    But there is no support from me for WiFi in general. Too many problems getting WiFi to work as demonstrated by the hundreds of posts on this forum.
  • Have to recheck. Yes, ifconfig run from ssh shows wlan0 connected to 192.168.1.225, same as listed on my local router. Message on console in admin page is;

    CONSOLE: only available to local admin connections

    Can connect to kiwi both as listener and as admin, but "CONNECT" on console page states that I am not on a local connection. But as long as I can connect via ssh it should be ok.

    Understand the missing support on wifi as it has a number of problems.
  • I've had wifi working for a while, and it's pretty good. I do occasionally find that it's disconnected (not sure if the beagle/kiwi is locked up or just wifi, I fix by a power cycle). I also notice audio buffer underruns, but I notice this on other kiwi receivers quite a bit too and they are presumably wired.
  • Is it normal for "Qlen" to start off around 4-5 and creep up to 19-20 after a few minutes? That's what I see happening, along with the underruns.
  • I tried wifi versus wired and found no improvement over my apparently well-engineered wired scheme
  • Does anyone know how to get connman to automatically connect wlan0 on startup? The daemon is running after a reboot but it's not connecting. I can connect manually just fine. This seemed to be working and now is not. I've set autoconnect on, I've disabled and enabled connman.service. I'm by no means a linux expert but I know my way around. I wonder if it's a timing problem and the usb wifi is not ready when it tries to connect...

    Any advice?
  • A quick and dirty "fix" would be to run a regular cronjob to execute a script; the script checking to see if wlan0 is present, and if not present / valid then reconnect wlan0.

    Create a file called check_start_wlan.sh in root's directory ("/root/check_start_wlan.sh")
    #!/bin/bash
    if ! `ifconfig | awk -F: '/^wlan0:/ && $0 != "" { getline; print $0}' | awk {'print $1'} | grep inet > /dev/null`
            then `connmanctl connect _managed_psk`
    fi
    Change the "your_wlan0_connection_string" for your particular wlan0 connmanctl connection string

    then as root:
    crontab -e
    Add this line to the end of the crontab:
    */10 * * * * /bin/bash /root/check_start_wlan.sh

    make sure to add an empty line after that line, then save/exit.

    Verify the crontab looks sane
    crontab -l

    This should every 10 minutes via cron: check the output of ifconfig, look for the line starting with "wlan0", get the next line and check if there's a valid IP address present (checking if the "inet" phrase is present), if "inet" not present then ask connmanctl to connect that connection.

    Note - only tested in my head, error conditions not trapped, running scripts as root creates a theoretical security risk etc etc etc.
    Happy to take suggestions/improvement
    njc
  • @cathalferris Thanks. I'd been thinking about trying something like this but the details of the script had escaped me. So I have it working right now without any changes. It seems that connman will autoconnect wlan0 if and only if eth0 is not connected (interestingly ifconfig shows eth0 UP with an IP address even though it's not plugged in). This all seems a bit inconsistent however because sometimes after a power cycle it doesn't connect. Of course with no UI or ssh I can't see what is going on either.

    I will try to implement your suggestion, first checking that the script works as intended.
    Thanks again!

    Nick
Sign In or Register to comment.