6

I'm trying to set a static IP(manual, no dhcp) address for wifi network using connmanctl. I'm running angstrom linux.

I get the following:

connmanctl
connmanctl> config wifi_"HASH"_managed_psk --ipv4 manual 192.168.10.2 255.255.255.0 192.168.10.1 Error wifi_"HASH"_managed_psk: Not supported

anyone has an idea how to do it?

4 Answers4

10

Instead of editing settings under /var/lib/connman/wifi_<HASH>_managed_psk/, one should edit the config file /var/lib/connman/service-name.config instead.

e.g.

debian@beaglebone:/var/lib/connman$ sudo cat wifi.config
[service_home]
Type = wifi
Name = yyyyyyyyy
Security = wpa
Passphrase = xxxxxxxxxx
IPv4=192.168.1.4/255.255.255.0/192.168.1.254
IPv6=off
Nameservers=8.8.8.8,8.8.4.4

For details, refer to the man page connman-service.config

Clarence Ho
  • 176
  • 2
  • 6
6

I managed to get a static IP address by manually creating a file named "settings" inside the directory:

  /var/lib/connman/wifi_<HASH>_managed_psk/

with the following content:

[wifi_<HASH>_managed_psk] 
Name=<SSID>                       ←Name of the network 
SSID=544f52414445585f4252         ←Name of the network in hexadecimal format    
Favorite=true
IPv4.method=manual                ←Method to be used (in this case manual IP)
IPv4.netmask_prefixlen=24
IPv4.local_address=192.168.0.133  ←Desired IP address
IPv4.gateway=192.168.0.1
Passphrase=<PASS>                 ←Wifi network password
AutoConnect=true

then activated and connected to the wifi

connmanctl enable wifi
connmanctl connect wifi_<HASH>_managed_psk
  • the answer can also be found here http://developer.toradex.com/knowledge-base/wi-fi-(linux)#configuring-wi-fi-with-static-ip-address – Giovanni Bauermeister Sep 08 '15 at 18:15
  • for some reason, it's not taking the desired ip address. it's auto fetching some random ip . what might cause this ? – mrid Aug 14 '20 at 10:44
-1

Try connmanctl enable wifi then you should be able to configure it

innuendomaximus
  • 353
  • 2
  • 3
  • 17
-1

once you install connman then it create configuration directory in /var/lib/connman where devices like wifi ,Ethernet etc. configuration file is created. in those file there is entry like :

[service_wifi_<HASH>_managed_psk]
Type = wifi
Name = <SSID>
Passphrase = <PASSPHRASE>   
IPv4.method=dhcp

open that file and see given name is correct that you are using in command

connmanctl config wifi_"HASH"_managed_psk --ipv4 manual 192.168.10.2 255.255.255.0 192.168.10.1

if other than wifi_"HASH"_managed_psk then use that . or you can see by using command connmanctl services

pl_rock
  • 14,054
  • 3
  • 30
  • 33