Loss of static ip configuration in wifi setting

REPRODUCIBILITY (% or how often): 100%
BUILD ID = OS VERSION (Settings > About product): 4.2, 4.3, 4.4
HARDWARE (XA2, X10, X10 II, …): X10, X10 II, X
UI LANGUAGE: -
REGRESSION: (compared to previous public release: Yes, No, ?):

DESCRIPTION:

after manually entering the IP configuration in “Wifi setting”, these settings are lost after a few connections to our home network, i.e. IP-address, subnetmask, gateway disapear, DNS entries always stay

PRECONDITIONS:

STEPS TO REPRODUCE:

  1. Setting static IP configuration
  2. Enable wifi connection
  3. Disable wifi connection
  4. Repeat step 2) & 3)
  5. Settings going lost

EXPECTED RESULT:

Settings remain

ACTUAL RESULT:

Settings must be re-entered more often during the day

ADDITIONAL INFORMATION:

(Please ALWAYS attach relevant data such as logs, screenshots, etc…)

3 Likes

some more comments can be found here

3 Likes

Confirming: IP, mask and Gw are forgotten after switching wifi on/off/on.
DNS 1+2 stay recorded.

Thanks for the report and confirmations. I’ve created an internal bug report and tagged this as “tracked”.

5 Likes

Hi, seems that this bug is not fixed yet?

I have the same problem, wifi settings get lost now and than. iP, Subnetmask and Gateway vanishs, DNS stays.

Very annoying, is there a fix?
Thanks!

No, unfortunately, as far as I know, the bug has not yet been fixed. This is the reason why I have reactivated DHCP at home again …

Not fixed yet but also they removed the “Edit” option from long press on a wifi access point name, in Settings → Wifi, after ~4.3v SFos (Please Jollaboys bring it back!). From my experience so far: It is random. My DHCP server (the internet provider’s router I have) some times does not work as it should and doesn’t respect the IP range I have set, no ideas if it has anything to do. Some times IP is lost but IPv6 DNS appear even I have only IPv4 settings.

A workaround that I will test the following days:

From command as root line you can see the WiFi that are saved in connmann with the following command:
connmanctl services

It should appear a list, the second row is the AccessPoint (A/P) name and the third the unique name connmann uses for the specific A/P, ex" wifi_1b123456c12f_123c123c3a7b6e_managed_psk (The following part is only informational: this is also the name of a folder you can find in: /home/defaultuser/.local/share/system/privileged/connman . In there you will find a “settings” file that has all the info of the specific wifi A/P (Name, Passphrase, IP etc) ).

Using connmanctl you can connect to a specific wifi:

connmanctl connect wifi_1b123456c12f_123c123c3a7b6e_managed_psk  

and also set some parameters:

connmanctl config wifi_1b123456c12f_123c123c3a7b6e_managed_psk --ipv4 manual 192.168.0.10 255.255.255.0 192.168.0.1 --nameservers 192.168.0.1 192.168.0.2 --ipv6 off

I will make a shell script and run them as root every time I have the problem.

A second lazy workaround I do is to go to wifi Details, Edit → check Auto-retrieve IP address → Save, Edit again, uncheck Auto-retrieve IP address, and I see the fields filled from DHCP. I usually edit only the last number of the IP and I am okey.

I also tried to chmod 400 (readonly by root) the settings connman file, but the moment I run the above connman command to change the settings the file got writen and appeared with chmod 600 (read-write).

Cheers

1 Like

I’ve tried everything to make the ip static, the mac address is randomized on bootup. I tried editing conman files, but the format of the conman folders is obviously MACADDRESS_WIFI-UUID, and the mac changes every bootup making the older files useless. I wonder if a startup script that changes the name of the older conman config folder to have the NEW mac address would work to enable the network to come up with the same iP. I then have to take it out of my dhcp pool so my router never overwrites it… I will try, this is still an issue. Not sure if its a bug per say, but, I have to enter the WIFI password again after every bootup which is annoying. I like a good challenge though.

ohkay… I got a work around… make a script
[root@phone defaultuser]# cat change_mac.sh
!/bin/bash
sleep 4
ip link set dev wlan0 address 40:45:DA:96:8C:0B

chmod 777 change_mac.sh

[root@phone defaultuser]# ls -lt change_mac.sh
-rwxrwxrwx 1 root root 158 Apr 3 08:08 change_mac.sh

then make a systemd service to run it on bootup (because no cron)

devel-su
vi /etc/systemd/system/change-mac.service

#put this in the file

[Unit]
Description=Change MAC Address on Boot
After=network-pre.target
Wants=network-pre.target

[Service]
Type=oneshot
ExecStart=/home/defaultuser/change_mac.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

  • now save the file esc : wq

  • make systemd aware of your new service…

systemctl daemon-reload

  • Enable your service to start automatically at boot:

systemctl enable change-mac.service

  • If you want to test your service without rebooting, start it manually:

systemctl start change-mac.service

  • To check the status of your service:

systemctl status change-mac.service

NOW SET THE MAC ADDRESS 40:45:DA:96:8C:0B TO BE A STATIC IP IN YOUR ROUTER DHCP i.e. 192.168.1.111

NOW reboot the sailfish os phone, when you reconnect your wlan it will have that MAC ADDY 40:45:DA:96:8C:0B and it will be served 192.168.1.111

I rebooted many times to test and it came up the same ip everytime.

Some other devices needed sleep 10 instead of sleep 4

Cheers.

3 Likes