Guide for Artik530 710 with Tizen 4.0

From Tizen Wiki
Jump to: navigation, search

Introduction

This guide will provide you with an in-depth introduction to Samsung ARTIK 710 and ARTIK 530 Development Board. This document will touch upon various developer test guide such as multimedia, wifi, bluetooth, …, etc. Each section in this guide will explain each functionality, with a software centric approach.

The first method to interface with the variety of peripherals is using command line tools. This is usually the initial approach to verify functionality and features of individual Multimedia devices. Many of the examples throughout this manual use command line tools that are natively present or can be installed.

The second method of accessing peripheral devices is through the use of the Software API that Samsung provides as part of the development environment. Examples of this approach cannot be found in this manual but will be found in the Software API document.

Note
For convenience, if described as following;

ARTIK board or ARTIK module means both Artik710 and Artik530 development board.

Camera means both MIPI Camera and USB camera.

Multimedia

Refer to Tutorial for Multimedia on ARTIK530/710 with Tizen 4.0

Wireless Lan

Overview & Introduction

This section is for providing/understanding a basic knowledge of Wifi connectivity and setting Wifi environment on Tizen development platform. It will show how to set up Wifi connections with standard command-line tools like connman and wpa_cli, which allow you to configure and also describe how to configure a generic Wifi network connection, how to create a P2P (Peer 2 Peer, or Wifi direct) wireless connection and how to setup a Soft AP mode connection.

ARTIK board with Tizen 4.0 supports 3-types of Wifi network connection mode.

  • STA Mode(Station) connect to default mode act as a client to connect with a Wifi access point, AP(Access Point).
  • P2P Mode(Peer to Peer, Wifi Direct Mode) connect to other devices directly.
  • SoftAP Mode(Software Access Point) makes ARTIK act as AP(Access Point).

This will describe how to check each function of WLAN mode(as Client / Owner).

Terminology
Abbreviation Descriptions
AP Access Point
DHCP Dynamic Host Configuration Protoco
MAC Media Access Control
P2P Peer to peer
PIN Personal identification number
PSK Preshared key
Soft AP Software-enabled access point
SSH Secure shell
STA Station
UART Universal asynchronous receiver/transmitter
WPA Wi-Fi protected access
WPA_CLI WPA command line client
WPS Wi-Fi protected setup

Environment

Install Wlan Tool & Utility

| Firmware and Driver

you have to Install the following plug-ins for wifi firmware. you can get this plug-ins from ARTIK representative only, please contact them.

artik710_plugin.tar.gz wifi firmware for artik710
artik530_plugin.tar.gz wifi firmware for artik530

Wlan Tool & Utility Descriptions

| Connection Manager

There are two user interfaces available to control network services: Both of these are capable of managing Wi-Fi connections.

wpa_cli
This is text-based frontend program for interacting with wpa_supplicant is used to query current status, change configuration, trigger events, and request interactive user input. this allows complex configurations and supports concurrent P2P/STA configurations. But CLI commands are not as simple.
Connman
Connman is a connection manager daemon that lets you manage network connections over Wifi and designed for use with embedded devices. this is easy to use with simple CLI commands. But P2P connection not supported and Concurrent P2P/STA configuration not supported.
Note
In STA mode you can use either connman or wpa_cli to manage the STA connection.

In P2P mode only wpa_cli is supported to manage the P2P connection.

Wlan Basic Function

WLAN Initial

Set Common Environment

  1. Before you perform Wifi operations, connect ARTIK board to desktop via Terminal emulator such as Minicom.
  2. Boot up Artik board patched with Wlan plug-in included firmware.
  3. Automatically Initialized during boot on ARTIK Board.
  4. if not, run ‘wlan.sh’ in /usr/bin/ with option for operation mode. For operation mode option, refer to the next step.

WLAN Mode Set

Wlan mode is provided 3 mode as described but there are provided 4 option.

$ wlan.sh [start] [stop] [softap] [p2p]

if set it as below, ARTIK board will run to station(STA) mode.

$ /usr/bin/wlan.sh start

If set to ‘wlan.sh stop’, it will be stopped wlan mode. Following no option or invalid char., it will be just displayed model name for WLAN controller with no action.

WLAN Mode Switching

/usr/bin/wlan.sh start
/usr/bin/wlan.sh stop
/usr/bin/wlan.sh softap
/usr/bin/wlan.sh stop
/usr/bin/wlan.sh p2p
/usr/bin/wlan.sh stop

Wlan Major Mode Function

STA Mode

STA Mode | Station Mode

Station mode is the default operation mode of wifi. In this mode, the wifi adapter operates as client that connects to a wifi AP(Access point). When configuring this Wi-Fi connection it will be setup in station mode, meaning it will operate as a client that connects to a wireless access point.

1. Attach a Wifi antenna on ARTIK Module and scan wifi network using defined interface.

$ wpa_cli -iwlan0 scan
ok

2. Now scan for the wireless access points.

$ wpa_cli -iwlan0 scan_results
bssid / frequency / signal level / flags / ssid
...scanned results...

3. Configure ‘wpa_supplicant.conf’ to include your Wi-Fi router settings. You can use the ‘wpa_passphrase’ command to write your router SSID and PASSWORD into wpa_supplicant.conf like "wpa_passphrase <SSID> <PASSPHRASE> >> /etc/wpa_supplicant/wpa_supplicant.conf"

$ wpa_passphrase MyAP abcd1234 >> /etc/wpa_supplicant/wpa_supplicant.conf
  • Before restarting the service, check the ‘/etc/wpa_supplicant/wpa_supplicant.conf ’ file to verify that a new network block has been included. Configuration file should be like below.
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
	ssid="MyAP                   /* ssid="SSID"
	#psk="abcd1234"      /* #psk="PASSPHRASE"
	psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
| Using connman daemon

1. Enable connman daemon

$ systemctl start connman
$ systemctl enable connman
$ systemctl start wpa_supplicant

2. Enter following connman commands:

$ connmanctl enable wifi

3. Scan available networks

$ connmanctl scan wifi

4. To list the available networks found after a scan, enter the following:

$ connmanctl services

5. Terminal shows typical output from a network scan. Setting up Wi-Fi connections

| Connect to an open AP

1. To connect to an open network, use the connmanctl connect command and enter the full “wifi_” name.

$ connmanctl connect wifi_xxxxxxxxxxxxxxx_xxxxxxxxxxxxxx_managed_psk

2. Verify that you are connected to the network by entering the following:

$ connmanctl state
| Connect to an protected AP

1. To start connmanctl mode, run the following:

$ connmanctl

2. To scan for available Wi-Fi networks, enter the following:

connmanctl> scan wifi

3. To list services, enter the following:

connmanctl> services

4. To register the agent to handle user requests, enter the following:

connmanctl> agent on

5. To connect to one of the protected services, enter the following:

connmanctl> connect <service>
Note
...where <service> is not the name of SSID but the full “wifi_” name. You might have to enter a passphrase if the selected Wi-Fi network requires authentication. For a WPS connection, enter an empty string for the passphrase so the system can then ask you to enter the WPS PIN or WPS PBC.

The following is an example of wpa_supplicant.conf.

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="netsto"
#psk="0312031203"
psk=wifi_702c1f31b4b8_6e657473746f_managed_psk
}
Note
Make certain that the spelling in the file is correct, the ‘wpa_supplicant’ will not start at booting time and will not connect to the AP, if there is misspelling in the configuration file.

An connection example according to above description is the following;

$ cp wpa_supplicant.service /lib/systemd/system
$ systemctl enable wpa_supplicant                                  
Created symlink /etc/systemd/system/multi-user.target.wants/wpa_supplicant.service.

$ systemctl start wpa_supplicant                                        
$ systemctl status wpa_supplicant
   wpa_supplicant.service - WPA Supplicant daemon
   Loaded: loaded (/usr/lib/systemd/system/wpa_supplicant.service; bad; vendor preset: enabled)
   Active: active (running) since Tue 2017-05-23 16:50:27 KST; 27s ago
   Main PID: 18371 (wpa_supplicant)
   Memory: 1.6M
   CGroup: /system.slice/wpa_supplicant.service
           ─18371 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplic.
   conf -u -f /var/log/wpa_supplicant.log

May 23 16:50:27 artik systemd[1]: Starting WPA Supplicant daemon...
May 23 16:50:27 artik systemd[1]: Started WPA Supplicant daemon.
root:/home> systemctl stop connman
Warning: Stopping connman.service, but it can still be activated by: connman.socket
$ ifconfig wlan0 down
$ wpa_supplicant -dd -Dn180211,wext -i wlp10s0b1 -c /etc/wpa_supplicant.conf
wpa_supplicant v2.5
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlp10s0b1' conf '/etc/wpa_supplicant.conf' driver 'n180211,wext' ctrl_interface 'N/A' bridge'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Line: 1 - start of a new network block
ssid - hexdump_ascii(len=6):

