Quantcast
Viewing all articles
Browse latest Browse all 486

Orange Pi Zero Mainline NetworkManager WLAN AP

Had some free time to toy around with Orange Pi Zero

 

Used a image "Armbian_5.26_Orangepizero_Ubuntu_xenial_dev_4.10.0.img" build with  'compile.sh BRANCH=dev BOARD=orangepizero KERNEL_ONLY=no PROGRESS_DISPLAY=plain RELEASE=xenial BUILD_DESKTOP=no'

- which should not do anything special ?

 

1) First steps

- run upgrades and normal tweaking (changed hostname, disabled ipv6, changed ntp, changed time-zone, generated correct locale)

 

2) Ensure that WLAN0 is working as client

- using 'nmtui' created a new connection to my desktop WLAN router

- disabled auto connect from eth0

- reboot with serial connection

- run example speedtest-cli to see that the driver do work

 

3) Removed the client profile and redo the eth0 for auto connection

 

4) I used these lines to create the sample profile but them afterwards tweaked it around with nmtui 'edit profile'

nmcli c add type wifi ifname wlan0 con-name ap-wlan0 autoconnect no ssid zmserver
nmcli connection modify ap-wlan0 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli connection modify ap-wlan0 wifi-sec.key-mgmt wpa-psk
nmcli connection modify ap-wlan0 wifi-sec.psk "password"
nmcli connection up ap-wlan0

Key points here are 802-11-wireless.mode ap and shared

- shared means that network manager creates "internet-connection sharing" like MacOS and Windows wizards

- you cannot give dns-server or any other setting while using the shared - selection

 

Ensure that the "automatically connect" is selected to make sure that the connection is started when booted

 

5)

 

I do have the basic nat lines enabled with 'iptables-persistent'

sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

6)

 

Actual profile

root@iothub1:/etc/NetworkManager/system-connections# more AP
[connection]
id=AP
uuid=8e0bb6d9-52f9-4000-bbfa-d49db6790598
type=wifi
interface-name=wlan0
permissions=
secondaries=
timestamp=1487425840

[wifi]
band=bg
channel=1
mac-address-blacklist=
mac-address-randomization=0
mode=ap
seen-bssids=12:42:13:81:F5:29;
ssid=IotHub1

[wifi-security]
group=
key-mgmt=wpa-psk
pairwise=
proto=
psk=iothub123

[ipv4]
dns-search=
method=shared

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=ignore

Some output

# nmcli d
DEVICE  TYPE      STATE      CONNECTION
eth0    ethernet  connected  Wired connection 1
wlan0   wifi      connected  AP
lo      loopback  unmanaged  --

# nmcli c
NAME                UUID                                  TYPE             DEVICE
AP                  8e0bb6d9-52f9-4000-bbfa-d49db6790598  802-11-wireless  wlan0
Wired connection 1  b9e400ce-f567-3f12-b459-366adc05a7f2  802-3-ethernet   eth0

# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:13:81:f5:29
          inet addr:192.168.88.206  Bcast:192.168.88.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:45505 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28178 errors:0 dropped:0 overruns:0 carrier:0
          collisions:20 txqueuelen:1000
          RX bytes:66887562 (66.8 MB)  TX bytes:2051800 (2.0 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 12:42:13:81:f5:29
          inet addr:10.42.0.1  Bcast:10.42.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27567 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44475 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1901813 (1.9 MB)  TX bytes:67699829 (67.6 MB)

# iwconfig wlan0
wlan0     IEEE 802.11  Mode:Master  Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

7)

 

Does it work ==> YES

Is it fast ==> NO

Is it realiable ==> DO NOT KNOW

Feb 18 16:25:35 iothub1 wpa_supplicant[706]: wlan0: AP-STA-DISCONNECTED 78:45:61:ee:43:47
Feb 18 16:25:35 iothub1 kernel: [ 1723.628815] ieee80211 phy0: vif 0: set_key cmd 1
Feb 18 16:25:35 iothub1 wpa_supplicant[706]: Device is trying to offload WPS Probe Response while not supporting this
Feb 18 16:25:38 iothub1 wpa_supplicant[706]: Device is trying to offload WPS Probe Response while not supporting this
Feb 18 16:25:38 iothub1 wpa_supplicant[706]: wlan0: AP-STA-CONNECTED 78:45:61:ee:43:47
Feb 18 16:25:38 iothub1 kernel: [ 1726.789198] ieee80211 phy0: vif 0: set_key cmd 0
Feb 18 16:25:38 iothub1 kernel: [ 1726.789213] ieee80211 phy0: CCMP_PAIRWISE keylen=16!
Feb 18 16:25:38 iothub1 dnsmasq-dhcp[902]: DHCPREQUEST(wlan0) 10.42.0.153 78:45:61:ee:43:47
Feb 18 16:25:38 iothub1 dnsmasq-dhcp[902]: DHCPACK(wlan0) 10.42.0.153 78:45:61:ee:43:47 ideapad
Feb 18 16:26:07 iothub1 kernel: [ 1755.102706] sunxi-mmc 1c10000.mmc: smc 1 err, cmd 53, RD DCE !!
Feb 18 16:26:07 iothub1 kernel: [ 1755.109460] sunxi-mmc 1c10000.mmc: data error, sending stop command


Viewing all articles
Browse latest Browse all 486

Trending Articles