Install wifi ssid with space in it

I am trying to set up Wi-Fi on my raspberry pi android stuff, following the documentation .

My ssid contains a space in the name, let it say "my ssid".

I tried putting quotes around it like this:

$ adb shell am startservice \ -n com.google.wifisetup/.WifiSetupService \ -a WifiSetupService.Connect \ -e ssid "my ssid" \ -e passphrase secretpassword 

When viewing logcat for Wi-Fi connection, I see:

 WifiNetworkHistory: saving network history: "my"NONE gw: null Network Selection-status: NETWORK_SELECTION_ENABLED ephemeral=false choice:null link:0 status:2 nid:0 hasEverConnected: false WifiConfigurator: Wifi failed to connect in 30000 ms 

How to configure my Wi-Fi?

+6
source share
1 answer

To enter characters like "(double quotes)", * (asterisk), (space), we need to use escape sequences (i.e. the backslash before the character) to tell the compiler to read the character as part of the string instead of the command (for example , double quotes are usually interpreted as the beginning / end of a string to interpret it as a character in the string we use).

Decision

 $ adb shell am startservice \ -n com.google.wifisetup/.WifiSetupService \ -a WifiSetupService.Connect \ -e ssid "my\ ssid" \ -e passphrase secretpassword 
+9
source

Source: https://habr.com/ru/post/1013501/


All Articles