$ cp wpa_supplicant.conf /var/run
$ wpa_cli -i wlan0
wpa_cli v2.5
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.

Interactive mode
–------------------------------------------------------------------------------------- Run Connman
$ connmand -v     
1.29
$ systemctl start connman
$ systemctl enable connman
Created symlink /etc/systemd/system/multi-user.target.wants/connman.service → /usr/lib/systemd/system/connman.service.
$ connmanctl enable wifi
Enabled wifi
------------------------------------------------------------------------------------- Connect to openAP
$ connmanctl
connmanctl> scan wifi             
Scan completed for wifi
connmanctl> services
*AR Belkin_N_Wireless_1F6E8F wifi_702c1f31b4b8_42656c_managed_none
    netsto         wifi_702c1f31b4b8_6e657473746f_managed_psk
    n104r          wifi_702c1f31b4b8_6e31303472_managed_psk
    net5G          wifi_702c1f31b4b8_6e657473746f3547_managed_psk
    Net4073        wifi_702c1f31b4b8_552b4e657434303733_managed_psk
    WiFi_6577      wifi_702c1f31b4b8_6f6c6c65685f576946695f36353737_managed_psk
    DIT            wifi_702c1f31b4b8_444954_managed_psk
connmanctl> agent on
Agent registered
connmanctl> Connect wifi_702c1f31b4b8_42656c_managed_none
Connected wifi_702c1f31b4b8_42656c_managed_none
connmanctl> disconnect wifi_702c1f31b4b8_42656c_managed_none
Disconnected wifi_702c1f31b4b8_42656c_managed_none
------------------------------------------------------------------------------------ Connect to protectedAP
connmanctl> scan wifi                                         
Scan completed for wifi
connmanctl> services
*A  Belkin_N_Wireless_1F6E8F wifi_702c1f31b4b8_42656c_managed_none
    netsto         wifi_702c1f31b4b8_6e657473746f_managed_psk
    n104r          wifi_702c1f31b4b8_6e31303472_managed_psk
    net5G          wifi_702c1f31b4b8_6e657473746f3547_managed_psk
    Net4073        wifi_702c1f31b4b8_552b4e657434303733_managed_psk
    NetA5E3        wifi_702c1f31b4b8_552b4e657441354533_managed_psk
    WiFi_6577      wifi_702c1f31b4b8_6f6c6c65685f576946695f36353737_managed_psk
connmanctl> agent on
Agent registered
connmanctl> connect wifi_702c1f31b4b8_6e657473746f_managed_psk
Agent RequestInput wifi_702c1f31b4b8_6e657473746f_managed_psk
  Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
  WPS = [ Type=wpspin, Requirement=alternate ]
Passphrase? 0312031203
Connected wifi_702c1f31b4b8_6e657473746f_managed_psk
connmanctl> 

P2P Mode

P2P Mode | Peer to Peer Mode, Wifi Direct Mode

The p2p mode is so called wifi direct mode to connect with each other WIFI adapter without requiring an AP.

Before testing, First configure wpa_supplicant.conf as follow;

wpa_supplicant.conf in /etc/wpa_supplicant/
#Input details below
ap_scan=2
ctrl_interface=/var/run/wpa_supplicant
update_config=0
device_name=Direct-p2p-mode
device_type=1-0050F204-1
config_methods=virtual_push_button physical_display keypad
p2p_go_intent=7
country=US
p2p_go_max_inactivity=600
p2p_go_ht40=1
disassoc_low_ack=1
p2p_listen_reg_class=81
p2p_listen_channel=36
driver_param=use_p2p_group_interface=1
| Static IP

Group Owner : ARTIK Board, Group Client : Mobile Phone

Owner mount -o remount,rw /

systemctl stop connman

systemctl stop wpa_supplicant

wlan.sh p2p

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211&

wpa_cli -iwlan0 p2p_group_add

ifconfig p2p-wlan0-0 192.168.1.13

wpa_cli -ip2p-wlan0-0 p2p_get_passphrase

Return <SSID> & <PASSWORD>

Client Enter the WiFi configuration window and find <SSID>

Click the <SSID> button and input <PASSWORD>

In the advanced option, change IPset to fixed instead of DHCP

change address(192.168.1.15) & Default gateway(192.168.1.1)

Owner ifconfig p2p-wlan0-0

Return <ip address of p2p-wlan0-0>

Test Log Example

root:/home> mount -o remount,rw /
root:/home> systemctl stop connman
root:/home> systemctl stop wpa_supplicant
root:/home> wlan.sh p2p
root:/home> wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf - Dnl80211&
Successfully initialized wpa_supplicant
Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in cs
wlan0: CTRL-EVENT-DISCONNECTED - Disconnection to 00:00:00:00:00:00 completed [id=-1 id_str=]
Could not read interface p2p-dev-wlan0 flags: No such device
Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in cs
wlan0: CTRL-EVENT-DISCONNECTED - Disconnection to 00:00:00:00:00:00 completed [id=-1 id_str=]
wpa_cli -iwlan0 p2p_group_add
wlan0: CTRL-EVENT-DISCONNECTED - Disconnection to 00:00:00:00:00:00 completed [id=-1 id_str=]
OK
Using interface p2p-wlan0-0 with hwaddr 72:2c:1f:31:34:b8 and ssid "DIRECT-z9"
p2p-wlan0-0: interface state UNINITIALIZED->ENABLED
p2p-wlan0-0: AP-ENABLED 
p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
wlan0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-z9" freq=2437 go_dev_addr=72:2c:1f:31:b4:b8
P2P-DEVICE-FOUND 0a:ee:8b:20:8d:07 p2p_dev_addr=0a:ee:8b:20:8d:07 pri_dev_type=10-0050F204-5 n1
P2P-PROV-DISC-PBC-REQ 0a:ee:8b:20:8d:07 p2p_dev_addr=0a:ee:8b:20:8d:07 pri_dev_type=10-0050F200

