Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Trouble using nmcli for AP on RPI 3 (32)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
brendlefly62
Tux's lil' helper
Tux's lil' helper


Joined: 19 Dec 2009
Posts: 133

PostPosted: Thu Apr 19, 2018 3:54 pm    Post subject: [Solved] Trouble using nmcli for AP on RPI 3 (32) Reply with quote

Hi. I'm having trouble interpreting results when trying to use nmcli to create a wifi access point on a raspberry pi 3 (32bit) that I have running. I am running headless and using NetworkManager -- eth0 comes up cleanly. I am running owncloud server successfully, but I want to experiment with using the rpi3 as an AP.
Code:
# uname -a
Linux raspberrynodename 4.9.77-v7+ #1 SMP Tue Mar 13 20:42:08 EDT 2018 armv7l ARMv7 Processor rev 4 (v7l) BCM2835 GNU/Linux

I've used a set of nmcli commands to create a "Hotspot" connection, but when I try to bring it up, I get:
Code:
# nmcli c up Hotspot ifname wlan1
Error: Connection activation failed: Connection 'Hotspot' is not available on the device wlan1 at this time.

Note the Error message: Error: Connection activation failed: Connection 'Hotspot' is not available on the device wlan1 at this time.
Sometimes I get an error indicating incompatibility because the mac of the device is different from the mac of the connection. However, if I reset one or the other to match, I still get an error, and the hotspot will not come up.


Note that I've tried this with both the on-board wifi of the rpi 3 and with an external dongle/antenna, but though they have differing properties as can be seen at the bottom of this post, both give me the same basic result.
Am I simply using an adapter that won't do this? Or can someone help me see what I'm doing wrong?


Here are the commands I've used to create the connection, the resulting "Hotspot" config file, and other status info:
Code:

# IFNAME=wlan1
# PASSWORD=<mypassphrase>
# SSID=<myssid>
# CON=Hotspot
# CONFIG_PATH=/etc/NetworkManager/system-connections/
# MAC=$(nmcli d show wlan1 | grep -i hwaddr | sed 's/ //g' | cut -d':' -f2-)
# nmcli c delete ${CON}
Connection 'Hotspot' (<old uuid>) successfully deleted.

# nmcli c add type wifi ifname ${IFNAME} con-name ${CON} ssid ${SSID}
Connection 'Hotspot' (<new uuid>) successfully added.

# nmcli c modify ${CON} autoconnect yes
# nmcli c modify ${CON} 802-11-wireless.mode ap
# nmcli c modify ${CON} 802-11-wireless.band bg
# nmcli c modify ${CON} 802-11-wireless.hidden no
# nmcli c modify ${CON} 802-11-wireless.mac-address ${MAC}
# nmcli c modify ${CON} ipv4.method shared ipv6.method auto
# nmcli c modify ${CON} wifi-sec.key-mgmt wpa-psk
# nmcli c modify ${CON} wifi-sec.group ccmp wifi-sec.pairwise ccmp
# nmcli c modify ${CON} wifi-sec.psk ${PASSWORD}
# nmcli c modify ${CON} wifi-sec.proto rsn
# nmcli c up ${CON} ifname ${IFNAME}
Error: Connection activation failed: Connection 'Hotspot' is not available on the device wlan1 at this time.

Here is the resultant config file:
Code:
# cat /etc/NetworkManager/system-connections/Hotspot
[connection]
id=Hotspot
uuid=<uuid>
type=wifi
interface-name=wlan1
permissions=
secondaries=

[wifi]
band=bg
mac-address=<mac>
mac-address-blacklist=
mac-address-randomization=0
mode=ap
seen-bssids=
ssid=<ssid>

