Difference between revisions of "IoTGateway/BSP/Linux/AM335x/V2/System Service and Usage"

From ESS-WIKI
Jump to: navigation, search
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{DISPLAYTITLE:System Service and Usage}} __TOC__
 +
 
= Service =
 
= Service =
  
Advantech has built five common network services for am335x advantech platform: tftp service, ftp service, ssh service, telnet service and http service.
+
Advantech has built five common network services for am335x advantech platform: tftp service, ftp service, ssh service, telnet service and http service. Please refer to [[IoTGateway/BSP/Linux/AM335x/System_Service_and_Usage#Service|<span class="mw-headline" id="Configure_your_Linux_Host"><span style="color:#0070c0">Service</span></span>]] to learn more.
  
 
= Other Application =
 
= Other Application =
Line 7: Line 9:
 
== <span style="color:#0070c0">Network configuration</span> ==
 
== <span style="color:#0070c0">Network configuration</span> ==
  
=== Configuration via UI ===
+
=== Configuration via Console ===
 
 
You can get an IP address via dhcp, also you can configure a static IP address for AM335x advantech platform. Click on the "Network Cfg" icon on the screen. Then Advantech NIC Configuration utility will be started. You can do some configuration of NIC. [[File:Time1.png|RTENOTITLE]]
 
 
 
As a choice, you can also do the network configuration by console using telnet. Run the following command on target system: Get IP by DHCP:
 
<pre>advantech# /etc/init.d/dhcpc eth0 start
 
advantech# /etc/init.d/dhcpc eth1 start
 
</pre>
 
  
If you want to reserve the setting after rebooting the device, set as below
+
It's important to note that our file system has ported netplug to manage the network services, so it is not recommended that users manually execute ifconfig, route, dhclient or other related commands to configure the network.
<pre>advantech# echo "/etc/init.d/dhcpc eth0 start" > /etc/adv.d/netcfg.eth0
 
advantech# echo "/etc/init.d/dhcpc eth1 start" > /etc/adv.d/netcfg.eth1
 
</pre>
 
  
Set static IP: Stop the DHCP process
+
The network usually gets dynamic IP address by default. If static IP address is needed, you can refer to the below steps:
<pre>advantech# /etc/init.d/dhcpc eth0 stop
 
advantech# /etc/init.d/dhcpc eth1 stop
 
</pre>
 
  
Set the static IP as below.
+
1. Firstly, open "/etc/netcfgfile/temp.static.netcfg.eth0" and "/etc/netcfgfile/temp.static.netcfg.eth1" file, then modify ETH0_IP, ETH1_IP, NAMESERVER,DEFAULT_GW and other variables based on your own specific needs.
<pre>advantech# /sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0
 
advantech# /sbin/route add default gw 172.21.73.253 eth0
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
 
advantech# /sbin/ifconfig eth1 192.168.3.102 netmask 255.255.255.0
 
advantech# /sbin/route add default gw ... eth1
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
 
</pre>
 
  
If you want to reserve the setting after rebooting the device, set as below
+
2. Secondly, execute the following commands to copy the configuration file to the appropriate location.
<pre>advantech# echo "/sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0; /sbin/route add
+
<pre>advantech# cp /etc/netcfgfile/temp.static.netcfg.eth0 /etc/adv.d/netcfg.eth0
default gw 172.21.73.253 eth0;echo 'nameserver 172.21.128.251' > /etc/resolv.conf;" >
+
advantech# cp /etc/netcfgfile/temp.static.netcfg.eth1 /etc/adv.d/netcfg.eth1</pre>
/etc/adv.d/netcfg.eth0
 
advantech# echo "/sbin/ifconfig eth1 192.168.3.102 netmask 255.255.255.0; /sbin/route add
 
default gw ... eth1;echo 'nameserver 172.21.128.251' > /etc/resolv.conf;" >
 
/etc/adv.d/netcfg.eth1
 
</pre>
 
  
<font color="#FF0000">Note: The IP address in above should be replaced according to user’s the requirement. For examples: IP 172.21.128.251 in above is the DNS server’s IP, user should replace it with the correct DNS IP address.</font>
+
3. Lastly, reboot the device.
  
 
== <span style="color:#0070c0">Date/Time Configuration</span> ==
 
== <span style="color:#0070c0">Date/Time Configuration</span> ==
Line 52: Line 29:
 
== <span style="color:#0070c0">About System</span> ==
 
== <span style="color:#0070c0">About System</span> ==
  
If you want to know the version information of this system, you can see it with the utility on App Launcher. Click on the “About System” icon on the screen, and you will see the version information of this system. [[File:Time4.png|RTENOTITLE]]<br/><font color="#FF0000">Note. This is a optional way to get version info under console. You can use “version” command to achieve this as flowing:</font>
+
If you want to know the version information of this system, you can use "version" command to achieve this as flowing:
 
<pre>root@am335x-adv:~# version
 
<pre>root@am335x-adv:~# version
Bsp version: RSB-4220 V1.000
+
Bsp version: RSB-4220 V2.00
 
Device name: RSB-4220
 
Device name: RSB-4220
Release date: 2014-10-09
+
Release date: 2016-09-08
Kernel version: 3.2.0
+
Kernel version: 4.1.6-g52c4aa7
 
</pre>
 
</pre>
  
Line 72: Line 49:
 
=== Overview ===
 
=== Overview ===
  
When you boot up the target system, Matrix GUI should be automatically started. Matrix is an HTML 5 based application launcher created to highlight available applications and demos provided. There are two forms of Matrix, local and remote Matrix. All of the example applications and demos are available using either the local or remote version. Matrix comes as a 6x4 matrix of icons or as a 4x3 matrix depending on the display resolution. The launcher for Matrix is just a simple QT application that displays a Webkit base browser that points to the URL [http://localhost:80 http://localhost:80]. [[File:Timer7.png|RTENOTITLE]]
+
When you boot up the target system, Matrix GUI should be automatically started. Matrix is an HTML 5 based application launcher created to highlight available applications and demos provided. There are two forms of Matrix, local and remote Matrix. All of the example applications and demos are available using either the local or remote version. Matrix comes as a 6x4 matrix of icons or as a 4x3 matrix depending on the display resolution. The launcher for Matrix is just a simple QT application that displays a Webkit base browser that points to the URL [http://localhost:80 http://localhost:80].
 +
 
 +
[[File:Rsb4220-matrix.png|RTENOTITLE]]
  
 
=== Launching and Stopping Matrix ===
 
=== Launching and Stopping Matrix ===
Line 81: Line 60:
  
 
If you want the Matrix to start with the system by default, please run the following command
 
If you want the Matrix to start with the system by default, please run the following command
<pre>advantech# cp /etc/init.d/matrix-gui-2.0 /etc/rc5.d/S97matrix-gui-2.0
+
<pre>advantech# ln -s /etc/init.d/matrix-gui-2.0 /etc/rc5.d/S97matrix-gui-2.0
 
</pre>
 
</pre>
  
Line 100: Line 79:
  
 
http:// gforge.ti.com/gf/download/frsrelease/712/5167/blank_icons_1.1.tar.gz The .desktop file is based on standard specified at the URL: http:// standards.freedesktop.org/desktop-entry-spec/latest/ Additional fields were added that are unique for Matrix. Format for each parameter: &lt;Field&gt;=&lt;Value&gt; The fields and values are case sensitive.
 
http:// gforge.ti.com/gf/download/frsrelease/712/5167/blank_icons_1.1.tar.gz The .desktop file is based on standard specified at the URL: http:// standards.freedesktop.org/desktop-entry-spec/latest/ Additional fields were added that are unique for Matrix. Format for each parameter: &lt;Field&gt;=&lt;Value&gt; The fields and values are case sensitive.
 
== <span style="color:#0070c0">Screen rotation for Qt application</span> ==
 
 
Please export the Environments:
 
<pre>export QWS_DISPLAY=Transformed:Rot90
 
</pre>
 
 
or run directly run&nbsp;:
 
<pre>./exmaple -qws -display "Transformed:Rot270"
 
</pre>
 
  
 
== <span style="color:#0070c0">Add a Startup items when boot</span> ==
 
== <span style="color:#0070c0">Add a Startup items when boot</span> ==
Line 129: Line 98:
 
then you can find the S40networking in rc5.d directory;
 
then you can find the S40networking in rc5.d directory;
  
== <span style="color:#0070c0">Package online install</span> ==
+
= Other special function =
  
=== OPKG Package Manager ===
+
== <span style="color:#0070c0">Wifi Configuration and Usage</span> ==
  
Opkg is a lightweight package management system. It is written in C and resembles apt/dpkg/yum in operation. It is intended for use on embedded Linux devices and is used in this capacity in the OpenEmbedded and OpenWrt projects. Advantech Embedded Linux for am335x advantech platfrom has built-in OPKG package manager, with this tool you can install most of the required software online, and manage them, such as uninstall, upgrades and so on.
+
=== Wifi module introduction ===
  
=== Installation New Software package ===
+
RSB-4221 supports Marverll SD8897 wifi/bt modules throught M.2. To use Marverll SD8897 wifi/bt modules, you have to boot the linux system from emmc and do following setting under uboot:
 +
<pre>AM335X RSB-4221 U-Boot# setenv mmcargs setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} M2WIFIFlag=TRUE
 +
AM335X RSB-4221 U-Boot# saveenv
 +
</pre>
  
If you want to install a software which is not exist in the current OS, you should follow the steps below:<br/>'''Step 1:''' Update the online software source:
+
If you want to use SD card instead of wifi module, you should execute the below command under uboot because the system can not detect SD card when the above command has been executed.
<pre>advantech# opkg update
+
<pre>AM335X RSB-4221 U-Boot# setenv mmcargs setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
 +
AM335X RSB-4221 U-Boot# saveenv
 
</pre>
 
</pre>
  
'''Step 2:''' Search whether the software source server has the software you need.
+
=== Wifi command introduction ===
<pre>advantech# opkg list | grep package
+
 
 +
Wifi control related commands have been included, so you can execute the below commands to connect wifi when the module is powered on.
 +
<pre>advantech# wifi-wpaon WIFI_SSID WIFI_PASSWORD</pre>
 +
 
 +
<font color="#FF0000">Note: This command is used to connect to the account whose wifi name is WIFI_SSID using WIFI_PASSWORD.</font>
 +
<pre>advantech# wifi-off</pre>
 +
 
 +
<font color="#FF0000">Note: This command is used to turn off wifi function.</font>
 +
 
 +
== <span style="color:#0070c0">Otg Mode Selection</span> ==
 +
 
 +
USB connector of RSB4220 supports two modes: Host and Slave, which require software and hardware support.The system is set to Host mode by default. If you do not need to switch between the two modes, no operation is required; if you need to switch, please refer to the following steps:
 +
 
 +
1. Please refer to the below figure to select otg mode
 +
 
 +
[[File:Rsb-4220-otg.png|RTENOTITLE]]
 +
 
 +
2. Execute one of the following commands to switch to the corresponding mode after the terminal is powered on.
 +
<pre>root@am335x-adv:/ # echo “host” > /etc/otg-mode
 
</pre>
 
</pre>
  
<font color="#FF0000">Note. Package is the keywords of the software name, for example, you want to search an ftp server, and the package should be ‘ftp’.</font>
+
or
 
+
<pre>root@am335x-adv:/ # echo “peripheral” > /etc/otg-mode
'''Step 3:''' Find the full name of the software you need in the search result list. And install it by following command:
 
<pre>advantech# opkg install packagename
 
 
</pre>
 
</pre>
  
=== More about OPKG ===
+
<font color="#FF0000">Note: The first command sets USB connector to Host mode, while the second one sets it to Slave mode. It should be consistent with the jumper setting in Step1.</font>
  
More about use and development of OPKG, Please refer to the project website of OPKG: [https://code.google.com/p/opkg/ https://code.google.com/p/opkg/]
+
3. Reboot the system.

Latest revision as of 04:21, 8 February 2017

Service

Advantech has built five common network services for am335x advantech platform: tftp service, ftp service, ssh service, telnet service and http service. Please refer to Service to learn more.

Other Application

Network configuration

Configuration via Console

It's important to note that our file system has ported netplug to manage the network services, so it is not recommended that users manually execute ifconfig, route, dhclient or other related commands to configure the network.

The network usually gets dynamic IP address by default. If static IP address is needed, you can refer to the below steps:

1. Firstly, open "/etc/netcfgfile/temp.static.netcfg.eth0" and "/etc/netcfgfile/temp.static.netcfg.eth1" file, then modify ETH0_IP, ETH1_IP, NAMESERVER,DEFAULT_GW and other variables based on your own specific needs.

2. Secondly, execute the following commands to copy the configuration file to the appropriate location.

advantech# cp /etc/netcfgfile/temp.static.netcfg.eth0 /etc/adv.d/netcfg.eth0
advantech# cp /etc/netcfgfile/temp.static.netcfg.eth1 /etc/adv.d/netcfg.eth1

3. Lastly, reboot the device.

Date/Time Configuration

You can use the tool we provide to modify the system time. Click on the "Time Settings" icon on the screen. Then Advantech Date/Time Settings utility will be started.
RTENOTITLE
After the time is adjusted, please click “OK” button, and the date will be saved. Meanwhile, the RTC time will be synchronized to the time you just set.

About System

If you want to know the version information of this system, you can use "version" command to achieve this as flowing:

root@am335x-adv:~# version
Bsp version: RSB-4220 V2.00
Device name: RSB-4220
Release date: 2016-09-08
Kernel version: 4.1.6-g52c4aa7

Brightness Control

We provide a gui application to control the brightness. So, you can conveniently adjust the screen brightness.
RTENOTITLE

Serial Tools

We have five serial ports, named ttyO1~ttyO5. And we provide a serial test tool to let it easily to validate the serial ports.
RTENOTITLE

Matrix GUI User‘s Guide

Overview

When you boot up the target system, Matrix GUI should be automatically started. Matrix is an HTML 5 based application launcher created to highlight available applications and demos provided. There are two forms of Matrix, local and remote Matrix. All of the example applications and demos are available using either the local or remote version. Matrix comes as a 6x4 matrix of icons or as a 4x3 matrix depending on the display resolution. The launcher for Matrix is just a simple QT application that displays a Webkit base browser that points to the URL http://localhost:80.

RTENOTITLE

Launching and Stopping Matrix

If the Matrix GUI does not start with the system, you can manually start the program by the following command:

advantech# /etc/init.d/matrix-gui-2.0 start

If you want the Matrix to start with the system by default, please run the following command

advantech# ln -s /etc/init.d/matrix-gui-2.0 /etc/rc5.d/S97matrix-gui-2.0

When you want to cancel the default startup, just remove the S97matrix-gui-2.0 file. For more information on the use of Matrix, please refer to the following website: http://processors.wiki.ti.com/index.php/Matrix_Users_Guide.

Adding a Matrix Application

Below are step-by-step instructions for Adding a New Application/Directory to Matrix.

  • Create a new folder on your target file system at /usr/share/matrix-gui-2.0/apps/. The name should be a somewhat descriptive representation of the application or directory. The folder name must be different from any existing folders at that location.
  • Create a desktop file based on the parameters discussed below. It is recommended the name of the desktop file match the name of the newly created folder. No white spaces can be used for the desktop filename. The desktop file parameters should be set depending on if you want to add a new application or a new directory to Matrix. The Type field must be set according to

your decision. The desktop file must have the desktop suffix.

  • Update the Icon field in the desktop to refer to any existing Icon in the /usr/share/matrix-gui-2.0 directory or subdirectories. You can also add a new 96x96 png image and place it into your newly created folder.
  • Optionally for applications you can add a HTML file that contains the application description in your newly created directory. If you add a description page then update the X-Matrix-Description field in the .desktop file.
  • Refresh Matrix using the application "Refresh Matrix" located in the Settings submenu. Blank template icons for Matrix can be found here:

http:// gforge.ti.com/gf/download/frsrelease/712/5167/blank_icons_1.1.tar.gz The .desktop file is based on standard specified at the URL: http:// standards.freedesktop.org/desktop-entry-spec/latest/ Additional fields were added that are unique for Matrix. Format for each parameter: <Field>=<Value> The fields and values are case sensitive.

Add a Startup items when boot

  • Remove a Startup items:
update-rc.d [-n] [-f] [-r <root>] <basename> remove 

basename is your service script name

 eg. update-rc.d -f matrix-gui-2.0 remove 
  • Add a Startup items:

Firstly,You must ensure that the service script is exists,then run the flowing command:

 update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] . 

start|stop : when system start /shutdown the basename wiil run automatically
NN: 0~99
runlvl: advantech AM335x platform runlevel is 5(default);

 eg. update-rc.d networking start 40 5 . 

then you can find the S40networking in rc5.d directory;

Other special function

Wifi Configuration and Usage

Wifi module introduction

RSB-4221 supports Marverll SD8897 wifi/bt modules throught M.2. To use Marverll SD8897 wifi/bt modules, you have to boot the linux system from emmc and do following setting under uboot:

AM335X RSB-4221 U-Boot# setenv mmcargs setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} M2WIFIFlag=TRUE
AM335X RSB-4221 U-Boot# saveenv

If you want to use SD card instead of wifi module, you should execute the below command under uboot because the system can not detect SD card when the above command has been executed.

AM335X RSB-4221 U-Boot# setenv mmcargs setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
AM335X RSB-4221 U-Boot# saveenv

Wifi command introduction

Wifi control related commands have been included, so you can execute the below commands to connect wifi when the module is powered on.

advantech# wifi-wpaon WIFI_SSID WIFI_PASSWORD

Note: This command is used to connect to the account whose wifi name is WIFI_SSID using WIFI_PASSWORD.

advantech# wifi-off

Note: This command is used to turn off wifi function.

Otg Mode Selection

USB connector of RSB4220 supports two modes: Host and Slave, which require software and hardware support.The system is set to Host mode by default. If you do not need to switch between the two modes, no operation is required; if you need to switch, please refer to the following steps:

1. Please refer to the below figure to select otg mode

RTENOTITLE

2. Execute one of the following commands to switch to the corresponding mode after the terminal is powered on.

root@am335x-adv:/ # echo “host” > /etc/otg-mode

or

root@am335x-adv:/ # echo “peripheral” > /etc/otg-mode

Note: The first command sets USB connector to Host mode, while the second one sets it to Slave mode. It should be consistent with the jumper setting in Step1.

3. Reboot the system.