Change OSMC connection from wired to Wi-Fi

I have one image that I use to restore any of my 7 Raspberry Pis running Kodi on OSMC.

Some of those devices use Wi-Fi.. However, the base image is wired.

This is a how to change the settings.

Step 1. Wired connection

Run a wire from a switch to the RAspberry PI. Open a terminal window and ssh into the Raspberry Pi

Step 2. Run connmanctl

$ connmanctl

connmanctl > technologies

connmanctl > enable wifi

connmanctl > scan wifi

connmanctl > agent on

connmanctl > services

Lists available Wi-Fi connections with a string that starts: wifi_

connmanctl > connect wifi_*

Use one of the strings From the above list that start with wifi_

Don't use the SSID

connmanctl > exit

$ sudo reboot