Languages

Menu
Sites
Language
script making the work easier

Hi!

As developer I have an engineer device with Tizen. During the development process I need to factory reset the device pretty often. After factory reset I need to manually setup all the data - Wifi password, accounts and so on.

Maybe you know if it is possible to setup the WiFi and acount data using sdb shell?

Responses

6 Replies
John Ixion

Hi Karol,

you'll find more info about SDB here https://developer.tizen.org/documentation/articles/smart-development-bridge

Karol Ksionek

sdb shell has limited possibilities, however when having root access to the device you can make many different things in shell. I'm not looking for information about what sdb can do. I need information what commands launched in shell can setup WiFi network and accounts.

 

For example I already have such commands:

sdb shell vconftool set -t int db/setting/lcd_backlight_normal 600 -f
sdb shell vconftool set -t bool db/setting/sound/touch_sounds 0 -f
sdb shell vconftool set -t bool db/setting/sound/button_sounds 0 -f
sdb shell vconftool set -t bool db/setting/sound/sound_lock 0 -f
 

Yin Simons

Posibilities for SBD shell is very restricted but having acces particularly to the device changes can be made .if your problem still not get solved,take it to a technical person.

Shuhrat Dehkanov

For setting up the Wi-Fi, you can use connmanctl.
A quick search results in Connmanctl Cheat Sheet gist, based on which you may write a shell script something like this:

#!/bin/bash
AP_SSID=SHD #change this with your AP's SSID
AP_PWD=0123456789 #change this with your AP's passphrase

sdb root on

sdb shell connmanctl scan wifi

AP_HASH=`sdb shell connmanctl services | grep $AP_SSID | awk '{print $2}'`
AP_HASH=$(echo $AP_HASH | sed -e 's/\r//g')
echo "Found AP $AP_SSID with hash $AP_HASH"

sdb shell "cat << EOF > /var/lib/connman/$AP_SSID-psk.config
[service_$AP_HASH]
Type = wifi
Name = $AP_SSID
Passphrase = $AP_PWD
EOF"

sdb shell connmanctl connect $AP_HASH
echo "Done!"

 

In the host terminal you should see following logs:

Scan completed for wifi
Found AP SHD with hash wifi_<hash>_managed_psk
Connected wifi_7<hash>_managed_psk
Done!

 

In the target, you should see following logs:

[ 3057.355228] wlan0: authenticate with <MAC_ADDRESS>
[ 3057.370702] wlan0: send auth to <MAC_ADDRESS> (try 1/3)
[ 3057.436591] wlan0: authenticated
[ 3057.442082] wlan0: associate with 0<MAC_ADDRESS> (try 1/3)
[ 3057.469725] wlan0: RX AssocResp from <MAC_ADDRESS> (capab=0x411 status=0 aid=1)
[ 3057.478562] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 3057.483489] wlan0: associated
[ 3057.486479] cfg80211: Calling CRDA to update world regulatory domain
[ 3057.547173] wlan0: Limiting TX power to 20 (20 - 0) dBm as advertised by <MAC_ADDRESS>

 

Happy surfing! :)

Karol Ksionek

That is what I need!

However on my device there's no connmanctl :/

Shuhrat Dehkanov

If there is no connmanctl, then there should some other alternative...
Please let us know more about your device (if possible) and the available service commands, then maybe we can figure out something else.