[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=<mypassphrase>

[ipv4]
dns-search=
method=shared

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

here is some status info:
Code:
# nmcli d wifi list
*  SSID                        MODE   CHAN  RATE       SIGNAL  BARS  SECURITY
   <ssid 1>                    Infra  11    54 Mbit/s  100     ▂▄▆█  WPA2     
   <ssid 2>                    Infra  1     54 Mbit/s  82      ▂▄▆█  WPA2     
   <ssid 3>                    Infra  1     54 Mbit/s  77      ▂▄▆_  WPA2     
  ... <all aps in range, but not the one I'm trying to create>
Code:
# nmcli c
NAME                UUID                                  TYPE                DEVICE
eth0                <uuid 0>                              802-3-ethernet      eth0
<ssid 1>            <uuid 1>                              802-11-wireless     --
Hotspot             <uuid 2>                              802-11-wireless     --
...
Code:
# nmcli c show ${CON}
connection.id:                          Hotspot
connection.uuid:                        <uuid>
connection.stable-id:                   --
connection.interface-name:              wlan1
connection.type:                        802-11-wireless
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.timestamp:                   0
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        -1 (default)
802-11-wireless.ssid:                   <ssid>
802-11-wireless.mode:                   ap
802-11-wireless.band:                   bg
802-11-wireless.channel:                0
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            <mac>
802-11-wireless.cloned-mac-address:     --
802-11-wireless.generate-mac-address-mask:--
802-11-wireless.mac-address-blacklist:
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              default (0)
802-11-wireless-security.key-mgmt:   wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg:   --
802-11-wireless-security.proto:         rsn
802-11-wireless-security.pairwise:   ccmp
802-11-wireless-security.group:         ccmp
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0:   <hidden>
802-11-wireless-security.wep-key1:   <hidden>
802-11-wireless-security.wep-key2:   <hidden>
802-11-wireless-security.wep-key3:   <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type:  0 (unknown)
802-11-wireless-security.psk:           <hidden>
802-11-wireless-security.psk-flags:     0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
ipv4.method:                            shared
ipv4.dns:
ipv4.dns-search:
ipv4.dns-options:                       (default)
ipv4.dns-priority:                      0
ipv4.addresses:
ipv4.gateway:                           --
ipv4.routes:
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns:
ipv6.dns-search:
ipv6.dns-options:                       (default)
ipv6.dns-priority:                      0
ipv6.addresses:
ipv6.gateway:                           --
ipv6.routes:
ipv6.route-metric:                      -1
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --

Code:
# nmcli d show ${IFNAME}
GENERAL.DEVICE:                         wlan1
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         <mac>
GENERAL.MTU:                            1500
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
Code:
# iwconfig
wlan1     IEEE 802.11  ESSID:off/any 
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

...

wlan0     IEEE 802.11  ESSID:off/any 
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
Code:
# ifconfig
wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether <ether>  txqueuelen 1000  (Ethernet)
        RX packets 1733  bytes 241739 (236.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 7550 (7.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether <ether>  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Code:
# iw dev wlan0 info
Interface wlan0
   ifindex 4
   wdev 0x1
   addr <mac0>
   type managed
   wiphy 0
   channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
   txpower 31.00 dBm
# iw dev wlan1 info
Interface wlan1
   ifindex 6
   wdev 0x100000001
   addr <mac1>
   type managed
   wiphy 1
   txpower 20.00 dBm


Last edited by brendlefly62 on Sat Apr 21, 2018 7:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
brendlefly62
Tux's lil' helper
Tux's lil' helper


Joined: 19 Dec 2009
Posts: 133

PostPosted: Sat Apr 21, 2018 7:39 pm    Post subject: Reply with quote

Never mind. I decided to drop NetworkManager and the nmcli method, and I succeded in establishing an AP using this wpa_supplicant technique instead:
https://forums.gentoo.org/viewtopic-t-1007254-start-0.html
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54097
Location: 56N 3W

PostPosted: Sat Apr 21, 2018 9:13 pm    Post subject: Reply with quote

Moved from Networking & Security to Gentoo on ARM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum