I am using OSMC that I installed back in June 2015 on my raspberry Pi 2.
Here is the scenario.
Raspberry Pi 2 is connected to Wifi network A no ethernet cable connected.
I am connected to it via SSH terminal through my computer.
There is no visual access no hdmi connected.
How can I change Wifi Configuration of OSMC via terminal/SSH so that it now connects to a Wifi Network B ?
using connmanctl when I type
it disconnects my existing remote connection ( SSH remote terminal ) but also does not connect to the network B, because that is password protected and I have no chance to type in the password.
connect does not take wifi password as argument…
The whole point of question is that I am accessing it remotely via SSH using network A and want to switch Wifi connection of OSMC to wifi network, whatever the solution is I will have to provide password and wifi information all at once…
This is an interesting problem that’s why I though I would mention it at the very outset that I do not have ethernet connection just wifi connection and the same connection has to be switched to a different wifi network.
If I could update the configuration directly in the file where it stores the WIFI information then probbaly that would do, for example following information is applicable on raspbian. You can edit following file
The way connman works you won’t be able to configure and connect to a second wifi network when controlling connmanctl via SSH over the first wifi network, because you will lose your first connection before completing the second connection, thus losing control of the connmanctl session.
connman doesn’t support “pre-configuring” wifi networks, to configure/save a network you must actually connect to it, and only once you have disconnected from the old network and connected to the new network will the network be saved.
Sorry but that’s just the way connman works, and yes, what you are trying to do is a bit of an unusual use case - OSMC is a mediacenter designed to be controlled with an onscreen GUI after all.
Actually this is doable. I could configure OSMC WiFi with connman via wired ethernet and have both interfaces up at the same time, then disconnect the wired interface and stay connected via wifi.
This is a great resource:
To pre-configure the wifi secret, see the section “Write config file for connecting to secure AP:”
Then when you bring up the interface with “connmanctl connect …” it will just connect and not prompt for a password. In my case, it didn’t disconnect Ethernet either,
My problem is the following, and I would like to know if it is possible to do it using OSMC.
The thing is completely related to this topic, so I thought it would be better not to open a new thread but continue this one (maybe, with the new versions that have been released of OSMC now it is possible to achieve this).
I would like to give my raspberry with OSMC installed to a friend, who is not tech savvy. He has passed me the SSID and password of his network so I would like to give it to him pre-configured. I would prefer to give him the system pre-installed with some plugins (he doesn’t know how to install them) so it can’t be the first installation.
I have thought that I could change temporarilly my home’s SSID and password and maybe it could work but I would like to know if there is a better way.
I know how to do it in a raspbian or other distros not based on connman, but not how to do it in OSMC.
In the link posted by htpcero, the section “Write config file for connecting to secure AP:” could be the solution to my question but the problem is, for the line “[service_wifi__managed_psk]” I do not know the hash, I have not access to the Wifi and only know the SSID and password.
When I reverted the changes (changed again the SSID in the router to the original one and wrote the original preseed.cfg configuration) which was:
d-i target/storage string sd
d-i network/interface string wlan
d-i network/auto boolean true
d-i network/ssid string SSID2_Without_Spaces
d-i network/wlan_keytype string 1
d-i network/wlan_key string passphrase2
It worked. In order to test if I had done something wrong or if it just isn’t reading the preseed.cfg and taking the configuration that works (which is stored somewhere), I wrote a false SSID and a wrong password in the preseed.cfg and put the original SSID and original password in the router. The connection worked.
So the only think that occurs to me is that it isn’t reading the preseed with the changes. Could that be possible?
It’s just that in my original comment I said “I would prefer to give him the system pre-installed with some plugins […] so it can’t be the first installation” so I guessed that what was answered worked not only for the first boot.
If it is impossible to give to a friend a system pre-installed with some plugins … ok, it’s just a pity.