Moxa Technologies UC-8100-LX Software Manual

UC-8100-LX Software Manual
Second Edition, March 2015
www.moxa.com/product
© 2015 Moxa Inc. All rights reserved.
UC-8100-LX Software Manual
The software described in this manual is furnished under a license agreement and may be used only in accordance with
the terms of that agreement.
© 2015 Moxa Inc. All rights reserved.
Trademarks
The MOXA logo is a registered trademark of Moxa Inc.
All other trademarks or registered marks in this manual belong to their respective manufacturers.
Disclaimer
Information in this document is subject to change without notice and does not represent a commitment on the part of
Moxa.
Moxa provides this document as is, without warranty of any kind, either expressed or implied, including, but not limited
to, its particular purpose. Moxa reserves the right to make improvements and/or changes to this manual, or to the
products and/or the programs described in this manual, at any time.
Information provided in this manual is intended to be accurate and reliable. However, Moxa assumes no responsibility for
its use, or for any infringements on the rights of third parties that may result from its use.
This product might include unintentional technical or typographical errors. Changes are periodically made to the
information herein to correct such errors, and these changes are incorporated into new editions of the publication.
Technical Support Contact Information
www.moxa.com/support
Moxa Americas
Toll-free: 1-888-669-2872
Tel: +1-714-528-6777
Fax: +1-714-528-6778
Moxa Europe
Tel: +49-89-3 70 03 99-0
Fax: +49-89-3 70 03 99-99
Moxa India
Tel: +91-80-4172-9088
Fax: +91-80-4132-1045
Moxa China (Shanghai office)
Toll-free: 800-820-5036
Tel: +86-21-5258-9955
Fax: +86-21-5258-5505
Moxa Asia-Pacific
Tel: +886-2-8919-1230
Fax: +886-2-8919-1231
Table of Contents
1. Introduction ...................................................................................................................................... 1-1
2. Getting Started.................................................................................................................................. 2-1
Software Architecture .......................................................................................................................... 2-3
Software Packages .............................................................................................................................. 2-3
Connecting to the UC-8100-LX ............................................................................................................. 2-3
Connecting through Serial Console ................................................................................................ 2-3
SSH Console ............................................................................................................................... 2-5
User Account Management ................................................................................................................... 2-7
Switching to the Root Account ...................................................................................................... 2-7
Creating and Deleting User Accounts ..................................................................................................... 2-7
Disabling the Default User Account ....................................................................................................... 2-7
Network Settings ................................................................................................................................ 2-8
Configuring Ethernet Interfaces ..................................................................................................... 2-8
Connecting to a Cellular Network ................................................................................................... 2-9
System Administration ........................................................................................................................ 2-9
Querying the Firmware Version ..................................................................................................... 2-9
Adjusting the Time ...................................................................................................................... 2-9
Setting the Time Zone ............................................................................................................... 2-10
Determining Available Drive Space ...................................................................................................... 2-11
Enabling and Disabling Daemons ........................................................................................................ 2-11
Package Management........................................................................................................................ 2-12
Reboot/Shutdown the UC-8100-LX ...................................................................................................... 2-13
3. Advanced Configurations on Peripherals ........................................................................................... 3-1
Serial Ports ........................................................................................................................................ 3-2
stty ........................................................................................................................................... 3-2
USB Port ............................................................................................................................................ 3-3
Disable the USB Port .................................................................................................................... 3-3
USB Automount .......................................................................................................................... 3-4
SD and MicroSD Slot ........................................................................................................................... 3-4
Enabling Write Protection ............................................................................................................. 3-5
Preparing a Bootable SD Card .............................................................................................................. 3-5
Creating a Linux System Image using a Windows Platform ............................................................... 3-6
Creating a System Image in a Linux Environment ............................................................................ 3-7
Booting Up the UC-8100-LX for the first time ......................................................................................... 3-8
File system resizing ..................................................................................................................... 3-8
Booting from a MicroSD Card (UC-8112 Model Only) ........................................................................ 3-8
The Push Button and the LED indicators ................................................................................................ 3-8
Diagnosing Device and Subsystem Failures ..................................................................................... 3-9
Restoring Firmware to Factory Default ................................................................................................... 3-9
Using Cellular Modules ...................................................................................................................... 3-10
Cellular Signal Strength ............................................................................................................. 3-10
Cellular Dial-Up mode ................................................................................................................ 3-10
Cellular GPS Port ....................................................................................................................... 3-10
Configuring MC-7304/ MC-7354 Cellular Modules .......................................................................... 3-10
Configuring the Wireless LAN ............................................................................................................. 3-13
Configuring WPA2 Settings ......................................................................................................... 3-13
Connecting to an AP Using WEP Authentication ............................................................................. 3-14
Connecting to an AP Using WPA/WPA2 PSK Authentication ............................................................. 3-14
Using wpa_cli............................................................................................................................ 3-15
4. Security On UC-8100-LX .................................................................................................................... 4-1
Secure Boot ....................................................................................................................................... 4-3
Trusted Platform Module (TPM) and TrouSerS......................................................................................... 4-4
Enabling TPM via the Bootloader ................................................................................................... 4-5
Start TPM Services ...................................................................................................................... 4-5
Initializing the Trusted Platform Module.......................................................................................... 4-6
Getting the Public Endorsement Key .............................................................................................. 4-6
Sealing/Unsealing Data ................................................................................................................ 4-7
SUDO Mechanism ............................................................................................................................... 4-7
5. General Debian Package Usage ......................................................................................................... 5-1
NTP Client .......................................................................................................................................... 5-2
Execute Scheduled Commands with cron ............................................................................................... 5-2
Updating System Time and RTC .................................................................................................... 5-2
Rocket-Fast System for Log Processing: rsyslog ..................................................................................... 5-3
Rsyslog’s Configuration File .......................................................................................................... 5-3
Syntax of the Selector ................................................................................................................. 5-3
OpenSSL ........................................................................................................................................... 5-4
Ciphers ...................................................................................................................................... 5-5
Cryptographic Hash Functions ....................................................................................................... 5-5
The Apache Web Server ...................................................................................................................... 5-5
Edit ServerName in Apache Configuration File ................................................................................. 5-5
SFTP ................................................................................................................................................. 5-6
DNS .................................................................................................................................................. 5-6
IPTABLES .......................................................................................................................................... 5-7
Observe and Erase Chain Rules ..................................................................................................... 5-9
Define Policy for Chain Rules....................................................................................................... 5-10
Append or Delete Rules .............................................................................................................. 5-11
rsync............................................................................................................................................... 5-12
Using rsync for External Backups ................................................................................................. 5-12
Automating rsync Backups ......................................................................................................... 5-12
NAT ................................................................................................................................................ 5-13
NAT Example ............................................................................................................................ 5-13
Enabling NAT at Bootup ............................................................................................................. 5-13
NFS (Network File System) ................................................................................................................ 5-14
Setting up UC-8100-LX as an NFS Client ...................................................................................... 5-15
SNMP .............................................................................................................................................. 5-15
OpenVPN ......................................................................................................................................... 5-16
Static-Key VPN .......................................................................................................................... 5-17
Package Management........................................................................................................................ 5-18
apt-get .................................................................................................................................... 5-18
apt-cache ................................................................................................................................. 5-18
List All Available Packages .......................................................................................................... 5-18
Find Out Package Name and Description of Software ..................................................................... 5-18
Check Package Information ........................................................................................................ 5-18
Check Dependencies for Specific Packages ................................................................................... 5-18
Check statistics of Cache ............................................................................................................ 5-18
Update System Packages ........................................................................................................... 5-19
Install or Upgrade Specific Packages ............................................................................................ 5-19
Upgrade All Software Packages ................................................................................................... 5-19
Install Multiple Packages ............................................................................................................ 5-19
Install Several Packages using Wildcard ....................................................................................... 5-19
Install Packages without Upgrading ............................................................................................. 5-19
Upgrade Specific Packages ......................................................................................................... 5-19
Install Specific Package Version .................................................................................................. 5-19
Remove Packages Without Configuration ...................................................................................... 5-20
Completely Remove Packages ..................................................................................................... 5-20
Clean Up Disk Space .................................................................................................................. 5-20
Download Only Source Code of Package ....................................................................................... 5-20
Download and Unpack a Package ................................................................................................ 5-20
Download, Unpack and Compile a Package ................................................................................... 5-20
Download a Package Without Installing ........................................................................................ 5-20
Check Change Log of Package ..................................................................................................... 5-20
Check Broken Dependencies ....................................................................................................... 5-21
Search and Build Dependencies ................................................................................................... 5-21
Auto Clean Apt-Get Cache .......................................................................................................... 5-21
Auto Remove Installed Packages ................................................................................................. 5-21
6. Programmer's Guide ......................................................................................................................... 6-1
Linux Tool Chain Introduction ............................................................................................................... 6-2
Native Compilation ...................................................................................................................... 6-2
Cross Compilation ....................................................................................................................... 6-2
Obtaining Help ............................................................................................................................ 6-4
Test Program—Developing Hello.c ......................................................................................................... 6-4
Compiling Hello.c with Native Compilation ...................................................................................... 6-5
Compiling Hello.c with Cross Compilation ....................................................................................... 6-5
Makefile Example ................................................................................................................................ 6-6
Modbus ............................................................................................................................................. 6-6
RTC (Real Time Clock) ......................................................................................................................... 6-7
WDT (Watch Dog Timer) ...................................................................................................................... 6-8
Cryptographic Hardware Accelerator ..................................................................................................... 6-9
Diagnostic LED ................................................................................................................................... 6-9
Turn on LEDs API ........................................................................................................................ 6-9
Turn off LED API ......................................................................................................................... 6-9
Blink LED API .............................................................................................................................. 6-9
TPM ................................................................................................................................................ 6-10
A. Default Installed Package List ........................................................................................................... A-1
B. Extending the Lifetime of the SD Card ............................................................................................... B-1
Overview ........................................................................................................................................... B-2
SD Flash Types ........................................................................................................................... B-2
Tips for Running GNU/Linux on an SD Card ............................................................................................ B-2
Use SLC SD Card ......................................................................................................................... B-2
Use an SD Card with Larger Capacity ............................................................................................. B-2
Tweak GNU/Linux to Write to RAM Instead of the SD card. ............................................................... B-3
Set the SD Card to Read-only Mode ............................................................................................... B-3
C. Copying Images on an SD/MicroSD Card ........................................................................................... C-1
Using Win32 Disk Imager .................................................................................................................... C-1
Using the dd command ........................................................................................................................ C-2
1
1. 7BIntroduction
This is the programming and software operation manual for the Linux OS models of the UC-8100 series of
embedded computers.
The UC-8100 series of computers come in various models that provide a range of operating systems, ARM
architecture CPUs, and software enhancements. The following models are covered by this manual:
UC-8131-LX: RISC-based platform with 300 MHz CPU, 2 Ethernet, 1 Serial port, 1 GB SD, USB
Port and Debian ARM 7
UC-8132-LX: RISC-based platform with 300 MHz CPU, Mini PCIe socket for cellular, 2 Ethernet,
2 serial ports, 1 GB SD, USB port and Debian ARM 7
UC-8162-LX: RISC-based platform with 600 MHz CPU, Mini PCIe socket for cellular, 2 Ethernet,
2 serial ports, 1 GB SD, USB port and Debian ARM 7
UC-8112-LX: RISC-based platform with 1 GHz CPU, Mini PCIe socket for cellular, 2 Ethernet, 2
serial ports, 1 GB SD, USB port, TPM, Micro SD Socket, and Debian ARM 7
8B
60B
61B
62B
63B
64B
65B
66B
67B
2
2.
Getting Started
This chapter describes how to use configure the UC-8100 basic settings.
The following topics are covered in this chapter:
13BSoftware Architecture
14BSoftware Packages
15BConnecting to the UC-8100-LX
Connecting through Serial Console
SSH Console
16BUser Account Management
Switching to the Root Account
17BCreating and Deleting User Accounts
18BDisabling the Default User Account
19BNetwork Settings
Configuring Ethernet Interfaces
Connecting to a Cellular Network
20BSystem Administration
Querying the Firmware Version
Adjusting the Time
Setting the Time Zone
21BDetermining Available Drive Space
22BEnabling and Disabling Daemons
23BPackage Management
24BReboot/Shutdown the UC-8100-LX
UC-8100-LX Software Getting Started
2-2
UC-8100-LX Software Getting Started
2-3
13BSoftware Architecture
The Linux operating system that is pre-installed in UC-8100-LX series follows standard Linux architecture,
making it easy to accept programs that follow the POSIX standard. This computer uses the Debian ARM 7
distribution so that users can enjoy the full range of Debian software, and benefit from its strong community of
developers and documentation. With Debian ARM, the UC-8100-LX supports both native and cross compilation,
making programming on the computer more easy and straightforward.
The UC-8100-LX series image is partitioned into bootloader and Linux kernel, backup root file system and root
file system. Refer to the following image partition table for reference.
Partition System Content Partition Format Partition Size
1 Bootloader and Linux kernel W95 FAT32 32 MB
2 Backup root file system EXT4 128 MB
3 Root file system EXT4 Rest of the capacity
The default file system format of UC-8100 Series is EXT4. It is a journaling file system for Linux, developed as
the successor to EXT3. The journaling file system keeps track of the changes before committing them to the
main file system. In the event of a system crash or power failure, journaling file systems are quicker to bring
back online and less likely to become corrupted.
NOTE Click on the following links for more information on EXT4.
https://wiki.debian.org/Ext4
https://ext4.wiki.kernel.org/index.php/Ext4_Howto
14BSoftware Packages
Please refer to Apendix A to for default installed software packages. Most of the software packages come from
Debian community whereas the unique features of UC-8100-LX series such as the diagnostic LED, wireless
connection will be supported by Moxa. Please refer to Package Management section for how to manage the
software package on UC-8100-LX series.
15BConnecting to the UC-8100-LX
You will need another computer to connect to the UC-8100-LX and log on to the command line interface. There
are two ways to connect: through serial console cable or through Ethernet cable. You may refer to the
Hardware Manual to see how to connect them physically.
The default login user and password are:
Login: moxa
Password: moxa
They are the same for all serial console and ssh remote login. Root account login is disabled until you manually
create password for the account. User moxa is in the sudo group so you may operate system level commands
with this user by sudo command. See more detail in Sudo Mechanism section.
ATTENTION
For security reason, we recommend you to disable the default user account and create your own user accounts.
60BConnecting through Serial Console
This method is particularly useful when using the computer for the first time. The signal is transmitted over a
direct serial connection so you do not need to know either of its two IP addresses in order to connect to
UC-8100-LX Software Getting Started
2-4
LX, NOT to be done on the
user@PC1:~# yum -y install minicom
user@PC2:~# apt-get install minicom
user@PC1:~# minicom –s
UC-8100-LX. To connect through serial console, you need terminal software installed on your PC. Set the
following serial connection parameters on your PC terminal software.
Serial Console Port Settings
Baud rate 115200 bps
Parity None
Data bits 8
Stop bits: 1
Flow Control None
Terminal VT100
Below we will show how to use the terminal software to connect to the UC-8100-LX Series in Linux environment
and in Windows environment.
Linux Users
NOTE These steps are done on the Linux PC from which you want to connect to UC-8100-
UC-8100-LX
For Linux users, you may follow these steps to connect to UC-8100-LX Series from your personal computer.
1. Install minicom from the package repository of your operating system.
For Centos and Fedora:
For Ubuntu and Debian:
2. Use minicom –s command to enter configuration menu and setup the serial port settings.
3. Select Serial port setup.
4. Select A to change the serial device. Note that you need to know which device node is connected to the
UC-8100-LX.
5. Select E to configure the port settings according to the Serial Console Port Settings table provided.
6. Select Save setup as dfl (from the main configuration menu) to save as default value.
UC-8100-LX Software Getting Started
2-5
user@PC1:~# minicom
LX, NOT to be done on
7. Select Exit from minicom (from the configuration menu) to leave the configuration menu.
8. Execute minicom after completing the above configurations.
Windows Users
NOTE These steps are done on the Windows PC from which you want to connect to UC-8100-
the UC-8100-LX
For Windows users, follow these steps.
1. Download PuTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
connection withr the UC-8100-LX in Windows environment. The following figure shows a simple example of
the configuration that is required.
2. Once the connection is established, the following window will open.
to set up serial
61BSSH Console
The UC-8100-LX supports SSH connection through Ethernet. Use the following default IP address of
UC-8100-LX to connect.
Port Default IP
LAN 1 192.168.3.127
LAN 2 192.168.4.127
UC-8100-LX Software Getting Started
2-6
LX, NOT to be done on the
user@PC1:~ ssh moxa@192.168.3.127
Are you sure you want to continue connection (yes/no)?
ATTENTION
sudo ssh-keygen -t ecdsa –f. /etc/ssh/ssh_host_ecdsa_key
moxa@Moxa:~$ sudo /etc/init.d/ssh restart
LX, NOT to be done on
Linux Users
NOTE These steps are done on the Linux PC from which you want to connect to UC-8100-
UC-8100-LX.
From a Linux computer, use ssh command to access from UC-8100-LX LAN1.
Type yes to complete the connection.
The authenticity of host ‘192.168.3.127 (192.168.4.127)’ can’t be established.
RSA key fingerprint is 8b:ee:ff:84:41:25:fc:cd:2a:f2:92:8f:cb:1f:6b:2f.
yes_
Rekey SSHD regularly
In order to secure your system, we suggest you do SSH-rekey regularly. Refer to the following steps.
cd /etc/ssh
sudo rm –rf
ssh_host_dsa_key ssh_host_ecdsa_key ssh_host_rsa_key
ssh_host_dsa_key.pub ssh_host_ecdsa_key.pub ssh_host_rsa_key.pub
sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
When prompted for a passphrase, leave the passphrase empty and press enter.
Restart SSH
NOTE These steps are done on the Windows PC from which you want to connect to UC-8100-
For more information about SSH, refer to the following link.
https://wiki.debian.org/SSH
Windows Users
the UC-8100-LX
For Windows users, follow these steps.
1. Click on the link http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
(free software) to set up an SSH console for the UC-8100-LX in a Windows environment. The following
figure shows a simple example of the configuration that is required.
to download PuTTY
UC-8100-LX Software Getting Started
2-7
. Note the quotes around the
moxa@Moxa:~# sudo useradd -m -G sudo -s /bin/bash test1
passwd: password updated successfully
moxa@Moxa:# sudo userdel test1
root@Moxa:# passwd –l moxa
root@Moxa:# passwd –u moxa
16BUser Account Management
62BSwitching to the Root Account
You can switch to root using sudo -i (or sudo su). For security reason, it is not suggested to operate all
commands by root account.
NOTE Click the following links for more information on sudo.
https://wiki.debian.org/sudo
ATTENTION
You may get permission denied while using pipe or redirect behavior with non-root account
You must use 'sudo su -c' to run the command instead of using >, <, >>, << etc..
full command:
17BCreating and Deleting User Accounts
You may use the command useradd and userdel to create and delete user accounts. Be sure to reference the
man page of these commands to set relevant previledge of the account. Following example shows to create a
test1 user in sudo group whose default login shell is bash and has home directory at /home/test1
To edit the password of test1 use passwd and enter twice the password to confirm.
moxa@Moxa:~# sudo passwd test1
Enter new UNIX password:
Retype new UNIX password:
To delete user test1, you can use the command userdel
18BDisabling the Default User Account
ATTENTION
You should first create a user account before you disable the default account.
You can use passwd command to lock the default user account so user moxa cannot login.
To unlock the user moxa:
UC-8100-LX Software Getting Started
2-8
moxa@Moxa:/etc/network/~$
broadcast 192.168.4.255~
19BNetwork Settings
63BConfiguring Ethernet Interfaces
After first login, you may configure the network setting on UC-8100-LX to better fit your application. Note that
it is more convenient to manipulate the network interface settings from serial console than from SSH login to
avoid reconnections.
Modifying Network Settings via the Serial Console
In this section, we use the serial console to configure network settings of the UC-8100-LX computer.
Follow the instructions given in a previous section to access the Console Utility of the target computer via the
serial Console port, and then type
moxa@Moxa:~$ cd /etc/network/
Type Moxa:~# sudo vi interfaces to edit the network configuration file with vi editor. You can configure
Ethernet ports of the UC-8100-LX for static or dynamic (DHCP) IP addresses.
Moxa:~# cd /etc/network to change directories.
Static IP address
As shown below, 2 network addresses need to be modified: address, network, netmask, and broadcast.
The default IP address of the UC-8100-LX is 192.168.3.127 for LAN 1.
# interfaces(5) file used by ifup(8) and ifdown(8)
auto eth0 eth1 lo
iface lo inet loopback
# embedded ethernet LAN1
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.3.127
network 192.168.3.0
netmask 255.255.255.0
broadcast 192.168.3.255
# embedded ethernet LAN2
iface eth1 inet static
address 192.168.4.127
network 192.168.4.0
netmask 255.255.255.0
UC-8100-LX Software Getting Started
2-9
moxa@Moxa:~$ echo “APN=internet” | sudo tee /etc/qmi-network.conf
moxa@Moxa:~$ sudo cell_mgmt start
UC-8112-LX version 1.0.0
UC-8112-LX version 1.0.0 Build 14050416
Dynamic IP addresses:
To configure one or both LAN ports to request an IP address dynamically, replace static with dhcp and then
delete the address, network, netmask, and broadcast lines.
Default Setting for LAN1 Dynamic Setting using DHCP
iface eth0 inet static
address 192.168.3.127
network: 192.168.3.0
netmask 255.255.255.0
broadcast 192.168.3.255
# embedded ethernet LAN1
iface eth0 inet dhcp
64BConnecting to a Cellular Network
You can install cellular modules on UC-8100-LX series. Refer to Moxa Official Website or the product data for
compatible cellular modules.
iface eth0 inet dhcp
The cellular connection utitlity is cell_mgmt. Once you have cellular module installed and SIM card inserted,
you may use the command to connect.
First, edit the APN name in /etc/qmi-network.conf:
And use the following command:
Please refer to Cellular Module section for more advanced settings.
20BSystem Administration
65BQuerying the Firmware Version
To check the firmware version of UC-8100-LX series, type:
moxa@Moxa:~$ kversion
Adding the –a option will give you the full build version:
moxa@Moxa:~$ kversion -a
66BAdjusting the Time
The UC-8100-LX has two time settings. One is the system time, and the other is the RTC (Real Time Clock) time
kept by the UC-8100-LX hardware. Use the
system time. Use
#hwclock to query the current RTC time or set a new RTC time.
#date command to query the current system time or set a new
Use the command date MMDDhhmmYYYY to set the system time :
MM = Month DD = Date
hhmm = hour and minute
UC-8100-LX Software Getting Started
2-10
Mon Jul 11 23:19:00 UTC 2014
Fri 11 Jul 2014 11:19:38 PM UTC -1.006862 seconds
moxa@Moxa:~$ export TZ= EST0
YYYY = Yearmoxa@Moxa:~$ sudo date 071123192014
Use the following command to set the RTC time to system time:
moxa@Moxa:~$ sudo hwclock –w
moxa@Moxa:~$ sudo hwclock
NOTE Click the following links for more information on Datetime.
https://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
https://wiki.debian.org/DateTime
67BSetting the Time Zone
There are two ways for supporting the timezone configuration on Moxa embedded computer. One is using the
TZ variable. The other is using /etc/localtime.
TZ variable
TZ environment variable format looks like this:
TZ=standardHH[:MM[:SS]][daylight[HH[:MM[:SS]]][,start date[/starttime], enddate[/endtime]]]
Here are some possible settings for the North American Eastern time zone:
TZ=EST5EDT
TZ=EST0EDT
TZ=EST0
In the first case, the reference time is GMT and thus stored time values are correct world wide. A simple change
of the TZ variable prints local time correctly, anywhere. In the second case, the reference time is Eastern
Standard Time and the only conversion performed is for Daylight Saving Time. Therefore, there is no need to
adjust the hardware clock for Daylight Saving Time twice per year. In the third case, the reference time is
always the time reported. This is suggested if the hardware clock on your machine automatically adjusts for
Daylight Saving Time or you insist on manually resetting the hardware time twice a year.
Adding in the file /etc/rc.d/rc.local, the timezone setting will be activated after the computer restarts.
Following are other possible values for the TZ environment variable:
Hours From Greenwich Mean Time (GMT) Value Description
0 GMT Greenwich Mean Time
+1 ECT European Central Time
+2 EET European Eastern Time
+2 ART
+3 EAT Saudi Arabia
+3.5 MET Iran
+4 NET
+5 PLT West Asia
+5.5 IST India
+6 BST Central Asia
+7 VST Bangkok
+8 CTT China
+9 JST Japan
+9.5 ACT Central Australia
UC-8100-LX Software Getting Started
2-11
tmpfs 50M 0 50M 0% /run/shm
moxa@Moxa:~$ sudo insserv –d apache2
moxa@Moxa:~$ sudo insserv -r apache2
Hours From Greenwich Mean Time (GMT) Value Description
+10 AET Eastern Australia
+11 SST Central Pacific
+12 NST New Zealand
-11 MIT Samoa
-10 HST Hawaii
-9 AST Alaska
-8 PST Pacific Standard Time
-7 PNT Arizona
-7 MST Mountain Standard Time
-6 CST Central Standard Time
-5 EST Eastern Standard Time
-5 IET Indiana East
-4 PRT Atlantic Standard Time
-3.5 CNT Newfoundland
-3 AGT Eastern South America
-3 BET Eastern South America
-1 CAT Azores
/etc/localtime
The local timezone is stored in /etc/localtime and is used by GNU Library for C (glibc) if the TZ environment
variable is not set. This file is either a copy of /usr/share/zoneinfo/ file or a symbolic link to it. The UC-8100-LX
does not provide /usr/share/zoneinfo/ files, so you have to copy a time zone information file to the UC-8100-LX
and write over the original local time file.
21BDetermining Available Drive Space
To know the available drive space remaining, use df command with the –h tag. The system will return the
amount of drive space broken down by file system. Check the following example.
moxa@Moxa:~$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 803M 238M 524M 32% /
/dev/root 803M 238M 524M 32% /
tmpfs 25M 188K 25M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 10M 0 10M 0% /dev
22BEnabling and Disabling Daemons
Only the following daemons are enabled in UC-8100-LX by default
sftpd SFTP Server / Client daemon
sshd Secure Shell Server daemon
You may manage what services to run in the background by the command insserv. Below example shows how
to add the apache daemon in current runlevel.
Apache will not activate in current boot session but will be running in the background from next boot session.
To disable the apache daemon, use the following command.
UC-8100-LX Software Getting Started
2-12
YOUR SCRIPT
moxa@Moxa:~$ sudo /etc/init.d/apache2 start
moxa@Moxa:~$ sudo /etc/init.d/apache2 stop
moxa@Moxa:~$ cat /etc/apt/sources.list
deb-src http://ftp.debian.org/debian wheezy-backports main contrib non-free
You can also write your own daemon and start it in the system init stage.
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
Linux daemons can be started or stopped in current boot session by using of the scripts in /etc/init.d. To start
the apache daemon, use:
To stop the apache daemon, use:
In comparison to insserv, scripts in /etc/init.d/ will only start or stop the services in the current boot session.
Once you reboot the UC-8100-LX, it will go back to the default settings which managed by insserv.
23BPackage Management
Most of the software packages will be maintained by Debian community through Debian official apt repository
while the UC-8100-LX-only features will be maintained by Moxa. By adding Moxa repository to
/etc/apt/sources.list will allow you to keep your system up to date with the newest UC-8100-LX packages.
deb http://debian.moxa.com/debian wheezy main
deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb http://ftp.us.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
deb http://ftp.debian.org/debian wheezy-backports main contrib non-free
Following packages will be maintained through Moxa official repository.
Package Name Version Architecture Description
libssl1.0.0:armhf
openssl
uc8100-cellular-utils 1.2.0 armhf
uc8100-diag 1.0.0 armhf Self-diagnostic utility on uc8100 series. uc8100-push-btn 1.0.0 armhf Push button utility on uc8100 series. uc8100-setdef 1.0.0 all Set-to-default utility on uc8100 series.
1.0.1e-2+deb7u1
3+uc8100
1.0.1e-2+deb7u1
3+uc8100
armhf SSL shared libraries
armhf
Secure Socket Layer (SSL) binary and
related cryptographic tools
Cellular driver and related utility on
uc8100 series.
UC-8100-LX Software Getting Started
2-13
moxa@Moxa:~$ sudo reboot –i –f –d
Package Name Version Architecture Description
uc8100-setinterface 1.0.0 all
uc8100-snmpd 5.4.3~dfsg-2.7 armhf
uc8100-system 1.3.0-2 armhf System files in uc8100 uc8100-wifi-utils 1.2.0 armhf WiFi utils on uc8100 series.
24BReboot/Shutdown the UC-8100-LX
To shut down a running Debian GNU/Linux system, you must not reboot with the reset switch on the front or
back of your computer, or just turn off the computer. Debian GNU/Linux should be shut down in a controlled
manner, otherwise files might get lost and/or disk damage might occur. If you run a desktop environment,
there is usually an option to “log out” available from the application menu that allows you to shutdown (or
reboot) the system.
To reboot the UC-8100-LX, use the following command.
Adjust UART mode utility on uc8100
series.
SNMP (Simple Network Management
Protocol) agents
To shut down the UC-8100-LX, use the following command.
moxa@Moxa:~$ sudo shutdown -h "now"
69B
69B
70B
71B
77B
78B
79B
3. 9BAdvanced Configurations on Peripherals
This chapter includes more information on the periperials on UC-8100-LX, such as the serial interface, the
storage, the diagnostic LEDs, and the cellualar module.
The following topics are covered in this chapter:
Serial Ports
Disable the USB Port
26BUSB Port
Disable the USB Port
USB Automount
27BSD and MicroSD Slot
Enabling Write Protection
Error! Reference source not found.
Error! Reference source not found.
Error! Reference source not found.
Cellular Signal Strength
Error! Reference source not found.
Cellular Dial-Up mode
Cellular GPS Port
3
UC-8100-LX Software Advanced Configurations on Peripherals
3-2
UART Port#0 is in RS485-2W Mode
echoctl echoke
moxa@Moxa:~$ sudo stty 115200 -F /dev/ttyM0
25BSerial Ports
UC-8131-LX has 1 serial ports on /dev/ttyM0, while all other UC-8100-LX models has 2 serial ports at
/dec/ttyM0 and /dev/ttyM1. They support RS-232, RS-422, and RS-485 2-wire operation modes with flexible
baudrate settings.
The default operation mode is set to RS-422, you can use setinterface command to change the operation
mode.
Usage: setinterface device-node [interface-no]
Device-node: /dev/ttyMn; n = 0,1,2,...
Interface-no: As in the following table
Interface-no Operation Mode
None Display current setting
0 RS-232
1 RS-485 2-wire
2 RS-422 / RS-485 4-wire
For example, to set /dev/ttyM0 to RS-485 2-wire mode, you may use the following command:
moxa@Moxa:~# sudo setinterface /dev/ttyM0 1
Now setting is RS485-2W mode
moxa@Moxa:~# sudo setinterface /dev/ttyM0
68Bstty
stty command is used to manipulate the terminal settings. You can view and modify the serial terminal settings
with this command. See below for more detail.
Display All Settings
Check the following table for displaying all settings.
moxa@Moxa:~$ sudo stty -a -F /dev/ttyM0
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
Configure Serial Settings
The following example will change the baudrate to 115200.
The baud rate is already switched to 115200.
UC-8100-LX Software Advanced Configurations on Peripherals
3-3
echoctl echoke
Command>>2
Change to ,0 - ON, 1 - OFF (0-1,enter for abort):
Saving Environment to EEPROM...
[60.268951] hub 2-0:1.0: unable to enumerate USB device on port 1
moxa@Moxa:~$ sudo stty -a -F /dev/ttyM0
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
NOTE Click the following link for more information about stty.
http://www.gnu.org/software/coreutils/manual/coreutils.html#stty-invocation
26BUSB Port
The UC-8100-LX series provides a USB slot for storage expansion.
69BDisable the USB Port
USB ports on the UC-8100-LX can be disabled. This must be done via the bootloader. before booting up. To
disable a USB port, follow these steps:
1. After powering on the UC-8100 computer, press <DEL> to enter BIOS configuration setting
----------------------------------------------------------------------------
Boot Loader Version 1.0.0S12 CPU TYPE: 1GHz
Build date: May 7 2014 - 15:55:07 Serial Number: MOXATESTSN01
LAN1 MAC: 00:90:E8:00:00:01 LAN2 MAC: 00:90:E8:00:00:02
----------------------------------------------------------------------------
(0) TPM Setting (1) SD Card Write Protect
(2) Extend USB Port Control (3) Go To OS
---------------------------------------------------------------------------
2. Enter 2 to enter Extend USB Port Control.
Current Extend USB Port is ON.
3. Enter 1 to disable the USB port.
Change to ,0 - ON, 1 - OFF (0-1,enter for abort): 1
3. You need to reboot the UC-8100-LX computer to make the change effective. Also, during boot up, you will
see below message printed on the console indicating you have successfully disabled the USB port.
UC-8100-LX Software Advanced Configurations on Peripherals
3-4
8859-1,shortname=mixed,errors=remount-ro)
t issue
mount the
ATTENTION
No USB devices may be mounted when the port is disabled
Regardless if the usb device is block storage or a dongle, it can not be mounted.
70BUSB Automount
The UC-8100-LX supports hot plug functions for connecting USB mass storage devices. The UC-8100-LX has an
udev automount utility that eases the mount procedure. However, the udev automount utility default only
supports mounting one partition automatically.
//dev/root on / type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=25432k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
/dev/sda1 on /media/usb1 type vfat
(rw,nodev,noexec,noatime,nodiratime,sync,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso
8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=50840k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/sdb1 on /media/usb0 type vfat
(rw,nodev,noexec,noatime,nodiratime,sync,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso
ATTENTION
Remember to type #sync command before you disconnect the USB mass storage device. If you do no
the command, some data may be lost.
Remember to exit the /media/usb* directory when you disconnect the storage device. If you stay in
/media/usb*, the auto un-mount process will fail. If that happens, type #umount /media/usb* to un-
device manually.
27BSD and MicroSD Slot
The SD slot supports SD, SDHC, and SDXC format and is used as the main storage for UC-8100-LX series.
UC-8100-LX comes with a pre-installed 1GB SD card but allows user to use larger capacity SD card up to 64GB
cards.
In UC-8112-LX, an internal Micro SD slot is provided. Depending on which slot you insert a storage media with
a valid boot code, you may have the option to make the SD or MicroSD slot your main storage, and the other
as expansion. In either case, the expansion storage will be automounted to /media/sd-mmcblk1pX with X to be
the partition number.
Read below on how to enable write protection on the SD and Micro SD slot, and on how to prepare a bootable
SD with different capacities.
UC-8100-LX Software Advanced Configurations on Peripherals
3-5
Command>>1
Command>>0
Change to ,0 - Disabled, 1 - Enabled (0-1,enter for abort):
when
71BEnabling Write Protection
The SD slot does not support the write protection dip switch on SD cards or MicroSD-SD converter. However,
it can be configured to read-only through bootloader. Micro SD slot can also be configured to read-only through
bootloader too. Follow below steps to learn how to enable write protection on these slots.
1. Press <DEL> To Enter BIOS configuration Setting after powering on the device
2. Select (1) SD Card Write Protect.
----------------------------------------------------------------------------
Boot Loader Version 1.0.0S12 CPU TYPE: 1GHz
Build date: May 7 2014 - 15:55:07 Serial Number: MOXATESTSN01
LAN1 MAC: 00:90:E8:00:00:01 LAN2 MAC: 00:90:E8:00:00:02
----------------------------------------------------------------------------
(0) TPM Setting (1) SD Card Write Protect
(2) Extend USB Port Control
---------------------------------------------------------------------------
3. Select on which storage you would like to configure write protection on.
----------------------------------------------------------------------------
Boot Loader Version 1.0.0S12 CPU TYPE: 1GHz
Build date: May 7 2014 - 15:55:07 Serial Number: MOXATESTSN01
LAN1 MAC: 00:90:E8:00:00:01 LAN2 MAC: 00:90:E8:00:00:02
----------------------------------------------------------------------------
(0) Boot Storage Write Protect (1) Extend Storage Write Protect
---------------------------------------------------------------------------
4. You will first see the current write protection status on the storage, and then you may select Enable or
Disable write protect function.
Current Boot Storage Write Protect is Disabled.
Above steps will mount the partitons on the storage to read-only after booting up. You may alther the read-only
status in the OS by remounting the partitions. The command to use is mount. For example, to mount root
directory to be read-writable, use mount –o remount,rw /, and when you don’t need to write in the root
directory, use umount to make it read-only again.
ATTENTION
If you create your own bootable SD or MicroSD card, please do not set the boot storage to be read-only
the system is booted up for the first time. The system is required to configure itself with read-writeable mode
on the first boot. You may set up write protection after the first boot.
28BPreparing a Bootable SD Card
If you want to use SD card with greater capacity or upgrade UC-8100 firmware, you can download the latest
UC-8100-LX image from Moxa official website and prepare a bootable SD card by yourself.
You can to download the image file to a eith Windows or Linux PC, and then transfer the file to SD card. Please
refer to the following tutorial.
UC-8100-LX Software Advanced Configurations on Peripherals
3-6
72BCreating a Linux System Image using a Windows Platform
For Windows users, follow these steps.
1. Make sure the write protection switch of the SD card is unlocked.
2. Insert the SD card into a Windows PC.
3. Download win32diskimager from following link.
http://sourceforge.net/projects/win32diskimager/
4. Execute the win32diskimager after installation
5. Make sure the device name is match with the USB device.
6. Select the image file.
UC-8100-LX Software Advanced Configurations on Peripherals
3-7
7. Make sure you have selected the correct image file. Click Write button.
8. When finished, click OK.
73BCreating a System Image in a Linux Environment
For Linux users, follow these steps.
1. Make sure the write protection switch of the SD card is unlocked.
2. Insert the SD card into a Linux PC.
3. Use dmesg command to find out the device node.
4. Use dd command to configure the UC-8100-LX image on the SD card.
root@Lock-Lin:/home/work# sudo dd if=./140
42420.img of=/dev/sdd
bs=512k
1954+0 records in
1954+0 records out
1024458752 bytes (1.0 GB) copied, 119.572 s, 8.6 MB/s
UC-8100-LX Software Advanced Configurations on Peripherals
3-8
NOTE Click the following links for more information on the dd command.
http://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html
29BBooting Up the UC-8100-LX for the first time
It is suggested to use the serial console to log in for the first time. Please refer to the Hardware Manual to see
how to connect serial console.
74BFile system resizing
Connect the UC-8100-LX to 12-24 VDC power source and the computer will immediately boot up. The power
LED will be lit up first and then the SD Card LED. You will see messages printing out from the serial console too.
Upon the first boot up, you will notice the he root filesystem is being resized and initialized with below message
notification.
This can take a few minutes and the actual time required of this procedure will depend on the capacity of the
SD card. The diagnostic LED indicators are activated as indicated in below table during resizing. Please wait
patiently until the diagnostic LEDs are put out.
System Status Diagnostic LED
RED YELLOW GREEN
Expanding root filesystem Off Blink On
75BBooting from a MicroSD Card (UC-8112 Model Only)
The default boot up device of UC-8100-LX Series is the SD card. However, since the UC-8112-LX model
provides the option to put the image on the internal MircoSD card, the UC-8112-LX will boot up from the
MicroSD slot if no boot up code is found from SD card slot.
30BThe Push Button and the LED indicators
The push button is used to diagnose device failure or to perform firmware restoration. Be alert to the
indications to release the button so you can enter the correct mode to either diagnose your device or to restore
your device back to default. See the figure and description for the indications.
Release the button during
Button pressed
RED LED
this time to diagnose
device failure
GREEN LED
RED LED
Release the button during this
time to perform restoration
GREEN LED
NO ACTION
Blinking
0 2 4 7 8
On
Blinking
On
Time (s)
Loading...
+ 63 hidden pages