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

From ESS-WIKI
Jump to: navigation, search
Line 51: Line 51:
  
 
= Other Application =
 
= Other Application =
== <span style="color:#0070c0"> Network configuration </span> ==
+
== <span style="color:#0070c0">Network configuration</span> ==
 +
 
 
=== Configuration via UI ===
 
=== Configuration via UI ===
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.
 
[[Image: time1.png]]<br>
 
  
As a choice, you can also do the network configuration by console using telnet. Run the
+
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]]
following command on target system:
+
 
Get IP by DHCP:
+
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>
+
<pre>advantech# /etc/init.d/dhcpc eth0 start
advantech# /etc/init.d/dhcpc eth0 start
 
 
advantech# /etc/init.d/dhcpc eth1 start
 
advantech# /etc/init.d/dhcpc eth1 start
 
</pre>
 
</pre>
 +
 
If you want to reserve the setting after rebooting the device, set as below
 
If you want to reserve the setting after rebooting the device, set as below
<pre>
+
<pre>advantech# echo "/etc/init.d/dhcpc eth0 start" > /etc/adv.d/netcfg.eth0
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
 
advantech# echo "/etc/init.d/dhcpc eth1 start" > /etc/adv.d/netcfg.eth1
 
</pre>
 
</pre>
Set static IP:
+
 
Stop the DHCP process
+
Set static IP: Stop the DHCP process
<pre>
+
<pre>advantech# /etc/init.d/dhcpc eth0 stop
advantech# /etc/init.d/dhcpc eth0 stop
 
 
advantech# /etc/init.d/dhcpc eth1 stop
 
advantech# /etc/init.d/dhcpc eth1 stop
 
</pre>
 
</pre>
  
 
Set the static IP as below.
 
Set the static IP as below.
<pre>
+
<pre>advantech# /sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0
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# /sbin/route add default gw 172.21.73.253 eth0
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
Line 86: Line 80:
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
 
advantech# echo 'nameserver 172.21.128.251' >> /etc/resolv.conf
 
</pre>
 
</pre>
 +
 
If you want to reserve the setting after rebooting the device, set as below
 
If you want to reserve the setting after rebooting the device, set as below
<pre>
+
<pre>advantech# echo "/sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0; /sbin/route add
advantech# echo "/sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0; /sbin/route add
 
 
default gw 172.21.73.253 eth0;echo 'nameserver 172.21.128.251' > /etc/resolv.conf;" >
 
default gw 172.21.73.253 eth0;echo 'nameserver 172.21.128.251' > /etc/resolv.conf;" >
 
/etc/adv.d/netcfg.eth0
 
/etc/adv.d/netcfg.eth0
Line 96: Line 90:
 
</pre>
 
</pre>
  
<font color="#FF0000">Note:
+
<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>
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
+
== <span style="color:#0070c0"> Date/Time Configuration </span>==
the correct DNS IP address. </font>
 

Revision as of 10:37, 29 September 2016

Service

Advantech has built five common network services for am335x advantech platform: tftp service, ftp service, ssh service, telnet service and http service.

Tftp Server

When boot up the target board, the tftp service is already started by default(am335x advantech platform) and the tftp server’s working directory is /tftpboot. You need execute “chmod 777 /tftpboot” on target system to let the tftp server work. Then, user can tftp to target board by tftp client in host PC. Use command to get and put file like this:

hostPC$ tftp TARGET_SYSTEM_IP
tftp>get file1
tftp>put file2

Command “get file1” is to download file1 from tftp server. File “file1” must exist under the directory /tftpboot on your target filesystem; Command “put file2” is to upload file2 to tftp server. If put file2 success, file2 will be put to directory /tftpboot on your target filesystem;

Ftp server

The ftp server on target system is vsftpd and you should manually start it using flowing command:

root@am335x-adv:/ # /etc/init.d/vsftpd start

While, the stoping command is:

root@am335x-adv:/ # /etc/init.d/vsftpd stop

Note. After start the ftp server. You had to manually add user ftp:

root@am335x-adv:/ # adduser ftp
root@am335x-adv:/ # chown root:root /home/ftp/

Then you can ftp your target board using user ftp.

Ssh server

When boot up the target board, the ssh service is already started by default. You can run the following command on your host PC to login the target system:

hostPC$ sudo ssh -l root TARGET_SYSTEM_IP

telnet Server

When boot up the target board, the telnet service is already started by default. You can run the following command on your host PC to login the target system:

hostPC$ sudo telnet TARGET_SYSTEM_IP

http Server

We support an embedded web server name lighttpd and the matrix gui is based on it.

Other Application

Network configuration

Configuration via UI

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. 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:

advantech# /etc/init.d/dhcpc eth0 start
advantech# /etc/init.d/dhcpc eth1 start

If you want to reserve the setting after rebooting the device, set as below

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

Set static IP: Stop the DHCP process

advantech# /etc/init.d/dhcpc eth0 stop
advantech# /etc/init.d/dhcpc eth1 stop

Set the static IP as below.

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

If you want to reserve the setting after rebooting the device, set as below

advantech# echo "/sbin/ifconfig eth0 172.21.73.191 netmask 255.255.255.0; /sbin/route add
default gw 172.21.73.253 eth0;echo 'nameserver 172.21.128.251' > /etc/resolv.conf;" >
/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

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.

Date/Time Configuration