Hotspot / Access Point configuration - embedded Linux
0
votes
1
answer
2643
views
I am running an Ubuntu 16.04 derived Linux on an embedded processor, Yocto build
Kernel appears to be 4.14.141
I am bringing up a WiFi Access point on the hardware programmatically from C by enabling the radio with a call to
system("nmcli r wifi on");
( This may be superfluous at the moment but bear with me.)
At which point I bring up an access point with
system( "nmcli dev wifi hotspot ifname wlan0 ssid \"test\" password \"test1234\" ")
So Now I have in /etc/NetworkManager/system-connections a file
Hotspot.nmconnection with the correct details for this access point
[connection]
id=Hotspot-2
uuid=70c76bd2-0e13-492e-8a45-9094bc6e0773
type=wifi
autoconnect=false
permissions=
[wifi]
mac-address=00:04:F3:1B:BA:AE
mac-address-blacklist=
mode=ap
ssid=test
[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=test1234
[ipv4]
dns-search=
method=shared
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=ignore
My problem is that each time I want to use this access point I want to bring it up with a different SSID and a different password. The Access point is tied to a users session so its life is limited to that session and a set of credentials ( not available except through a passed hardware token ) The Wifi AP starts up to match the presented token and is shut down and can be destroyed after the token is removed.
Attempting to modify this configuration file with nmcli
system ("nmcli con mod Hotspot ssid \"newTest\" password \"newpass\" ");
fails with
Error: invalid . 'password'.
redefining the AP with the first command results in a successful new wifi AP being created but it gains a new configuration file with a number suffix based on the previous itterations Hotspot-2, Hotspot-n etc, wont be long until my flash overflows.
So how do I do this? Where and how do I define a password file which is what I gather I need or how do I change things to allow me to achieve my goal? I have a suspicion that I need to get polkit involved but that's a rabbit warren I have not been down yet.
Asked by nimbusgb
(101 rep)
Mar 31, 2022, 12:06 PM
Last activity: Jun 25, 2025, 10:04 AM
Last activity: Jun 25, 2025, 10:04 AM