root:/home> ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether 22:42:f7:59:90:bd  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 1328 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 31
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 4  bytes 260 (260.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 260 (260.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p2p-wlan0-0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.13  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::702c:1fff:fe31:34b8  prefixlen 64  scopeid 0x20<link>
        ether 72:2c:1f:31:34:b8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 12  bytes 1076 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        inet6 fe80::722c:1fff:fe31:b4b8  prefixlen 64  scopeid 0x20<link>
        ether 70:2c:1f:31:b4:b8  txqueuelen 1000  (Ethernet)
        RX packets 125  bytes 24246 (23.6 KiB)
        RX errors 0  dropped 623  overruns 0  frame 0
        TX packets 74  bytes 10315 (10.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root:/home> wpa_cli -iwlan0 p2p_group_add
wlan0: CTRL-EVENT-DISCONNECTED - Disconnection to 00:00:00:00:00:00 completed [id=-1 id_str=]
OK
Using interface p2p-wlan0-0 with hwaddr 72:2c:1f:31:34:b8 and ssid "DIRECT-ZH"
p2p-wlan0-0: interface state UNINITIALIZED->ENABLED
p2p-wlan0-0: AP-ENABLED 
p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
wlan0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-ZH" freq=2437 go_dev_addr=72:2c:1f:31:b4:b8

root:/home> wpa_cli -ip2p-wlan0-0 p2p_get_passphrase
bLFrubUl
p2p-wlan0-0: AP-STA-CONNECTED 08:ee:8b:20:8d:07
AP-STA-CONNECTED 08:ee:8b:20:8d:07 
| DHCP IP
Owner mount -o remount,rw /

systemctl stop connman

systemctl stop wpa_supplicant

wlan.sh p2p

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211&

wpa_cli -iwlan0 p2p_group_add

ifconfig p2p-wlan0-0 192.168.1.1 up

dnsmasq -x /var/run/dnsmasq.pid-p2p-wlan0-0 -i p2p-wlan0-0 -F192.168.1.11,192.168.1.99

wpa_cli -ip2p-wlan0-0 p2p_get_passphrase

Return <SSID> & <PASSWORD>

Client Enter the WiFi configuration window and find <SSID>

Click the <SSID> button and input <PASSWORD>

In the advanced option, change IPset to fixed instead of DHCP

change address(192.168.1.15) & Default gateway(192.168.1.1)

Owner ifconfig p2p-wlan0-0

Return <ip address of p2p-wlan0-0>

Test Log Example

root:/home> mount -o remount,rw /
root:/home> systemctl stop connman
Warning: Stopping connman.service, but it can still be activated by:connman.socket
[  614.456000] dhd_wlan_set_carddetect: notify_func=ffffffc0005ccf94, mmc_host_dev0
root:/home> ifconfig   
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether de:1f:8c:f3:57:f1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 1328 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 31  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 4  bytes 260 (260.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 260 (260.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root:/home> wlan.sh p2p
This is BCM43455
systemctl status wpa_supplicant
systemctl start wpa_supplicant
systemctl status wpa_supplicant

root:/home> wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211&
[1] 4215
Successfully initialized wpa_supplicant
Could not read interface p2p-dev-wlan0 flags: No such device
Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in cs
wlan0: CTRL-EVENT-DISCONNECTED - Disconnection to 00:00:00:00:00:00 completed [id=-1 id_str=]

root:/home> wpa_cli -iwlan0 p2p_group_add
Using interface p2p-wlan0-0 with hwaddr 72:2c:1f:31:34:b8 and ssid "DIRECT-LK"
p2p-wlan0-0: interface state UNINITIALIZED->ENABLED
p2p-wlan0-0: AP-ENABLED 
p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
wlan0: CTRL-EVENT-CONNECTED - Connection to 72:2c:1f:31:34:b8 completed [id=0 id_str=]
P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-LK" freq=2462 go_dev_addr=72:2c:1f:31:b4:b8

root:/home> wpa_cli -ip2p-wlan0-0 p2p_get_passphrase
DrxxJ4dK
p2p-wlan0-0: AP-STA-CONNECTED 08:ee:8b:20:8d:07
AP-STA-CONNECTED 08:ee:8b:20:8d:07

root:/home> ifconfig p2p-wlan0-0               
p2p-wlan0-0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.1  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::702c:1fff:fe31:34b8  prefixlen 64  scopeid 0x20<link>
        ether 72:2c:1f:31:34:b8  txqueuelen 1000  (Ethernet)
        RX packets 290  bytes 30072 (29.3 KiB)
        RX errors 0  dropped 51  overruns 0  frame 0
        TX packets 142  bytes 13527 (13.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root:/home> dnsmasq -x /var/run/dnsmasq.pid-p2p-wlan0-0 -i p2p-wlan0-0 -F192..1.11,192.168.1.99
p2p-wlan0-0: AP-STA-CONNECTED 08:ee:8b:20:8d:07
AP-STA-CONNECTED 08:ee:8b:20:8d:07

SoftAP Mode

When you want to independently run the SoftAP, creating a NAT is necessary. To create a NAT follow the steps below.

  1. First configure ‘hostapd.conf’ in ‘/etc/hostapd/’
| Non secured network
root:/home> cat /etc/hostapd/ hostapd.conf
# Customize these for your local configuration...
	interface=wlan0
	driver=nl80211
	ssid=ARTIK_AP
	hw_mode=g
	channel=6
        bridge=br0
| Secured network(WPA2-PSK/AES)
root:/home> cat /etc/hostapd/ hostapd.conf
# DO NOT FORGET TO SET A WPA PASSPHRASE!!
            wpa_passphrase=1234567890
# Most modern wireless drivers in the kernel need driver=nl80211
            driver=nl80211
# Customize these for your local configuration…
            interface=wlan0
            ssid=artik_ap
            hw_mode=g
            channel=6
            bridge=br0
# Uncomment these for base WPA & WPA2 support with a pre-shared key
            wpa=2
            wpa_key_mgmt=WPA-PSK
            wpa_pairwise=TKIP
            rsn_pairwise=CCMP
  • Next configure ‘dnsmasq’ in /etc/ This will set DHCP, DNS, etc.

bind-interfaces

  • Specify range of IP addresses for DHCP leases

dhcp-range=192.168.1.2,192.168.1.100

root:/home> cat /etc/dnsmasq.conf
#user=nobody
#interface=kvm0
# "dnsmasq" in /etc/ This will set DHCP, DNS, etc.
bind-interfaces
# Even with that, needs to be explicitly stopped from binding to localhost
except-interface=lo
#domain=lan.tjworld.net
# Specify range of IP addresses for DHCP leases
dhcp-range=192.168.1.2,192.168.1.100
# = dont provide DHCP or TFTP on this interface : (BUT provide DNS service)
#no-dhcp-interface=eth8
  • First stop the connection manager(connman daemon) to use wifi resources exclusively from stealing connections
$ mount -o remount,rw /
$ systemctl stop connman   // <-- have to run this when wlan0 is running on. this is same as wlan.sh stop
$ dhclient eth0
$ ifconfig
  • And configure the Wi-Fi module operation mode.
$ wlan.sh softap
$ ifconfig
<pre>

* Now set up  wlan0 using the gateway IP-address.
$ ifconfig wlan0 192.168.1.1 up

<pre>
root:/home> ifconfig wlan0 down
root:/home> netstat -anlp | grep -w LISTEN
root:/home> ifconfig wlan0 192.168.1.1 up
  • Start ‘dnsamsq’.
root:/home> dnsmasq -C /etc/dnsmasq.conf
root:/home> netstat -anlp | grep -w LISTEN
root:/home> ifconfig

Configure ‘iptables’ to make the softAP operate in IP Masquerade.

  • set up the ip-forwarding using MASQUERADE
root:/home> sysctl net.ipv4.ip_forward=1
root:/home> iptables --flush   
root:/home> iptables -t nat --flush
root:/home> iptables --delete-chain
root:/home> iptables -t nat --delete-chain
root:/home> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
root:/home> iptables -A FORWARD -i wlan0 -j ACCEPT
  1. Start ‘hostapd’
root:/home> hostapd /etc/hostapd/hostapd.conf -B
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 70:2c:1f:31:b4:b8 and ssid "ARTIK_AP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
  • Connect to SoftAP on Artik from phone : ok
root:/home> mount -o remount,rw /
root:/home> systemctl stop connman
Warning: Stopping connman.service, but it can still be activated by:
  connman.socket
root:/home> ifconfig wlan0 down
root:/home> wlan.sh softap                                                      
Hardware Model= Revision Number=
This is BCM43455
root:/home> ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether fe:1e:49:bc:86:21  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 1108 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 31  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 4  bytes 260 (260.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 260 (260.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 70:2c:1f:31:b4:b8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
root:/home> netstat -anlp | grep -w LISTEN
tcp        0      0 192.168.1.1:53          0.0.0.0:*               LISTEN      6698/dnsmasq        
tcp        0      0 0.0.0.0:26101           0.0.0.0:*               LISTEN      2115/sdbd           
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      1/systemd   
root:/home> ifconfig wlan0 down
root:/home> ifconfig wlan0 192.168.1.1 up
root:/home> dnsmasq -C /etc/dnsmasq.conf
root:/home> ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
........
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
........
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.1 netmask 255.255.255.0  broadcast 192.168.1.255
        ether 70:2c:1f:31:b4:b8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 108 (108.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
root:/home> sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
root:/home> iptables --flush
root:/home> iptables -t nat --flush
root:/home> iptables --delete-chain
root:/home> iptables -t nat --delete-chain
root:/home> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
root:/home> iptables -A FORWARD -i wlan0 -j ACCEPT
root:/home> hostapd /etc/hostapd/hostapd.conf -B
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 70:2c:1f:31:b4:b8 and ssid "ARTIK_AP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

Bluetooth

Overview

Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices, and building personal area networks (PANs). It was originally conceived as a wireless alternative to RS-232 data cables. Bluetooth has a variety of profiles that are created for specific use cases.

This guide describe how to be tested Bluetooth function(such as bluez /obexd ) for implemented HAL for Tizen 4.0 on ARTIK development board.

| Bluetooth Stack

BlueZ
an open source project, is the official Linux Bluetooth protocol stack. the main component is the bluetoothd daemon, which exposes DBUS APIs to the application layer for development. (DBUS APIs are interfaces exposed to develop application.)
OBEX
OBEX(abbreviation of OBject EXchange, also termed IrOBEX) is a communications protocol that facilitates the exchange of binary objects between devices. It is maintained by the Infrared Data Association but has also been adopted by the Bluetooth Special Interest Group and the SyncML wing of the Open Mobile Alliance (OMA). Although OBEX was initially designed for infrared, it has now been adopted by Bluetooth. It is for mainly exchanging business cards, address book, data, even applications.
GATT
The Generic Attributes (GATT) define a hierarchical data structure that is exposed to connected Bluetooth LE devices. GATT profile describes a use case, roles and general behaviors based on the GATT functionality. Services are collections of characteristics and relationships to other services that encapsulate the behavior of part of a device.

| Bluetooth Profiles

To use Bluetooth wireless technology, a device must be able to interpret Bluetooth profiles, which define possible applications and specify general behaviors that Bluetooth enabled devices use to communicate with each other. Each Bluetooth profile contains the following information:

  • Dependencies on other profiles
  • Suggested user interface formats
  • Specific parts of the Bluetooth protocol stack used by the profile.
  • all BlueZ profiles is as following;
profiles Acronym Descriptions
OBEX-based (by obexd) FTP File transfer protocol (FTP) profile
MAP Message access profile
OPP Object push profile
PBAP Phone book access profile
BlueZ A2DP Advanced audio distribution profile (A2DP)
AVRCP Audio/video remote control profile
DI Device identification (DI) profile
HDP Health device profile
HID Human interface device (HID) profile
PAN Personal area networking (PAN) profile
SPP Serial port profile (SPP)
GATT (LE) profiles CSCP Cycling speed and cadence profile
HOGP HID over GATT profile (HOGP)
HRPI Heart rate profile (HRP)
HTP Health thermometer profile
PXP Proximity profile (PXP)
TIP Time profile (TIP)

| Interface

The application layer can use the Bluetooth service provided by the BlueZ stack using the DBUS API interface registered by each profile/component. The main components of this package include the following:

adapter
Lets you start or stop discovery; remove a paired device; or set/get info about name, alias, pairable timeout, etc.
agent
Lets you register or unregister agent; set the default one or all methods related to pairing or authorization, etc.
device
Lets you connect or disconnect; pair a device; connect or disconnect a profile on a device, etc.; set or get info about trusted or blocked class of peer device.
Profile
Lets you register a profile implementation.

Environment

Install Bluetooth Firmware and Driver

you have to Install the following plug-ins for wifi firmware. you can get this plug-ins from ARTIK representative only, please contact them.

artik710_plugin.tar.gz blueblooth firmware for artik710
artik530_plugin.tar.gz blueblooth firmware for artik530

Bluetooth Tool & Utility Descriptions

| Bluetooth Daemon
Name Descriptions
Bluetoothd Bluetooth Service Daemon Program manages all the Bluetooth devices. most option configuration is done in the /etc/bluetooth/main.conf file. bluetoothd can also provide a number of services/profiles via the D-Bus message bus system. /etc/bluetooth/main.conf(Default location of the global configuration file.)
Obexd The Obexd is a daemon program which contains D-Bus services providing OBEX client and server functionality. OBEX is a communications protocol that facilitates the exchange of binary objects between devices such as Object Push protocol, File Transfer protocol.
| Bluetooth Tools
Bluetooth controllers are handled in TIZEN OS via interfaces accessible by the rfkill and hcitools (hciconfig, hciattach, hcitool, hcidump, etc.). These utilities, which are provided in the BlueZ package, include the following:
Name Descriptions
rfkill Turns the chip on/off
hcitools A series of utilities that manage controllers
| Bluetooth Utility
Name Descriptions
Blueman-manager Bluetooth GUI Manager

provide simple, yet effective means for controlling BlueZ API and simplifying bluetooth tasks such as: - Connecting to 3G/EDGE/GPRS via dial-up - Connecting to/Creating bluetooth networks - Connecting to input devices - Connecting to audio devices - Sending/Receiving/Browsing files via OBEX - Pairing Blueman also integrates with Network Manager 0.7, so any Dialup/Network connections will be made available (via HAL) to Network Manager

bluetoothctl interacts with the bluetoothd daemon via DBUS interfaces. This command line utility can be used to perform basic Bluetooth operation, such as:

- Register an agent - Start or stop discovery(Scan) - Configure pairable or discoverable property of the adapter - Pair and connect a device

obexctl The obexctl BlueZ OBEX client allows for executing various commands like copying files/to from devices, other file handling, and basic support for exchanging objects/files over Bluetooth
Sdptool This command line utility can be used to perform basic Bluetooth operation, such as: search Device Service
| Ref Tools
Name Descriptions
ps The ps (Process Status) command is used to provide information about the currently running processes, including their process identification numbers (PIDs).
systemctl
kill & killall Kill a process by specifying its PID. killall processes by name

Bluetooth Initial

Before you perform Bluetooth operations, connect Artik board to desktop via minicom and call rfkill to unblock the bluetooth controoller(broadcom BCM43455C0 chip). The Bluetooth_rfkill_event service, which should be running in background, will intercept the rfkill event, trigger a firmware download, configure the bluetooth controoller, and register the HCI device (hci0). Note: Whenever you are enabling or testing Bluetooth functionality, make sure Bluetooth_rfkill_event is running in the background. This utility downloads patches and registers HCI is brcm_patchram_plus. It operates like hciattach but has more Broadcom-specific options.

  1. Before you perform Bluetooth operations, connect Artik board to desktop via minicom
  2. Boot up Artik board patched with BlueZ5.43a
  3. Initialize Bluetooth controller and launch bluez/obex daemon of ARTIK board as following;

bt-stack-up.sh shell file performs a function of B/D detect, Set BT address, Trun-on Bluetooth Chip, F/W download, hciconfig up, launch Bluetooth service daemon & obex service daemon

$ bt-stack-up.sh
bt-stack-up.sh
$ /usr/etc/bluetooth/bt-dev-start.sh

export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5001/dbus/user_bus_socket export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket $ /usr/libexec/bluetooth/bluetoothd -C -n & $ /usr/bin/bluetooth-share & $ /usr/libexec/bluetooth/obexd &

Now ready for checking the bluetooth functionality.

Bluetooth Basic Operation

bluetoothctl

First you have to enable bluetooth as described, it is needed a simple command:

root:/home> ./bluetoothctl             [/usr/bin/bluetoothctl]  
[NEW] Controller 70:2C:1F:31:B4:B9 ARTIK7 [default]
[bluetooth]#
Show command
[bluetooth]# show
Controller 70:2C:1F:31:B4:B9
        Name: BlueZ 5.43
        Alias: ARTIK7
        Class: 0x18020c
        Powered: yes
        Discoverable: yes
        Pairable: yes
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: OBEX File Transfer        (00001106-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: OBEX Object Push          (00001105-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: IrMC Sync                 (00001104-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (00005005-0000-1000-8000-0002ee000001)
        UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb)
        UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)
        UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)
        Discovering: no
info command
[bluetooth]# info
you may additionally check supported service on peer device
info 10:68:3F:57:90:4F
[bluetooth]#
power <on/off> command
[bluetooth]# power on        //if Powered: no
Changing power on succeeded
pairable <on/off> command
[bluetooth]# pairable on     //if Pairable: no
Changing pairable on succeeded
discoverable <on/off> command
[bluetooth]# discoverable on //if Discoverable: no
Changing discoverable on succeeded
agent <option> command

Register an agent and set it as default. (An agent lets you handle actions such as pairing, when user interaction is needed.) Options include KeyboardDisplay, DisplayOnly, DisplayYesNo, KeyboardOnly, and NoInputNoOutput. These settings emulate different capabilities of the application developed by the end-user for Bluetooth using an ARTIK Board. Register an agent and set it to default:

[bluetooth]# agent on
[bluetooth]# agent KeyboardDisplay
[bluetooth]# default-agent
scan <on/off> command

Scan command with "on" oprion perform to start discovery. You can stop the scan by "scan off" command as soon as it is listed the device you are looking for. eventually you can stop it or not after getting desired device listed.

[bluetooth]# scan on
Discovery started
[CHG] Controller 70:2C:1F:31:B4:B9 Discovering: yes
[NEW] Device 3C:5A:37:C5:9A:3B 3C:5A:37:C5:9A:3B
[NEW] Device 8C:3A:E3:FB:34:4B Dev-Nexus 5
[NEW] Device 08:EE:8B:20:8D:06 Galaxy A5 n
[CHG] Device 3C:5A:37:C5:9A:3B RSSI: -46
[CHG] Device 3C:5A:37:C5:9A:3B Name: SHW-M180S
[CHG] Device 3C:5A:37:C5:9A:3B Alias: SHW-M180S
[NEW] Device 00:19:0E:05:90:C6 johnny-System-Product-Name
[CHG] Controller 70:2C:1F:31:B4:B9 Discovering: no
[bluetooth]# scan off
[CHG] Device 00:19:0E:05:90:C6 TxPower is nil
[CHG] Device 00:19:0E:05:90:C6 RSSI is nil
[CHG] Device 08:EE:8B:20:8D:06 RSSI is nil
[CHG] Device 8C:3A:E3:FB:34:4B RSSI is nil
[CHG] Device 3C:5A:37:C5:9A:3B RSSI is nil
Discovery stopped
pair <Device ID> command

To pair to a Bluetooth* device you need the device ID to run the following command. Start pairing the desired device a confirmation will be needed on peer device, be sure to have set agent on

[bluetooth]# pair
connect <Device ID> command

Once the device pairs successfully, connect to the device by running this command: 6. Trigger the connection step:

[bluetooth]# connect
and trigger connection
[bluetooth]# connect CC:FA:00:15:B3:F1
[bluetooth]# devices
[bluetooth]# list

to check additional capabilities of BlueZ command line check its [bluetooth]# help [bluetooth]# quit or exit once done you can exit from the utility

sdptool

/usr/lib/bluetooth/bluetoothd --compat
sdptool browse local

and then restarting bluetooth like this

Scan and Connect with Devices

To connect your Artik device to a Bluetooth network, do the following:

Enable Bluetooth:

root@Artik:~# rfkill unblock bluetooth

Enter the BlueZ command line utility bluetoothctl, which will find the Bluetooth controller:

root@Artik:~# bluetoothctl
[NEW] Controller 98:4F:EE:01:FD:D6 BlueZ 5.24 [default]
[bluetooth]# agent KeyboardDisplay
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller 98:4F:EE:01:FD:D6 Discovering: yes
[NEW] Device F3:18:29:E8:DA:61 Flex
[NEW] Device 40:2C:F4:DB:EF:AA NAGESWAX-MOBL1
[NEW] Device 40:2C:F4:86:72:54 TNGU25X-MOBL2
[bluetooth]# scan off

Pair the device. (You will need to confirm the pairing from the peer device, so be sure to have an agent set as described in step 3 above.)

[bluetooth]# pair 40:2C:F4:DB:EF:AA
Attempting to pair with 40:2C:F4:DB:EF:AA
[CHG] Device 40:2C:F4:DB:EF:AA Connected: yes
Request confirmation
[agent] Confirm passkey 788684 (yes/no): yes
[CHG] Device 40:2C:F4:DB:EF:AA UUIDs:
00000002-0000-1000-8000-0002ee000002
00001000-0000-1000-8000-00805f9b34fb
00001104-0000-1000-8000-00805f9b34fb
[CHG] Device 40:2C:F4:DB:EF:AA Paired: yes
Pairing successful
[CHG] Device 40:2C:F4:DB:EF:AA Connected: no
[CHG] Device 40:2C:F4:DB:EF:AA Connected: yes
[CHG] Device 40:2C:F4:DB:EF:AA Connected: no
[bluetooth]

Trigger the connection step:

[bluetooth]# connect 10:68:3F:57:90:4F 

Attempting to connect to 10:68:3F:57:90:4F

[CHG] Device 10:68:3F:57:90:4F Connected: yes
Connection successful

The Bluetooth connection is established at the profile level, so the involved devices have to support profiles (and roles, if applicable) that let them connect. For HID, there is no need to register the profile at the application layer. (The HID host is implemented at the kernel level.) So a basic discovery + pair + connect to an HID peripheral device will lead to a connection. You can check supported services on a peer device using the info command:

[bluetooth]# info 40:2C:F4:DB:EF:AA
Device 40:2C:F4:DB:EF:AA
Name: NAGESWAX-MOBL1
Alias: NAGESWAX-MOBL1
Class: 0x3e010c
Icon: computer
Paired: yes
Trusted: no

Blocked: no
Connected: no
LegacyPairing: no
UUID: Vendor specific
UUID: Service Discovery Serve..
UUID: IrMC Sync
UUID: OBEX Object Push
UUID: OBEX File Transfer
UUID: IrMC Sync Command
UUID: Headset
UUID: Audio Source
UUID: Audio Sink
UUID: A/V Remote Control Target
UUID: A/V Remote Control
UUID: Headset AG
UUID: PANU
UUID: Imaging Responder
UUID: Handsfree Audio Gateway
UUID: Phonebook Access Server
UUID: Video Sink

(00000002-0000-1000-8000-0002ee000002)
(00001000-0000-1000-8000-00805f9b34fb)
(00001104-0000-1000-8000-00805f9b34fb)
(00001105-0000-1000-8000-00805f9b34fb)
(00001106-0000-1000-8000-00805f9b34fb)
(00001107-0000-1000-8000-00805f9b34fb)
(00001108-0000-1000-8000-00805f9b34fb)
(0000110a-0000-1000-8000-00805f9b34fb)
(0000110b-0000-1000-8000-00805f9b34fb)
(0000110c-0000-1000-8000-00805f9b34fb)
(0000110e-0000-1000-8000-00805f9b34fb)
(00001112-0000-1000-8000-00805f9b34fb)
(00001115-0000-1000-8000-00805f9b34fb)
(0000111b-0000-1000-8000-00805f9b34fb)
(0000111f-0000-1000-8000-00805f9b34fb)
(0000112f-0000-1000-8000-00805f9b34fb)
(00001304-0000-1000-8000-00805f9b34fb)

When you are done, exit the utility:

[bluetooth]# exit
Agent unregistered
[DEL] Controller 98:4F:EE;01;FD;D6 BlueZ 5.24 [default]
root@Artik:~#

Connecting from a peer device

To connect your Artik Board from a peer device, do the following:

  • Follow steps 1 through 3 above.
  • Set up the Artik Board as “discoverable” in step 4:
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 98:4F:EE:01:FD:D6 Discoverable: yes
[bluetooth]#
  • Start the discovery from the peer device and pair the Artik Board.

Changing a Bluetooth MAC address

Each Artik Board has its own unique Bluetooth MAC address, which is in /factory/bluetooth_address. The steps below describe the process to change the Bluetooth MAC address, by mounting /factory, editing the /factory/bluetooth_address file, and rebooting the device.

root@Artik:~# mount –v | grep factory
/dev/mmcblk0p5 on /factory type ext4 (ro,nosuid,nodev,noatime,discard, noauto_da_alloc)
root@Artik:~# mount –o remount,rw /dev/mmcblk0p5 /factory
root@Artik:~# vi /factory/bluetooth_address
root@Artik:~# reboot
Unmounting /home...
[ OK ] Stopped target Sound Card.
[ OK ] Removed slice system-systemd\x2dfsck.slice.
[ OK ] Stopped target Multiuser System.
Stopped the Artik status and configuration service...

Note: We do not advise changing an Artik Board’s Bluetooth MAC address. If you do decide to change it, however, presumably for testing purposes, first make sure to back up the unique MAC address that was generated when the Artik board was first dispatched, and revert the MAC address back to what it originally was (its unique MAC address) as soon as you are finished with your testing.


Bluetooth Major Profile Operation

HID | Human Interface Device Profile

The HID profile can be used when you want to connect a Bluetooth keyboard to ARTIK Board. The following example shows how to connect a Bluetooth keyboard to ARTIK board. With the HID profile, you can connect any human interface device (mouse, keyboard, etc.) directly without needing to register any service on the Artik board. To connect an HID, do the following:

  • Unblock the Bluetooth* device to make sure Bluetooth is enabled, then launch the bluetoothctl utility and register an agent, set the default agent, and scan for HID and other Bluetooth devices.
root@Artik:~# rfkill unblock bluetooth
root@Artik:~# bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# agent DisplayYesNo
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller 98:4F:EE:01:FD:E4 Discovering: yes
[NEW] Device 40:2C:F4:DB:EF:AA 40:2C:F4:DB:EF:AA
[CHG] Device 40:2C:F4:DB:EF:AA Name: NAGESWAX-MOBL1
[CHG] Device 40:2C:F4:DB:EF:AA Alias: NAGESWAX-MOBL1
[NEW] Device 00:1B:DC:06:59:9C RJGUARIN-MOBL1
[CHG] Device 00:1F:20:42:27:12 LegacyPairing: no
[CHG] Device 00:1F:20:42:27:12 Name: Bluetooth Laser Travel Mouse
[CHG] Device 00:1F:20:42:27:12 Alias: Bluetooth Laser Travel Mouse
[CHG] Device 00:1F:20:42:27:12 LegacyPairing: yes
[NEW] Device B8:76:3F:AB:7E:D1 B8:76:3F:AB:7E:D1
[bluetooth]# pair 00:1F:20:42:27:12
Attempting to pair with 00:1F:20:42:27:12
[CHG] Device 00:1F:20:42:27:12 Connected: yes
[CHG] Device 00:1F:20:42:27:12 Modalias: usb:v046DpB008d0318
[CHG] Device 00:1F:20:42:27:12 UUIDs:
00001124-0000-1000-8000-00805f9b34fb
00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1F:20:42:27:12 Paired: yes
Pairing successful
[bluetooth]# scan off
[CHG] Device B8:76:3F:AB:7E:D1 RSSI is nil
[CHG] Device 40:2C:F4:86:72:54 RSSI is nil
Discovery stopped
  • Use the connect command to connect the mouse as an input device to the Artik board:
[bluetooth]# connect 00:1F:20:42:27:12
Attempting to connect to 00:1F:20:42:27:12
[CHG] Device 00:1F:20:42:27:12 Connected: yes
[bluetooth]# [ 3144.632878] hid-generic 0005:046D:B008.0001: unknown...
Connection successful
[bluetooth]# info 00:1F:20:42:27:12
Device 00:1F:20:42:27:12
Name: Bluetooth Laser Travel Mouse
Alias: Bluetooth Laser Travel Mouse
Class: 0x002580
Icon: input-mouse
Paired: yes
Trusted: no
Blocked: no
Connected: yes
LegacyPairing: yes
UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
UUID: PnP Information
Modalias: usb:v046DpB008d0318 (00001200-0000-1000-8000-00805f9b34fb)
  • Check the kernel logs to verify that the device is correctly connected. The example below is for a Bluetooth mouse:
[15337.082135] hid-generic 0005:0A5C:2004.0001: unknown main item tag 0x0
[15337.083809] input: MoGo Mouse BT as /devices/pci0000:00/0000:00:04.1/tty/ttyMFD0/hci0/hci0:12/input1
[15337.086105] hid-generic 0005:0A5C:2004.0001: input,hidraw0:BLUETOOTH HID v3.00 Mouse [MoGo Mouse BT] on 43:34:1b:00:1f:ac

A2DP | Advanced Audio Distribution Profile

connect SPK and play sound

pulseaudio --system &
root:/home> pulseaudio --system &
[2] 8986
pulseaudio --start

root:/home> paplay test.wav --volume=1000 -v
root:/home> paplay test.wav –volume=65500

When you need to stream audio over a Bluetooth connection you can use the A2DP profile. The following steps are needed to setup this profile on your ARTIK Development Board:

  • Turn on your speaker set and put on phone jack.
  • Pair your ARTIK 710 Development Board with your Samsung phone using the ‘bluetoothctl’ script. Make certain that your ARTIK 710 Development Board is in discoverable mode for BT.
$ bluetoothctl
[bluetooth]# pair “mac address of BT speaker”
[bluetooth]# exit
  • On your ARTIK Development Board run pulse audio control
$ pactl list cards
  • If the Bluetooth speaker is not set then:
$ pactl set_card_profile 1 a2dp sink
  • On the ARTIK 710 Development Board use ‘mplayer’ to set the output to ‘pulse’ and play a ‘.wav’ file available from ‘/usr/share/sounds/alsa/’. In addition you can always download your own mp3 files.
$ mplayer –ao pulse ‘filename’
  • Now you can hear the audio via the BT speaker.

Obex | ObjectEXchange Transfer

To transmit files between your ARTIK 710 Development Board and your phone you can use the OBEX FTP/OPP Bluetooth profile as follows:

FTP : File Transfer Profile, OPP : Object Push Profile Set Common Environment for Obex

Mobile Phone

  • Download ‘Bluetooth File Transfer’ app. on your phone and install. And make certain the following settings of your phone are selected: Bluetooth On, Discoverable, FTP.
  • Run ‘Bluetooth File Transfer’ app. and move to Bluetooth device list menu, choose ARTIK 710 Development Board. Then pop up list of data transfer mode as bellow picture.
ARTIK Board

  • Connect Artik board to desktop via minicom.
  • Boot up Artik board patched with BlueZ5.43a
  • Initialize Bluetooth controller and launch bluez/obex daemon of ARTIK board as following;
  • Set configure of bluetooth local device of ARTIK 710 board as following;
$ hciconfig set piscan
$ set class 0x3e0104
$ hciconfig -a
$ ./bluetoothctl
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# discoverable on
  • Now ready for Obex function test.
Note - option ‘a’
For Testing obex transfer, need to add option ‘-a’ as following;

$ /usr/libexec/bluetooth/obexd -a &

  • Option ‘-a’ means –auto-accept, Automatically accept push requests For FTP. This option is only for testing ftp/opp function of obex stack profile transfer. With headed, this option is removed. Instead of that, Api will response to daemon thru dbus.

OPP | Object Push Profile

Artik board as OPP server

To send to ARTIK board from mobile phone you can use the OBEX OPP Bluetooth profile as follows:

  • Set Common Environment for Obex as previous.
  • Pair your phone with ARTIK 710 Development Board by selecting transfer mode on mobile phone. Make certain that mobile phone is in discoverable mode for Bluetooth. Then, it will be appeared confirm message on ARTIK board, key in ‘yes’.
[bluetooth]# Authorize service 00001106-0000-1000-8000-00805f9b34fb
(yes/no): yes
  • After connected, you can export single/multiple files to ARTIK Board using copy/paste or Upload command from mobile phone.
  • Using Export Function of phone
  • Set Common Environment for Obex as previous.
  • Pair your phone with ARTIK board by setting bluetooth on mobile phone. Make certain that your phone is in discoverable mode for Bluetooth.
  • After selecting single/multiple files, execute export/bluetooth/select device and select Artik board. Then, it will be appeared confirm message on ARTIK board, key in ‘yes’.
[bluetooth]# Authorize service 00001106-0000-1000-8000-00805f9b34fb
(yes/no): yes
  • After connected, Automatically transfer files to ARTIK Board from mobile phone.

FTP | File Tranfer Profile

FTP (File Transfer Protocol) allows two or more devices in a network to share folders/files. The devices can be Windows PCs, laptops, mobile devices, Artik boards, Mac or Linux computers, or devices like Android phones. Once an FTP client identifies and connects with a valid FTP server, it can “put” files/folders into the location or “get” files/folders from it. Any FTP device can act as client or server.

FTP client initiates put/get of objects (files/folders) to and from the server.
FTP server provides an object exchange server and folder browsing (using the OBEX Folder Listing format).

Artik board as FTP server

To transfer from/to ARTIK 710 Development Board on Mobile phone you can use the OBEX FTP Bluetooth profile as follows:

  • Set Common Environment for Obex as previous.
  • Pair mobile phone with ARTIK board by selecting transfer mode on mobile phone. Make certain that mobile phone is in discoverable mode for Bluetooth. Then, it will be appeared confirm message on ARTIK board, key in ‘yes’.
[bluetooth]# Authorize service 00001106-0000-1000-8000-00805f9b34fb
(yes/no):  yes
  • After connected, you can transfer single/multiple files between ARTIK board and mobile phone using Download or Upload command from your phone. Now you can download or upload from/to ARTIK board to/from mobile phone
  • After step 4, you should check both files the respective destination folders
Artik board as FTP client

To transmit files between your ARTIK board and mobile phone you can use the OBEX FTP Bluetooth profile as follows:

  • Set Common Environment for Obex as previous.
  • Download the Astro Bluetooth app on mobile phone
  • Pair mobile phone with ARTIK board by selecting transfer mode on mobile phone. Make certain that mobile phone is in discoverable mode for Bluetooth. Then, it will be appeared confirm message on ARTIK board, key in ‘yes’.
[bluetooth]# Authorize service 00001106-0000-1000-8000-00805f9b34fb
(yes/no):  yes

3. List folder on phone $ obexftp –b “phone’s mac address” –l 4. Send file from Samsung phone to ARTIK 710 Development Board. $ obexftp –b “phone’s mac address” –g “path & filename” 5. Send file from ARTIK 710 Development Board to Samsung phone. $ obexftp –b “phone’s mac address” –p “path & filename”

After step 4 and step 5 you should see both files the respective destination folders.

Note - FTP/OPP server folder
FTP/OPP server folder(share folder)

FTP path : ~/.cache/obexd

when change share folder : obexd --root=Public -a

PAN | Personal area networking profile

The personal area networking (PAN) profile describes how two or more Bluetooth-enabled devices can form a network and access other networks through a network access point (NAP). The PAN profile defines how to use the Bluetooth Network Encapsulation Protocol (BNEP) to provide networking capabilities for Bluetooth devices. PAN profile roles include the following:

  • NAP: Network access point.
  • GN: Group ad-hoc network.
  • PANU: Personal area network user.

NAP and GN offer services for different networking requirements. NAP provides network services to each Bluetooth device connected, while GN allows two or more devices to become part of an ad-hoc network (Figure 24). For Artik board software, we have validated the PAN profile in NAP and GN. However, to perform a PAN test, you will need to download test scripts that are part of the BlueZ package, but which are not included in the Artik board image. (You can also find these at http://git.kernel.org/cgit/bluetooth/bluez.git/tree/test in the test folder.) - Select the role with the -s option. - Compress and copy the BlueZ test package into the Artik board via scp. - Unzip and copy BlueZ test package into the Artik board. - Enable Bluetooth* as described in chapter 4 Scanning and Connecting Device. After you have performed the above steps, you can perform the PAN test between a Linux* host PC and an Artik board, or between Artik boards.

PAN test between Linux* host PC and Artik board To perform the PAN test between a Linux* host PC and an Artik board, do the following: Start connman and enable Bluetooth* on both the Artik board and on the Linux* PC. On the Artik board:

root@Artik:~# systemctl start connman
root@Artik:~# connmanctl enable Bluetooth
root@Artik:~# hciconfig
hci0: 
Type: BR/EDR Bus: UART
BD Address: 00:11:22:33:55:77 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:41408 acl:308 sco:0 events:300 errors:0
TX bytes:31530 acl:270 sco:0 commands:65 errors:0
root@Artik:~#

On the Linux* PC, the “RSSI” line provides the Bluetooth* address of the PC

root@Artik:~# bluetoothctl
[NEW] Controller 00:11:22:33:55:77 BlueZ 5.24 [default]
[NEW] Device 48:51:B7:15:D1:63 ubuntu-0
[bluetooth]# agent DisplayYesNo
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 00:11:22:33:55:77 Discoverable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:11:22:33:55:77 Discovering: yes
[NEW] Device E8:BE:82:BE:75:19 E8-BE-82-BE-75-19
[NEW] Device D5:B3:ED:7E:A5:83 D5-B3-ED-7E-A5-83
[CHG] Device D5:B3:ED:7E:A5:83 Name: Halitoshi
[CHG] Device D5:B3:ED:7E:A5:83 Alias: Halitoshi
[NEW] Device C8:F7:33:2C:A8:93 JSWALKEN-MOBL1
[NEW] Device 3C:15:C2:DC:E9:41 adaniele-mac01
[CHG] Device 48:51:B7:15:D1:63 RSSI: -35
[CHG] Device 48:51:B7:15:D1:63 UUIDs:
0000112d-0000-1000-8000-00805f9b34fb
00001112-0000-1000-8000-00805f9b34fb
00001234-0000-1000-8000-00805f9b34fb
00001700-0000-1000-8000-00805f9b34fb
00001701-0000-1000-8000-00805f9b34fb
00001708-0000-1000-8000-00805f9b34fb
[CHG] Device 48:51:B7:15:D1:63 Paired: yes
Pairing successful
[CHG] Device 40:2C:F4:DB:EF:AA Connected: no
[CHG] Device 40:2C:F4:DB:EF:AA Connected: yes
[CHG] Device 40:2C:F4:DB:EF:AA Connected: no
[bluetooth]

Pair the devices. On the Artik board:

[bluetooth]# pair 00:11:22:33:55:77
Attempting to pair with 00:11:22:33:55:77
[CHG] Device 00:11:22:33:55:77 Connected: yes
[CHG] Device 00:11:22:33:55:77 UUIDs:
0000110c-0000-1000-8000-00805f9b34fb
0000110e-0000-1000-8000-00805f9b34fb
00001200-0000-1000-8000-00805f9b34fb
00001800-0000-1000-8000-00805f9b34fb
00001801-0000-1000-8000-00805f9b34fb
0000a004-0000-1000-8000-00805f9b34fb
feee74dc-a8de-3196-1149-d43596c00a4f
[CHG] Device 00:11:22:33:55:77 Paired: yes
Pairing successful
[CHG] Device 00:11:22:33:55:77 Connected: no
[CHG] Device E4:F5:9F:82:56:94 RSSI: -89
[bluetooth]# scan off
[CHG] Device E4:F5:9F:82:56:94 RSSI is nil
[CHG] Device 7C:7A:91:F2:6E:84 RSSI is nil
[CHG] Controller 00:11:22:33:55:66 Discovering: no
Discovery stopped
[bluetooth]#

On the Linux* PC: You will see that pairing is successful between the Artik board and the Linux PC when the right pane of the Bluetooth window indicates that Paired equals "Yes" as below picture.

PCimg-for-artik.png
                                    PC Image

Sensor

Sensor devices are used in most mobile devices to enhance user experience. Tizen 4.0 supports a framework which manages hardware and virtual sensors on the platform and provides convenient API to the application. Refer to the architecture of sensor framework and porting guide for adding new hardware sensors in detail on this

Overview

The following list of sensors is supported by default on Tizen 4.0. so you can check the operation for using existed sensor or adding new sensor before.

Sensor Functions Model I2C address
Accelerometer LSM9DS0(BerryGPS-IMU) 0x1E
Magnetometer LSM9DS0(BerryGPS-IMU) 0x1E
Gyroscope LSM9DS0(BerryGPS-IMU) 0x6A
Pressure BMP280 (BerryGPS-IMU) 0x77
Temperature BST-BMP280-DS001-11 0x76
HRM LED IR MAX30100 0x57
HRM LED RED MAX30100 0x57
Proximity vcnl4010 0x13
Light TSL2561 0x29 or 0x39 or 0x49

Environment

Sensor Connection

Sensor module have to be connected by power and i2c signal from target platform board as the following diagram.

SensorForTizen40.jpg
                           Sensor Connection Diagram

Install plugin & test program

Package For
peripheral-bus-0.1.0-9.1.armv7l.rpm command
external-sensor-plugins-artik7-0.0.2-0.armv7l.rpm Artik710
external-sensor-plugins-artik5-0.0.2-0.armv7l.rpm Artik530
external-sensor-plugin-rpi3-0.0.2-0.armv7l.rpm Raspberry PI3

Connection Check

you can check connected sensors in the contents of log message using Dlogutil after boot as the following examples.

root:~> dlogutil SENSOR
I/SENSOR  ( 2156): sensor_manager.cpp: show(390) > ========== Loaded sensor information ==========
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #1[http://samsung.com/sensor/healthinfo/pedometer/sa 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://samsung.com/sensor/healthinfo/pedometer/samsung_pr
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = samsung_pedometer
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #2[http://tizen.org/sensor/general/accelerometer/acc 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/accelerometer/acceleromer
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = LSM9DS0
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #3[http://tizen.org/sensor/general/auto_rotation/tiz 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/auto_rotation/tizen_defat
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #4[http://tizen.org/sensor/general/geomagnetic_rotat 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/geomagnetic_rotation_vect
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #5[http://tizen.org/sensor/general/gravity/tizen_low 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/gravity/tizen_lowpass
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_lowpass
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #6[http://tizen.org/sensor/general/light/light]: 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/light/light
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = TSL2651
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #7[http://tizen.org/sensor/general/linear_accelerati 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/linear_acceleration/tizet
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #8[http://tizen.org/sensor/general/magnetic/magnetom 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/magnetic/magnetometer
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = LSM9DS0
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #9[http://tizen.org/sensor/general/pressure/pressure 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/pressure/pressure
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = BMP280
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #10[http://tizen.org/sensor/general/proximity/proxim 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/proximity/proximity
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = VCNL4010
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #11[http://tizen.org/sensor/general/temperature/temp 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/temperature/temperature
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = BMP280
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #12[http://tizen.org/sensor/healthinfo/heart_rate_mo 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/healthinfo/heart_rate_monitor.ler
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = MAX30100
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #13[http://tizen.org/sensor/healthinfo/heart_rate_mo 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/healthinfo/heart_rate_monitor.led
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = MAX30100
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(397) > ===============================================

Sensor Operations

Run the following command to check the value of connected sensor. in case of ARTIK710,

$ ./external-sensor-plugins-artik7-test ./libexternal-sensor-plugins-artik7.so

or in case of ARTIK530 or Raspberry PI3, run the following command instead of above command.

$ ./external-sensor-plugins-artik5-test ./libexternal-sensor-plugins-artik5.so
$ ./external-sensor-plugins-rpi3-test ./libexternal-sensor-plugins-rpi3.so

Then, scroll the measured values on terminal.

VCNL4010:SENSOR PROXIMITY:+2371.00000
TSL2651:SENSOR LIGHT:+55.00000
LSM9DS0:SENSOR GYROSCOPE:+96.53000 +137.13000 +178.00999
BMP280:SENSOR TEMPERATURE:+33.91000
MAX30100:SENSOR HRM LED RED:+51199.00000
LSM9DS0:SENSOR ACCELEROMETER:+0.09692 +0.00022 -0.01237
LSM9DS0:SENSOR GEOMAGNETIC:-258.92001 -107.33600 -246.03200
..........

TCT for Tizen 4.0

Overview

Tizen Compliance Tests (TCT) verify conformance to the Tizen Compliance Specification (TCS). These tests are intended to be used by Tizen device implementers to enable the Tizen-compliant development environment for Tizen application developers. Tizen Compliance Tests consist of Web TCT and Native TCT, which include test suites and tools for testing on the Tizen web stack and the native stack, respectively.

refer to the this site

Environment

install TCT program

TCT Stack TCT program name
Native NativeTCT_4.0_20171120_arm.tar.gz
Web csharp-tct_4.0_20171204.tar.gz

Just make a folder and decompress TCT program.

Initialize

Before running the TCT test, the initial environment for testing each function must be set first on Artik/RaspBerry board. And execute sdb enable command as the following because it is used for TCT test remotely, with write permission.

mount -o remount,rw /
direct_set_debug.sh –sdb-set

Check model-config.xml file in /etc/config on ARTIK board as the following. the boolean of armv7 must be "true" and set the test function to "true".

# cat /etc/config/model-config.xml
...
<key name="tizen.org/feature/platform.core.cpu.arch" type="string">armv7</key>
<key name="tizen.org/feature/platform.core.cpu.arch.armv6" type="bool">false</key>
<key name="tizen.org/feature/platform.core.cpu.arch.armv7" type="bool">true</key>
<key name="tizen.org/feature/platform.core.cpu.arch.armv8" type="bool">false</key>
...

Skip this stage if there are no modifications, or run the commands in the following list to apply modified model-config.xml

rm /etc/system_info_db
system_info_init_db 
chsmack -a "_" /etc/system_info_db
sync
reboot

TCT Test

Move to the folder installed Native TCT program or Csharp TCT in host PC, run as the following;

HOST$ sudo python tct-setup.py clean
clean option is given
HOST$ sudo python tct-setup.py

In case of Native TCT

HOST$ python /opt/tct/tizen_native_4.0/scripts/tct-config-device.py

In case of Csharp TCT

HOST$ python /opt/tct/tizen_csharp_4.0/scripts/tct-config-device.py

and run TCT manager

HOST$ tct-mgr

Select "mobile" in profile menu, check the test function required and click 'run' button, then start testing. Some of examples between target functions and test items in Tizen 4.0 is refer to the below table.

Framework TCT Native TCT C#
Sensor tct-sensor-native-utc
tct-sensor-native-itc
Tizen.Sensor.Tests
Location tct-location-manager-native-itc
tct-location-manager-native-utc
Tizen.Location.Tests
Multimedia
Audio FW
Media Player
Camera
tct-sound-manager-native-itc
tct-sound-manager-native-utc
tct-audio-io-native-utc
tct-audio-io-native-utc
tct-player-native-itc
tct-player-native-utc
tct-camera-native-itc
tct-camera-native-utc
Bluetooth tct-bluetooth-native-utc
tct-bluetooth-native-itc
Wlan
WiFi
WiFi-Direct
tct-wifi-manager-native-utc
tct-wifi-manager-native-itc
tct-wifi-direct-native-utc
tct-wifi-direct-native-itc
tct-wifi-direct-native-ctc
Tizen.Network.Tests
Tizen.WiFidirect.Tests
System tct-device-native-ctc
tct-device-native-itc
tct-device-native-utc
tct-dlog-native-itc
tct-dlog-native-utc
Tizen.Device.Tests
Tizen.System.Tests

TCT Test Results

After finish testing, you can check the result included log message how many items is pass or not. The report of TCT results is saved on following directory in host PC.

TCT-Native results : /opt/tct/tizen_native_4.0/manager/result/
TCT-CSharp results : /opt/tct/tizen_csharp_4.0/manager/result/

Location

For the location framework of Tizen 4.0, please refer to the following URL.

https://wiki.tizen.org/Tizen_3.0_Porting_Guide#Location_Framework

Artik5/7 has a sample project that uses the GPS module "BerryGPS-IMU". If you want to see more information for this module, please refer to http://ozzmaker.com/product/berrygps-imu.

Project(Artik5):  platform/adaptation/artik/lbs-plugin-gps-artik5
Project(Artik7): platform/adaptation/artik/lbs-plugin-gps-artik7
Branch : tizen_4.0

This module is operated in UART mode in this project. This module also use Tizen PIO interface (Project Name: platform/core/api/peripheral-io and platform/core/system/peripheral-bus) to communicate with device (Artik5: /dev/ttyAMA4, Artik7: /dev/ttySAC4). This plugin is managed by lbs-server (Project Name: platform/core/location/lbs-server) and is located in /usr/lib/liblbs-plugin-gps-rpi3.so.

GPS Configuration

View the replay mode setting value

vconftool get db/location/replay/ReplayMode

Set the replay mode

vconftool set -t int db/location/replay/ReplayMode 1 -f

Start the location manager

systemctl start location-manager

Stop the location manager

systemctl stop location-manager

NFC

NFC OAL interface is the same as tizen 3.0.

Please refer to NFC in Tizen Porting Guide 3.0, https://wiki.tizen.org/Tizen_3.0_Porting_Guide#NFC.

NFC PROJECTs

Tizen has several projects for NFC. The branch name is tizen_4.0.

Description Project Name
nfc-manager platform/core/connectivity/nfc-manager
nfc-plugin for emulator platform/adaptation/emulator/nfc-plugin-emul
NFC api platform/core/api/nfc

NFC PLUGIN Library Location

The location of nfc plugin library is /usr/lib/nfc/libnfc-plugin.so.

NFC CONFIGURATION

Below is the configuration commands for nfc-manager to configure NFC process.

Start NFC-MANAGER

systemctl start nfc-manager

Stop NFC-MANAGER

systemctl stop nfc-manager

View the status of NFC service

vconftool get db/nfc/enable

Enable NFC service

vconftool set -t bool db/nfc/enable 1 -f

System Framework

For the LED/HAPTIC HAL of Tizen 4.0, please refer to the following URL.

https://wiki.tizen.org/Tizen_3.0_Porting_Guide#LED_HAL

LED HAL

Artik5/7 has a sample project that uses the BlinkM - I2C Controlled RGB LED. If you want to see more information for this module, please refer to https://thingm.com/products/blinkm/.

 Project: platform/core/system/libdevice-node
          platform/adaptation/samsung_exynos/device-manager-plugin-artik
 Branch : tizen_4.0

This module uses Tizen PIO interface (Project Name: platform/core/api/peripheral-io and platform/core/system/peripheral-bus) to communicate with device (/dev/i2c-1). The plugin library is located in /usr/lib/hw/led.so. This plugin library is managed by deviced (Project Name: platform/core/system/deviced). You have to check platform/core/system/deviced/packaging/deviced.spec file to include the plugin in the deviced. If not, the plugin is not included and not loaded in runtime.

[ file: devcied.spec ]

%cmake .. \
	-DTZ_SYS_ETC=%TZ_SYS_ETC \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DARCH=%{ARCH} \
	-DARCH_BIT=%{ARCH_BIT} \
	-DDPMS=%{DPMS} \
	-DENGINEER_MODE=%{engineer_mode} \
	-DPROFILE=mobile \
	-DBATTERY_MODULE=on \
	-DDISPLAY_MODULE=on \
	-DEXTCON_MODULE=on \
	-DIR_MODULE=on \
	-DLED_MODULE=on \             # ON is required to include this plugin
	-DPOWER_MODULE=on \
	-DSDB_PRESTART=%{sdb_prestart} \
	-DTOUCHSCREEN_MODULE=on \
	-DTZIP_MODULE=on \
	-DUSB_MODULE=on \
	-DUSBHOST_MODULE=on \
	-DTIZEN_FEATURE_USBHOST_TEST=on \
	-DTIZEN_FEATURE_BATTERY_OVER_TEMPERATURE=off \
	-DTIZEN_FEATURE_CPU_MODULE=on \
	-DTIZEN_FEATURE_TELEPHONY_MODULE=on \
	-DTHERMAL_MODULE=on \
	-DPASS=on \

HAPTIC HAL

Artik5/7 has a sample project that uses the Adafruit DRV2605L - I2C Controlled haptic Motor Controller. If you want to see more information for this module, please refer to https://www.adafruit.com/product/2305.

 Project: platform/core/system/feedbackd
 Branch : tizen_4.0

This module uses Tizen PIO interface (Project Name: platform/core/api/peripheral-io and platform/core/system/peripheral-bus) to communicate with device (/dev/i2c-1). The plugin library is merged into feedbackd. There is not the plugin library. This plugin library is managed by feedbackd (Project Name: platform/core/system/feedbackd).

Configuration

Start deviced

systemctl start deviced

Stop deviced

systemctl stop deviced

Start feedbackd

systemctl start feedbackd

Stop feedbackd

systemctl stop feedbackd