第5章 Operational Checks

5.1. Before Performing the Operational Checks

There is a possibility that the image file written to the Flash memory in the factory default state is not the latest version. The latest image file can be downloaded from the Armadillo site. It is recommended to write the latest image file first.

For details on rewriting the image file, see 8章Rewriting Image Files.

5.2. Network

The following explains about network configuration and applications that use the network.

5.2.1. Supported Networks

Armadillo-IoT can connect to multiple types of networks. The available network types and their corresponding network device names used in Linux is shown below.

表5.1 Networks and Network Devices

NetworkNetwork DeviceNotes
Wired LANeth0 
Wireless LANwlan0AEH-AR9462
3G/LTEttyUSB2Quectel EC25

5.2.2. Network Configuration

On Armadillo-IoT Gateway G3, NetworkManager is used to configure network interfaces just like as with other standard Linux systems. By default NetworkManager automatically ups eth0 (Ethernet) and obtains network configuration with DHCP.

NetworkManager manages all network settings as connections. Connections describe "How to connect to the network" and "How to create the network" and are saved in /etc/NetworkManager/system-connections/. Also, while it is possible to save multiple connections for each device, only one connection can be activated at one time.

While NetworkManager also supports configuration using the traditional /etc/network/interfaces file, this document focuses on the use of nmcli.

5.2.2.1. About nmcli

nmcli is a command line tool for operating NetworkManager.

The format for nmcli is shown in 図5.1「nmcli Command Format」. From this, it can be seen that nmcli commands are entered with a format based on objects (OBJECT) and executing commands (COMMAND) on those objects. It's also possible to see that each object has help associated with it.

nmcli [ OPTIONS ] OBJECT { COMMAND | help }

図5.1 nmcli Command Format


See man nmcli for more information on each object.

[注記]

In addition to nmcli, the user-friendly nmtui is also installed on Armadillo-IoT, but it is not covered in this document.

5.2.3. Basic Usage of nmcli

This section explains the basic usage of the nmcli.

5.2.3.1. List of Connections

To check the list of registered connections, run the following command.[12]

[armadillo ~]# nmcli connection
NAME                UUID                                  TYPE            DEVICE
Wired connection 1  64e2e184-ede4-4cc6-ab70-0713d7cb0f0b  802-3-ethernet  eth0

図5.2 List of Connections


NAME is also can be used as [ID].

5.2.3.2. Enabling and Disabling Connections

To enable a connection, run the following command.

[armadillo ~]# nmcli connection up [ID]

図5.3 Enabling a Connection


To disable a connection, run the following command.

[armadillo ~]# nmcli connection down [ID]

図5.4 Disabling a Connection


5.2.3.3. Creating a Connection

To create a connection, run the following command.

[armadillo ~]# nmcli connection add con-name [ID] \
type [type] ifname [interface name]

図5.5 Creating a Connection


Enter the connection name (arbitary) for [ID], ethernet or wifi for [type], and interface name (device) for [interface name]. The specific connection creation method is explained in the chapter for each device.

[注記]

A connection file is created with the name [ID] under /etc/NetworkManager/system-connections/. It is also possible to edit this with vi to modify the connection.

5.2.3.4. Deleting a Connection

To delete a connection, run the following command.

[armadillo ~]# nmcli connection delete [ID]

図5.6 Deleting a Connection


[注記]

The connection file under /etc/NetworkManager/system-connections/> is also deleted at the same time.

5.2.3.5. Modifying a Connection

The following introduces specific ways to modify connections.

[ティップ]

When wireless LAN or 3G/LTE configuration is edited with the nmcli connection modify command, the passphrase information is reset. When making the edits, please also set a passphrase at the same time.

For details on how to set a passphrase for wireless LAN, see 「Wireless LAN」.

For setting a passphrase for 3G/LTE, refer to 「Notes on Altering 3G/LTE Connection Settings」.

[警告]

Please consult a network administrator for help with network connections.

5.2.3.5.1. Using a Static Address

An example of setting the content of 表5.2「Static IP Address Configuration Example」 is shown in 図5.7「Static IP Address Configuration」.

表5.2 Static IP Address Configuration Example

ItemConfiguration
IP Address192.0.2.10
Mask Length24
Default Gateway192.0.2.1

[armadillo ~]# nmcli connection modify [ID] \
ipv4.method manual ipv4.addresses 192.0.2.10/24 ipv4.gateway 192.0.2.1

図5.7 Static IP Address Configuration


5.2.3.5.2. Specifying a DNS Server

An example of specifying a DNS server is shown in 図5.8「Specifying a DNS Server」.

[armadillo ~]# nmcli connection modify [ID] ipv4.dns 192.0.2.1

図5.8 Specifying a DNS Server


5.2.3.5.3. Using DHCP

An example of a DHCP configuration is shown in 図5.9「DHCP Configuration」.

[armadillo ~]# nmcli connection modify [ID]\
ipv4.method auto

図5.9 DHCP Configuration


[注記]

As like with -ipv4.addresses, a set property can be deleted by adding '-' to the beginning of the property name. Conversely, a property can be added by specifying '+'.

5.2.3.6. Applying Connection Modifications

When having modified a currently enabled connection, make sure to re-enable the connection.

[armadillo ~]# nmcli connection down [ID]
[armadillo ~]# nmcli connection up [ID]

図5.10 Applying Connection Modifications


5.2.3.7. List of Devices

To check the device list (device name, type, status, valid connection), run the following command.[13]

[armadillo ~]# nmcli device
DEVICE    TYPE      STATE         CONNECTION
eth0      ethernet  connected     Wired connection 1
[wwan]    gsm       disconnected  --
wlan0     wifi      disconnected  --
gre0      gre       unmanaged     --
gretap0   gretap    unmanaged     --
ip6gre0   ip6gre    unmanaged     --
ip6tnl0   ip6tnl    unmanaged     --
tunl0     ipip      unmanaged     --
lo        loopback  unmanaged     --
sit0      sit       unmanaged     --
ip6_vti0  vti6      unmanaged     --

図5.11 List of Devices


5.2.3.8. Connecting Devices

To connect a device, run the following command.

[armadillo ~]# nmcli device connect [ifname]

図5.12 Connecting Devices


[注記]

To connect a device, a valid connection for the device is required. If the message "Error: neither a valid connection nor device given" is displayed, check if a valid connection exists by, for example, using the nmcli connection command.

5.2.3.9. Disconnecting Devices

To disconnect a device, run the following command.

[armadillo ~]# nmcli device disconnect [ifname]

図5.13 Disconnecting Devices


5.2.4. Wired LAN

This section explains how to use wired LAN.

5.2.4.1. Creating a Wired LAN Interface (eth0) Connection

To create for a wired LAN interface connection, run the following command.

[armadillo ~]# nmcli connection add type ethernet ifname eth0
Connection 'ethernet-eth0' (ac491d33-9647-4096-8b91-5c7abcf5850d) successfully added.

図5.14 Creating a Wired LAN Interface (eth0) Connection


5.2.4.2. Changing the Network Settings of Wired LAN

For configuring the network, see 「Modifying a Connection」.After modifying the connection, make sure to apply the modifications by referring to 「Applying Connection Modifications」.

5.2.4.3. Confirming a Wired LAN Connection

Confirm that normal communication is possible on the wired LAN. If the configuration has changed, be sure to re-enable the interface.

Perform a PING with another network device on the same network. In the following example, it is assumed that the network device has an IP address of "192.0.2.20".

[armadillo ~]# ping 192.0.2.20

図5.15 Ping Confirmation of Wired LAN


[注記]

If any connections other than wired LAN are enabled, the wired LAN may not be used for network communication. In order to ensure that the wired LAN connection is used for the confirmation, disable the other connections in advance.

5.2.5. Wireless LAN

This section explains how to use the wireless LAN module installed on Armadillo-IoT.

As an example, connect to a WPA2-PSK(AES) access point. For details on how to connect to access points other than WPA2-PSK(AES), please refer to man nm-settings. In the explanation below, the ESSID of the access point is shown as [essid] and the passphrase as [passphrase].

5.2.5.1. Connecting to a Wireless LAN Access Point

To connect to a wireless LAN access point, run the following command.

[armadillo ~]# nmcli device wifi connect [essid] password [passphrase]

図5.16 Connecting to a Wireless LAN Access Point


[警告]

Depending on the access point being connected to, the following message may be displayed and you may not be able to connect to the access point.

wlan0: authenticate with 00:3a:9d:42:cc:92
wlan0: send auth to 00:3a:9d:42:cc:92 (try 1/3)
wlan0: authenticated
wlan0: associate with 00:3a:9d:42:cc:92 (try 1/3)
wlan0: RX AssocResp from 00:3a:9d:42:cc:92 (capab=0x431 status=0 aid=1)
wlan0: associated
cfg80211: Calling CRDA to update world regulatory domain
cfg80211: World regulatory domain updated:
cfg80211:  DFS Master region: unset
cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm)
cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm)
cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm)
cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
cfg80211: Calling CRDA for country: JP
cfg80211: Regulatory domain changed to country: JP
cfg80211:  DFS Master region: JP
cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
cfg80211:   (4910000 KHz - 4990000 KHz @ 40000 KHz), (N/A, 2300 mBm)
cfg80211:   (5030000 KHz - 5090000 KHz @ 40000 KHz), (N/A, 2300 mBm)
cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm)
cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2300 mBm)

5.2.5.2. Changing Wireless Network Settings

For configuring the network, refer to 「Modifying a Connection」. When repairing the connection, please refer to 図5.16「Connecting to a Wireless LAN Access Point」 aand set it up with passphrase. After making the modifications, make sure to apply them by referring to 「Applying Connection Modifications」.

5.2.5.3. Confirming Wireless LAN Connection

Confirm that it is possible to communicate properly over wireless LAN.

Perform a PING with another network device on the same network. In the following example, it is assumed that the network device has an IP address of "192.0.2.20".

[armadillo ~]# ping 192.0.2.20

図5.17 Ping Confirmation of Wireless LAN


[注記]

If any connections other than wireless LAN are enabled, the wireless LAN may not be used for network communication. In order to ensure that the wireless LAN connection is used for the confirmation, disable the other connections in advance.

5.2.6. 3G/LTE

The following explains how to use the 3G/LTE module installed in Armadillo-IoT.

5.2.6.1. Before Configuring 3G/LTE Data Communication

In order to use 3G/LTE data communication a contract with a telecommunications carrier is needed. Prepare the MicroSIM (UIM card) and APN information provided by the carrier at the time of contract.

[警告]

Make sure that the Armadillo-IoT is powered off before installing the MicroSIM (UIM card).

[警告]

This product has a MicroSIM slot.

Using a NanoSIM card with a SIM adapter or using a standard size SIM card cut to MicroSIM size may cause damaged to the MicroSIM slot. If this product is broken by using cards in this way it will not be covered by warranty even within the warranty period.

Insert the microSIM (UIM card) with its notch facing the direction opposite to that of insertion and with the marked side facing up.

microSIM

図5.18 microSIM


Installing MicroSIM

図5.19 Installing MicroSIM


The following information is necessary to configure the APN.

  • APN

  • Username

  • Password

  • Authentication method (PAP or CHAP)

  • PDP Type (only IP is supported)

5.2.6.2. Creating a 3G/LTE Connection

An example of setting the content of 表5.3「APN Information Configuration Example」 is shown in 図5.20「Creating a 3G/LTE Connection」.

表5.3 APN Information Configuration Example

ItemConfiguration
APN[apn]
Username[user]
Password[password]
Network Device[wwan]

Please replace network device name [wwan] reference to 表5.4「Cellular module network device」.

表5.4 Cellular module network device

Cellular moduleNetwork Device
Quectel EC25ttyUSB2

[armadillo ~]# nmcli connection add type gsm \
ifname [wwan] apn [apn] user [user] password [password]
Connection 'gsm-[wwan]' (a9e51a2d-bbee-443f-80ba-07b65c3097e8) successfully added.

図5.20 Creating a 3G/LTE Connection


After creating the connection, the data connection will be done automatically at startup.

5.2.6.3. Establishing a 3G/LTE Data Connection

To establish a data connection without rebooting immediately after creating the 3G/LTE connection or changing its settings, execute the command shown in 図5.21「3G/LTE Data Connection」.

[armadillo ~]# nmcli connection up gsm-[wwan]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

図5.21 3G/LTE Data Connection


5.2.6.4. Confirming a 3G/LTE Connection

Confirm that it is possible to communicate properly over 3G/LTE.

Perform a PING with Atmark Techno's web server. If an internet connection is not available because of the use of a VPN connection and so on, please use a network device on the local network instead.

[armadillo ~]# ping www.atmark-techno.com

図5.22 Ping Confirmation of 3G/LTE


[注記]

If any connections other than 3G/LTE are enabled, 3G may not be used for network communication. In order to ensure that the 3G connection is used for the confirmation, disable the other connections in advance.

5.2.6.4.1. Ending a 3G/LTE Data Connection

Terminate the 3G/LTE reconnection service before terminating the data communication with the nmcli command. If data communication is terminated without terminating the 3G/LTE reconnection service, the data connection will be restarted by that service.

Stop the 3G/LTE reconnection service, and then end the data communication.

[armadillo ~]# systemctl stop connection-recover.service
[armadillo ~]# nmcli connection down gsm-[wwan]

図5.23 Ending Data Communication


5.2.6.4.2. Restarting a 3G/LTE Data Connection

Start the data communication.

[armadillo ~]# nmcli connection up gsm-[wwan]
[armadillo ~]# systemctl start connection-recover.service

図5.24 Starting Data Communication


5.2.6.4.3. Notes on Altering 3G/LTE Connection Settings

When wireless LAN or 3G/LTE configuration is edited with the nmcli connection modify command, the password information is reset. Execute the following command to set the password again each time.

[armadillo ~]# nmcli connection modify gsm-[wwan] gsm.password [password]

図5.25 Setting a 3G/LTE Passphrase with the nmcli connection modify Command


5.2.6.5. 3G/LTE Reconnection Service

The 3G/LTE reconnection service periodically monitors the status of the 3G/LTE data connection and reconnects it when disconnection is detected.

5.2.6.5.1. Service Specifications

When a MicroSIM is inserted and a valid NetworkManager 3G/LTE connection has been configured, it monitors the state of the connection once every 120 seconds.

If the connection is disabled it is judged to be in a disconnected state and the connection is enabled. If the connection is enabled, a PING is executed to a specific destination. If the PING results in an error, it is judged to be in the disconnected state, and reconnection is performed by disabling and enabling the connection.

If reconnection by disabling and enabling the connection fails more than once, it is judged that the 3G/LTE module is not operating normally and the power supply of the 3G/LTE module is cycled off and on on order to reconnect.

5.2.6.5.2. Factory Settings

It is enabled in the default factory state, and the service starts automatically at system startup. The ping destination is "8.8.8.8" by default. Please change the configuration file (/etc/connection-recover/gsm-[wwan]_connection-recover.conf) appropriately for your environment.

5.2.6.5.3. Stop and Start

To stop the 3G/LTE reconnection service, run the following command.

[armadillo ~]# systemctl stop connection-recover.service

図5.26 Stopping the 3G/LTE Reconnection Service


To start the 3G/LTE reconnection script, run the following command.

[armadillo ~]# systemctl start connection-recover.service

図5.27 Starting the 3G/LTE Reconnection Service


5.2.6.6. ModemManager

ModemMamager and mmcli are explained here.

Apart from NetworkManager which manages the network, ModemManager which manages the modem is installed on Armadillo-IoT. ModemManager operates mobile broadband devices (such as 3G/LTE modules) and manages their connection status.

By using the mmcli command line tool of ModemManager, it is possible to acquire the 3G/LTE communication signal strength and SIM card information (telephone number, IMEI etc). Please refer to man mmcli for usage details of mmcli.

5.2.6.6.1. Obtaining a List of Recognized Modems

To obtain a list of recognized modems, run the following command.

[armadillo ~]# mmcli -L

Found 1 modems:
        /org/freedesktop/ModemManager1/Modem/0 [Quectel] EC25

図5.28 Obtaining a List of Recognized Modems


5.2.6.6.2. Obtaining Modem Information

To obtain the status of the modem, run the following command.

[armadillo ~]# mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id 'a0b218d267ac0fecdf7b27d61e3308b8f8c7e148')
  -------------------------
  Hardware |   manufacturer: 'XXXXXXX'
           |          model: 'XXXXXXX'
           |       revision: 'XXXXXXXXXXXXXXXX'

(省略)

図5.29 Obtaining Modem Information


[ティップ]

In order to obtain modem information a MicroSIM must be inserted. Please make sure a MicroSIM is correctly inserted.

5.2.6.6.3. Obtaining MicroSIM Information

To obtain MicroSIM information, run the following command.

[armadillo ~]# mmcli -m 0
(abbreviated)
-------------------------
SIM      |           path: '/org/freedesktop/ModemManager1/SIM/[number]' # [number] is used in the next command
(abbreviated)
[armadillo ~]# mmcli -i [number]
SIM '/org/freedesktop/ModemManager1/SIM/0'
  -------------------------
  Properties |          imsi : 'XXXXXXXXXXXXXXX'
             |            id : 'XXXXXXXXXXXXXXXXXXX'
             |   operator id : 'XXXXX'
             | operator name : 'XXXXXXXXXX'

図5.30 Obtaining MicroSIM Information


5.2.6.6.4. Obtaining Communication Line Information

To obtain communication line information, run the following command.

[armadillo ~]# mmcli -m 0
(省略)
-------------------------
Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/[number]' # [number]を次のコマンドで指定
[armadillo ~]# mmcli -b [number]
Bearer '/org/freedesktop/ModemManager1/Bearer/0'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: '[wwan]'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'XXXXXXXXXX'
                     |     roaming: 'allowed'
                     |     IP type: 'none'
                     |        user: 'XXXX'
                     |    password: 'XXXX'
                     |      number: '*99#'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'ppp'
                     |  address: 'unknown'
                     |   prefix: '0'
                     |  gateway: 'unknown'
                     |      DNS: none
  -------------------------
  IPv6 configuration |   method: 'unknown'

図5.31 Obtaining Communication Line Information


5.2.7. Configuration Example with NetworkManager

The following introduces a configuration example with NetworkManager based on 図5.32「Network Structure Diagram」.

Network Structure Diagram

図5.32 Network Structure Diagram


表5.5 Network Address Information

Node NameNetwork DeviceIP AddressNetwork Address
Armadilloeth0192.168.0.2192.168.0.0/24
wlan0172.16.xxx.xxx[a]172.16.0.0/16[a]
[wwan][b]xxx.xxx.xxx.xxx[a]xxx.xxx.xxx.xxx[a]
Routereth0192.168.0.1192.168.0.0/24
eth1192.168.10.1192.168.10.0/24
Servereth0192.168.10.2192.168.10.0/24
Access Pointeth0172.16.0.1172.16.0.0/16

[a] Automatically acquired with DHCP

[b] The network device of the 3G/LTE Module


5.2.7.1. Network Configuration Procedure

The network setup procedure when configuring the network shown in 図5.32「Network Structure Diagram」 is as follows. Note that the created connection is saved in /etc/NetworkManager/system-connections/ and is activated even after restarting Armadillo.

手順5.1 Network Configuration Procedure

  1. Make sure that the state of eth0, [wwan] and wlan0 is disconnected.

    [armadillo ~]#nmcli device
    DEVICE    TYPE      STATE         CONNECTION
    eth0      ethernet  disconnected  --
    [wwan]   gsm       disconnected  --
    wlan0     wifi      disconnected  --
    gre0      gre       unmanaged     --
    gretap0   gretap    unmanaged     --
    ip6gre0   ip6gre    unmanaged     --
    ip6tnl0   ip6tnl    unmanaged     --
    tunl0     ipip      unmanaged     --
    lo        loopback  unmanaged     --
    sit0      sit       unmanaged     --
    ip6_vti0  vti6      unmanaged     --

    If any are in a state other than disconnected, change each to the disconnected state by following 表5.6「Making the Device State disconnected」.

    表5.6 Making the Device State disconnected

    Device StateProcedure
    unmanagedCheck that the device settings are not included in /etc/network/interfaces. Remove them if they are.
    unavailableCheck that the LAN cable is not disconnected. Connect the cable if it is.
    connectingA connection using the device is being enabled. Disable it by referring to 図5.4「Disabling a Connection」.
    connectedA connection using the device is enabled. Disable it by referring to 図5.4「Disabling a Connection」.

  2. Configure the wireless LAN (wlan0).

    [armadillo ~]#nmcli connection add type wifi ifname wlan0 ssid [essid]  1
    [armadillo ~]#nmcli connection modify wifi-wlan0 ipv4.never-default yes  2
    [armadillo ~]#nmcli connection modify wifi-wlan0 \
    802-11-wireless-security.key-mgmt wpa-psk \
    802-11-wireless-security.psk [passphrase]  3
    [armadillo ~]#nmcli connection down wifi-wlan0  4
    [armadillo ~]#nmcli connection up wifi-wlan0  5

    1

    Create the wireless LAN (wlan0) connection.

    2

    Disable the default gateway of the connection of wireless LAN (wlan0) connection.

    3

    Set the encryption key management method to wpa-psk and set a passphrase.

    4

    In order to apply the changes, first disable wireless LAN (wlan0) connection.

    5

    Enable the wireless LAN (wlan0) connection.

  3. Configure the wired LAN interface (eth0).

    [armadillo ~]#nmcli connection add type ethernet ifname eth0  1
    [armadillo ~]#nmcli connection modify ethernet-eth0 ipv4.method manual \
    ipv4.addresses "192.168.0.2/24"  2
    [armadillo ~]#nmcli connection modify ethernet-eth0 \
    ipv4.routes "192.168.10.0/24 192.168.0.1"  3
    
    [armadillo ~]#nmcli connection modify ethernet-eth0 ipv4.never-default yes  4
    [armadillo ~]#nmcli connection down ethernet-eth0  5
    [armadillo ~]#nmcli connection up ethernet-eth0  6

    1

    Create the wired LAN interface (eth0) connection.

    2

    Specify a static IP address for the wired LAN interface (eth0) connection.

    3

    Add the routing information to the wired LAN interface (eth0) connection.

    4

    Disable the default gateway of the wired LAN interface (eth0) connection.

    5

    In order to apply the changes, first disable the wired LAN (eth0) connection.

    6

    Enable the wired LAN (eth0) connection.

  4. Configure 3G/LTE

    [armadillo ~]#nmcli connection add type gsm ifname [wwan] apn [apn] user [user] password [password]  1
                

    1

    Create the 3G/LTE(ttyUSB2) connection.

  5. Make sure that the state of eth0, [wwan], ppp0 and wlan0 is connected.

    [armadillo ~]#nmcli device
    DEVICE    TYPE      STATE      CONNECTION
    eth0      ethernet  connected  ethernet-eth0
    [wwan]    gsm       connected  gsm-[wwan]
    ppp0      unknown   connected  ppp0
    wlan0     wifi      connected  wifi-wlan0
    gre0      gre       unmanaged  --
    gretap0   gretap    unmanaged  --
    ip6gre0   ip6gre    unmanaged  --
    ip6tnl0   ip6tnl    unmanaged  --
    tunl0     ipip      unmanaged  --
    lo        loopback  unmanaged  --
    sit0      sit       unmanaged  --
    ip6_vti0  vti6      unmanaged  --
  6. Check the routing table.

    [armadillo ~]#route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    default         xxx.xxx.xxx.xxx 0.0.0.0         UG    1024   0        0 ppp0
    link-local      *               255.255.0.0     U     1000   0        0 wlan0
    172.16.0.0      *               255.255.0.0     U     0      0        0 wlan0
    192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
    192.168.10.0    192.168.0.1     255.255.255.0   UG    1      0        0 eth0

5.2.8. Firewall

A simple firewall is active on Armadillo. To display its configuration content execute the command shown in 図5.33「iptables」.

[armadillo ~]# iptables --list

図5.33 iptables


5.2.9. Network Applications

The following explains about the network applications that can be used in the factory default image.

[注記]

It is assumed that the network configuration of ATDE and Armadillo is the default state. If the network configuration has been modified please adjust for that as needed.

5.2.9.1. HTTP Server

An HTTP server is active on Armadillo. When accessing the URL of Armadillo (http://[IP address of Armadillo]/) from a web browser on a PC such as ATDE, the top page (index.html) of lighttpd is displayed.

Armadillo Top Page

図5.34 Armadillo Top Page


5.3. Storage

The following devices are available for use as storage on Armadillo-IoT.

表5.7 Storage Devices

Device TypeDisk DeviceFirst PartitionInterfaces
SD/SDHC/SDXC Cards/dev/mmcblk*[a]/dev/mmcblk*p1SD Interface (CON4)
USB Flash Memory/dev/sd*[b]/dev/sd*1USB Host Interface (CON7)

[a] When microSD/microSDHC/microSDXC cards are connected, they are labeled as mmcblk0, then mmcblk1 and so on in the order that they are detected.

[b] When connecting multiple USB memory devices using a USB hub, they are labeled as sda, then sdb and so on in the order that they are detected.


5.3.1. Using Storage

The following explains how to use storage by using an SDHC card as an example.SD/SDHC/SDXC cards are referred to as SD cards wherever the operations can be applied to any of them.

[ティップ]

When using an SDXC/microSDXC card, it is necessary to format it in advance by referring to 「Changing and Formatting Storage Partitions」. This is because the Linux kernel cannot handle the exFAT file system. Normally, SDXC/microSDXC cards which have just been purchased are formatted with the exFAT file system.

On Linux all accessible files and directories are brought together in one tree structure. Adding the file system of a storage device to this tree structure is called mounting. The mount command used to perform this mounting.

The typical format of the mount command is as follows.

mount [-t fstype] device dir

図5.35 mount Command Format


The file system type is specified for fstype following the -t option[14]. For the FAT32 file system use vfat[15], and for the EXT4 file system use ext4.

The device filename of the storage device is specified for device. For partition one of the SD card this will be /dev/mmcblk0p1 and for partition two it will be /dev/mmcblk0p2.

The directory where the file system on the storage device is to be mounted is specified for dir.

With the SDHC card inserted in the SD slot, execute the command shown in 図5.36「Mounting Storage」 to mount the SDHC card file system on the /mnt directory. Files in the SD card become visible under the /mnt directory.

[armadillo ~]# mount -t vfat /dev/mmcblk0p1 /mnt

図5.36 Mounting Storage


In order to safely remove storage it must be unmounted. The umount command is used to perform the unmounting. The directory where the device to unmount is mounted is specified as its option.

[armadillo ~]# umount /mnt

図5.37 Unmounting Storage


5.3.2. Changing and Formatting Storage Partitions

Normally, SDHC cards and USB memory just purchased have one partition and are formatted with the FAT32 file system.

If you want to change the partition configuration, use the fdisk command. An example of using the fdisk command to divide the partition of an SD card configured with just that one partition into two partitions is shown in 図5.38「Altering Partitions with the fdisk Command」. After deleting the existing partition, two new primary partitions are created. 100Mbyte is allocated to the first partition and the remaining capacity to the second partition. The first partition becomes /dev/mmcblk0p1 and the second /dev/mmcblk0p2. For details on how to use the fdisk command, please refer to the man page etc.

[armadillo ~]# fdisk /dev/mmcblk0

The number of cylinders for this disk is set to 62528.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-62528, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-62528, default 62528): +100M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (3054-62528, default 3054):
Using default value 3054
Last cylinder or +size or +sizeM or +sizeK (3054-62528, default 62528):
Using default value 62528

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
 mmcblk0: p1 p2
 mmcblk0: p1 p2
Syncing disks.

図5.38 Altering Partitions with the fdisk Command


To format a storage device with the FAT32 file system, use the mkfs.vfat command. Likewise, for EXT3 use the mkfs.ext3 command and for EXT4 use the mkfs.ext 4 command. The command example for formatting partition one of the SD card with the EXT4 file system is shown below.

[armadillo ~]# mkfs.ext4 /dev/mmcblk0p1

図5.39 Creating a EXT4 File System


5.4. LED

As the Armadillo-IoT's LEDs are connected to GPIO they can be controlled in software.

As the device driver is implemented as an LED class, the LEDs can be controlled with files under the LED class directory. The LED class directories and their corresponding LEDs are shown below.

表5.8 LEDs and LED Class Directories

LED Class DirectoryInterfacesDefault Trigger
/sys/class/leds/led1/User LED1default-on
/sys/class/leds/led2/User LED2default-on
/sys/class/leds/led3/User LED3none
/sys/class/leds/led4/User LED4none

The locations of the user LEDs seen from the exterior of Armadillo-IoT are shown below.

User LEDs Location

図5.40 User LEDs Location


In the following explanation, the LED class directory representing an arbitrary LED is written as /sys/class/leds/[LED].

5.4.1. Activating and Deactivating LEDs

An LED can be turned on and off by writing a value to the brightness file under the LED class directory. Valid values to write to brightness are between 0 and 255.

Writing a value other than 0 to brightness turns the LED on.

[armadillo ~]# echo 1 > /sys/class/leds/[LED]/brightness

図5.41 Turning on an LED


[ティップ]

Since the LEDs on Armadillo-IoT do not have brightness control functionality only two states, 0 (off) and 1-255 (on), can be specified.

Writing 0 to brightness turns the LED off.

[armadillo ~]# echo 0 > /sys/class/leds/[LED]/brightness

図5.42 Turning off an LED


The state of an LED can be obtained by reading brightness.

[armadillo ~]# cat /sys/class/leds/[LED]/brightness
0

図5.43 Displaying the State of an LED


5.4.2. Using Triggers

A trigger to turn an LED on and off can be set by writing a value to the trigger file under the LED class directory. Valid values to write to the trigger file are shown below.

表5.9 trigger Types

ConfigurationDescription
noneNo trigger is set.
mmc0Act as the SD Interface (CON4) access lamp.
mmc2Act as the eMMC access lamp.
timerBlink on and off at certain intervals. After setting this trigger, delay_on and delay_off files appear under the LED class directory which can be used to set the on and off times in millisecond increments.
heartbeatBlink on and off like a heart beat.
default-onUsed mainly from the Linux kernel. The LED will turn on.

When the following command is run, the LED will repeatedly turn on for two seconds and off for one second.

[armadillo ~]# echo timer > /sys/class/leds/[LED]/trigger
[armadillo ~]# echo 2000 > /sys/class/leds/[LED]/delay_on
[armadillo ~]# echo 1000 > /sys/class/leds/[LED]/delay_off

図5.44 Specifying timer for the LED Trigger


The current trigger of the LED can be obtained by reading the trigger file. The value enclosed in [] is the current trigger.

[armadillo ~]# cat /sys/class/leds/[LED]/trigger
[none] rc-feedback nand-disk mmc0 mmc2 timer oneshot heartbeat backlight gpio de
fault-on rfkill0 phy0rx phy0tx phy0assoc phy0radio phy0tpt rfkill1

図5.45 Displaying the LED Trigger


5.5. RTC

Armadillo-IoT uses the RTC functionality of the Board Management IC.

To retain the time even if the power is turned off, an external battery (for example: CR1220) can be connected to the RTC backup interface (CON13).

5.5.1. Setting the Time on the RTC

There are two types of time on Linux: the system clock managed by the Linux kernel and the hardware clock managed by the RTC. In order to set the time in the RTC, first set the system clock. Following that, make the hardware clock match the system clock.

The system clock is set using the date command. For the date command argument, specify the time to be set in the format [MMDDhhmmCCYY.ss]. The meaning of each field of the time format is as follows.

表5.10 Time Format Fields

FieldMeaning
MMMonths
DDDays (in month)
hhHours
mmMinutes
CCFirst two digits of the year (optional)
YYLast two digits of the year (optional)
ssSeconds (optional)

An example of setting it to 12:34:56 on June 2, 2015 is shown below.

[armadillo ~]#date 1
Sat Jan  1 09:00:00 JST 2000
[armadillo ~]#date 060212342015.56 2
Tue Jun  2 12:34:56 JST 2015
[armadillo ~]#date 3
Tue Jun  2 12:34:57 JST 2015

1

Display the current system clock.

2

Set the system clock.

3

Confirm that the system clock has been set correctly.

図5.46 Setting System Clock


[ティップ]

If there is a time server on the network to which Armadillo-IoT is connected, the system clock can be set using the NTP (Network Time Protocol) client.

[armadillo ~]#ntpdate [NTP SERVER]
14 Jun 10:03:23 ntpdate[2176]: adjust time server x.x.x.x offset 0.002323 sec
[armadillo ~]#date
Thu Jun 14 10:03:35 UTC 2018

The time zone can be changed with the timedatectl command.

[armadillo ~]#date
Thu Jun 14 10:03:35 UTC 2018
[armadillo ~]#timedatectl set-timezone Asia/Tokyo
[armadillo ~]#date
Thu Jun 14 19:04:19 JST 2018

After setting the system clock, use the hwclock command to set the hardware clock.

[armadillo ~]#hwclock 1
Sat Jan  1 00:00:00 2000  0.000000 seconds
[armadillo ~]#hwclock --utc --systohc 2
[armadillo ~]#hwclock --utc 3
Tue Jun  2 12:35:08 2015  -0.897934 seconds

1

Display the current hardware clock.

2

Set the hardware clock in Coordinated Universal Time (UTC).

3

Confirm that the hardware clock has been set correctly in UTC.

図5.47 Setting the Hardware Clock


5.6. User Switches

The device driver of the Armadillo-IoT user switches is implemented as an input device. Push and release events of the user switches can be obtained from the device file of the input device.

The input device file of the user switches and the event code corresponding to each switch are shown below.

表5.11 Input Device Files and Event Codes

User SwitchesInput Device FileEvent Code
SW1/dev/input/event12 (KEY_1)
SW23 (KEY_2)
SW34 (KEY_3)


[警告]

Input devices are indexed in the order in which they are detected. If an input device has been added by connecting a USB device etc., the index of the device file may be different.

5.6.1. Confirming Events

Here the evtest command is used to check the push and release events of the user switch. To stop evtest, enter Ctrl+c.

[armadillo ~]# evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
Properties:
Testing ... (interrupt to exit)
Event: time 1458887649.091957, type 1 (EV_KEY), code 3 (KEY_2), value 1 1
Event: time 1458887649.091957, -------------- EV_SYN ------------
Event: time 1458887650.311954, type 1 (EV_KEY), code 3 (KEY_2), value 0 2
Event: time 1458887650.311954, -------------- EV_SYN ------------
                 :
[armadillo ~]#

1

Displayed when a SW2 button push event is detected.

2

Displayed when a SW2 button release event is detected.

図5.48 User Switch: Event Confirmation


5.7. Temperature Sensor

The Armadillo-IoT temperature sensor uses the i.MX 7Dual's TEMPMON (Temperature Monitor).

5.7.1. Obtaining the Temperature

By reading the value from the /sys/class/thermal/thermal_zone1/temp file, it is possible to obtain the measured temperature of the i.MX 7 Dual.

[armadillo ~]# cat /sys/class/thermal/thermal_zone1/temp
50000 1

1

Temperature is displayed in units of milli °C. In this example it shows 50.000 °C.

図5.49 Obtaining the measurement temperature of the i.MX 7 Dual


5.8. AD Converter

Armadillo-IoT G3 can acquire the power supply voltage and the voltage of the external battery connected to the RTC backup interface (CON13) with the AD converter function of the BMIC (Board Management IC).

5.8.1. Obtaining the Voltage

The power supply voltage is divided and input to the AD converter. In order to acquire the power supply voltage, it is necessary to first acquire the input voltage to the AD converter. Since the voltage of the external battery is not divided, the input voltage of the AD converter will be the voltage of the external battery as-is.

The AD converter is implemented as an IIO (Industrial I/O) device. The input voltage can be calculated from the file under /sys/bus/iio/devices/iio:device0/ directory.

[注記]

The IIO device will be named iio:deviceN (N is a sequential number from '0') in the order in which the devices are detected. IIO devices can be identified from the IIO device name. The IIO device name of the BMIC's AD converter is "3-0012".

[armadillo ~]# cat /sys/bus/iio/devices/iio:device0/name
3-0012

The input voltage to the AD converter can be calculated from the AD conversion value and the minimum input voltage variation.

[Input voltage (mV) to the AD converter] = [in_voltage_raw] × [in_voltage_scale]

図5.50 Calculation Formula of Input Voltage to the AD Converter


The files under /sys/bus/iio/devices/iio:device0/ which are needed for calculating the input voltage are shown below.

表5.12 Files Needed for Calculating Input Voltage

FileDescription
in_voltage0_rawAD conversion value of single end input CH0 (power supply voltage)
in_voltage1_rawAD conversion value of single end input CH1 (external battery voltage)
in_voltage_scaleMinimum input voltage variation of single end input

As an example, the following describes how to obtain the power supply voltage.

[armadillo ~]# cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw
1766
[armadillo ~]# cat /sys/bus/iio/devices/iio:device0/in_voltage_scale
0.714111328

図5.51 Obtaining the Input Voltage to the AD Converter


In example 図5.51「Obtaining the Input Voltage to the AD Converter」, you can see that the input voltage to the AD converter is about 1.261 V (1766 x 0.714111328 [mV]).

The calculation formula for obtaining the power supply voltage from the input voltage to the AD converter is shown below.

[Power supply voltage (mV)] = [Input voltage to AD converter] x (200 + 24) ÷ 24

図5.52 Calculation Formula of the Power Supply Voltage


Taking 図5.51「Obtaining the Input Voltage to the AD Converter」 as an example, from the AD converter input voltage of 1.261V it can be determined that the power supply voltage is about 11.770V.

[ティップ]

The power supply voltage can be displayed using the awk command as below.

[armadillo ~]# adin_raw=`cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw`
[armadillo ~]# adin_scale=`cat /sys/bus/iio/devices/iio:device0/in_voltage_scale`
[armadillo ~]# echo $adin_raw $adin_scale | awk '{printf ("%d\n",$1*$2*(200+24)/24)}'
11770

5.8.2. Monitoring Power Supply Voltage

The vintrigger command can be used to execute an arbitrary command when the power supply voltage reaches a specified voltage.

[警告]

vintrigger cannot be run multiple times at once.

The vintrigger command help is as follows.

[armadillo ~]# vintrigger
Usage: vintrigger -o|-u VOLTAGE [-i INTERVAL] [COMMAND ARGS]
Options:
  -o, --over=VOLTAGE
      Execute the program COMMAND when the detected voltage is equal
      to or over the VOLTAGE[mV].
  -u, --under=VOLTAGE
      Execute the program COMMAND when the detected voltage is equal
      to or under the VOLTAGE[mV].
VOLTAGE: Range: 0 - 28980

  -i, --interval=INTERVAL
      Compare with Vin to the VOLTAGE at INTERVAL second intervals.
INTERVAL: Range: 0 - 4294967295 (Default: 60)

  -h, --help
      Print usage(this message) and exit.
  -v, --version
      Print version information and exit.

図5.53 vintrigger Command Help


The following shows an example of monitoring the power supply voltage at intervals of 30 seconds and turning on LED2 when the power supply voltage drops below 11000mV (11V).

[armadillo ~]# vintrigger -u 11000 -i 30 echo 1 > /sys/class/leds/led2/brightness

図5.54 vintrigger Command Example


[ティップ]

The vintrigger command log is output to the /var/log/messages file.

[armadillo ~]# cat /var/log/messages
                 :
Jul  1 09:38:52 armadillo-iotg vintrigger[812]: waiting for an under range alert (11000 mV).1
Jul  1 09:38:52 armadillo-iotg vintrigger[812]: exceeded the limit. executing command.2

1

Waiting until it falls below the specified voltage (11000mV).

2

The command is executed as the specified voltage has been reached.

5.9. Armadillo-IoT RS232C Add-on Module RS00

The Armadillo-IoT RS232C Add-on Module RS00 (hereafter referred to as the RS232C add-on module) has one RS232C level serial port. Since the device driver of the serial port of the RS232C add-on module is implemented as a TTY device, it can be controlled from the TTY device file.

The add-on interface that connects the RS232C add-on module and the corresponding TTY device file is shown below.

表5.13 Add-on Interfaces and TTY Device Files

Add-on InterfaceTTY Device File
CON1/dev/ttymxc0
CON2/dev/ttymxc1

[注記]

The RS232C Add-on Module is connected to CON1 in the development set's factory default state.

[ティップ]

The add-on interface to which the RS232C add-on module is connected can be seen in the Linux kernel boot log. When connected to CON1, the output is as follows.

Atmark Techno RS232C board detected at CON1(Rev 2, SerialNumber=xxxx).

5.10. Armadillo-IoT Isolated RS232C/422/485 Add-on Module RS01

The Armadillo-IoT Isolated RS232C/422/485 Add-on Module RS01 (hereafter referred to as the isolated serial add-on module) has one electrically isolated RS232C/RS422/RS485 serial port on it. Since the device driver of the serial port of the isolated serial add-on module is implemented as a TTY device, it can be controlled from the TTY device file.

The add-on interface that connects the isolated serial add-on module and the corresponding TTY device file is shown below.

表5.14 Add-on Interfaces and TTY Device Files

Add-on InterfaceTTY Device File
CON1/dev/ttymxc0
CON2/dev/ttymxc1

[ティップ]

The add-on interface to which the isolated serial add-on module is connected can be seen in the Linux kernel boot log. When connected to CON1, the output is as follows.

Atmark Techno RS485/RS422/RS232C board detected at CON1(Rev 2, SerialNumber=xxxx).

5.10.1. Changing RS422/RS485 Communication Settings

Before turning on Armadillo-IoT, if the isolated serial add-on module SW1.1 is set to OFF, the RS485 configuration of the TTY device is automatically activated.

[警告]

Do not change the setting of the insulated serial add-on module SW1.1 after turning on the Armadillo-IoT. Doing so may cause damage.

RS485 settings that can be altered and the default values when automatically activated are shown in 表5.15「RS485 Setting and Default Values」. Flags shows the logical sum of each bit.

表5.15 RS485 Setting and Default Values

ConfigurationDescriptionDefault Value
flagsENABLED (bit0)

0: RS485 disabled

1: RS485 enabled

1
RTS_ON_SEND (bit1)

0: RTS (Driver Enable) is low during data transmission

1: RTS (Driver Enable) is high during data transmission

1
RTS_AFTER_SEND (bit2)

0: RTS (Driver Enable) is low outside of data transmission

1: RTS (Driver Enable) is high outside of data transmission

0
RX_DURING_TX (bit4)

0: Half duplex

1: Full duplex

0
delay_rts_before_sendDelay time before transmission (ms)0
delay_rts_after_sendDelay time after transmission (ms)0

[警告]

Please do not change the default values of RTS_ON_SEND and RTS_AFTER_SEND of "flags". If changed, data transmission will no longer be possible.

[注記]

It is not possible to use a TTY device with RS485 enabled as a console.

The RS485 settings can be changed with an application program or Linux kernel startup options.

For details on how to create an application program, refer to the document (Documentation/serial/serial-rs485.txt) included in the Linux kernel source code.

For the Linux kernel startup options, RS485 is set with the following option specifiers.

表5.16 Setting RS485 from Linux kernel Boot Options

Option SpecifierDescription
imx.rs485_uart1=

Specify RS485 settings for UART1 (ttymxc0) connected to CON1.

imx.rs485_uart2=

Specify RS485 settings for UART2 (ttymxc1) connected to CON2.


The format of the RS485 settings is as follows.

<flags>,<delay_rts_before_send>,<delay_rts_after_send>

As an example, to set the RS485 settings of the Isolated Serial Add-on Module connected to CON2 to full duplex communication, start up in Maintenance mode and run the following commands.

=>setenv optargs imx.rs485_uart2=0x13,0,0
=>saveenv

5.11. Armadillo-IoT Wi-SUN Add-on Module WS00

The Armadillo-IoT Wi-SUN Add-on Module WS00 (hereafter referred to as Wi-SUN add-on module) is equipped with ROHM BP35A1.

The Wi-SUN add-on module can be controlled from the TTY device file using ASCII commands. The add-on interface that connects the Wi-SUN add-on module and the corresponding TTY device file are shown below.

表5.17 Add-on Interfaces and TTY Device Files

Add-on InterfaceTTY Device File
CON1/dev/ttymxc0
CON2/dev/ttymxc1

[ティップ]

The add-on interface to which the Wi-SUN add-on module is connected can be seen in the Linux kernel boot log. When connected to CON1, the output is as follows.

Atmark Techno Wi-SUN board detected at CON1(Rev 2, SerialNumber=xxxx).

5.11.1. Obtaining Configuration Information

As an example of controlling the Wi-SUN add-on module, obtain the configuration information of BP35A1.

The procedure for obtaining the configuration information of BP35A1 equipped on the Wi-SUN add-on module connected to the add-on interface (CON1) is shown below.

手順5.2 Obtaining Configuration Information

  1. Run the cu command and connect to /dev/ttymxc0. The baudrate is 115,200 bps.

    [armadillo ~]$ cu -l /dev/ttymxc0 -s 115200
    Connected.
    
  2. Running the SKINFO command results in the configuration information of BP35A1 being displayed.

    SKINFO
    EINFO FE80:0000:0000:0000:021D:1290:0004:0FBE 001D129000040FBE 21 FFFF FFFE
    OK
  3. To quit cu, enter "~." (a tilde "~" followed by a dot ".").

    Disconnected.
    [armadillo ~]$ 

For other ASCII commands and detailed information on BP35A1 please refer to ROHM documentation.

5.12. Armadillo-IoT Isolated RS485 Add-on Module RS02

The Armadillo-IoT Isolated RS485 Add-on Module RS02 (hereafter referred to as the isolated RS485 add-on module) has one electrically isolated RS422/RS485 serial port on it. Since the device driver for the serial port of the isolated RS485 add-on module is implemented as a TTY device, it can be controlled from the TTY device file.

The add-on interface that connects the isolated RS485 add-on module and the corresponding TTY device file are shown below.

表5.18 Add-on Interfaces and TTY Device Files

Add-on InterfaceTTY Device File
CON1/dev/ttymxc0
CON2/dev/ttymxc1

[ティップ]

The add-on interface to which the isolated RS485 add-on module is connected can be seen in the Linux kernel boot log. When connected to CON1,the output is as follows.

Atmark Techno RS485 board detected at CON1(Rev 1, SerialNumber=xxxx).

5.12.1. Changing RS422/RS485 Communication Settings

The TTY device RS485 settings are applied automatically.

RS485 settings that can be altered and the default values when automatically activated are shown in 表5.15「RS485 Setting and Default Values」. Flags shows the logical sum of each bit.

表5.19 RS485 Setting and Default Values

ConfigurationDescriptionDefault Value
flagsENABLED (bit0)

0: RS485 disabled

1: RS485 enabled

1
RTS_ON_SEND (bit1)

0: RTS (Driver Enable) is low during data transmission

1: RTS (Driver Enable) is high during data transmission

1
RTS_AFTER_SEND (bit2)

0: RTS (Driver Enable) is low outside of data transmission

1: RTS (Driver Enable) is high outside of data transmission

0
RX_DURING_TX (bit4)

0: Half duplex

1: Full duplex

0
delay_rts_before_sendDelay time before transmission (ms)0
delay_rts_after_sendDelay time after transmission (ms)0

[警告]

Please do not change the default values of RTS_ON_SEND and RTS_AFTER_SEND of "flags". If changed, data transmission will no longer be possible.

[注記]

It is not possible to use a TTY device with RS485 enabled as a console.

The RS485 settings can be changed with an application program or Linux kernel startup options.

For details on how to create an application program, refer to the document (Documentation/serial/serial-rs485.txt) included in the Linux kernel source code.

For the Linux kernel startup options, RS485 is set with the following option specifiers.

表5.20 Setting RS485 from Linux kernel Boot Options

Option SpecifierDescription
imx.rs485_uart1=

Specify RS485 settings for UART1 (ttymxc0) connected to CON1.

imx.rs485_uart2=

Specify RS485 settings for UART2 (ttymxc1) connected to CON2.


The format of the RS485 settings is as follows.

<flags>,<delay_rts_before_send>,<delay_rts_after_send>

As an example, to set the RS485 configuration of the isolated serial add-on module connected to CON2 to full duplex communication, start up in maintenance mode and execute the following command.

=>setenv optargs imx.rs485_uart2=0x13,0,0
=>saveenv

5.13. Armadillo-IoT Isolated Digital I/O / Analog Input Add-on Module DA00

The Armadillo-IoT Isolated Digital I/O and Analog Input Add-on Module DA00 (hereafter referred to as the isolated I/O add-on module) consists of two electrically isolated digital input ports, two digital output ports and two 0 to 5V analog input ports.

The digital I/O device driver for the isolated I/O add-on module is implemented as a GPIO device, and the analog input device driver is implemented as a IIO (Industrial I/O) device.

表5.21「Add-on Interfaces and GPIO Class Directories」 shows the add-on interface that connects the isolated IO add-on module and the corresponding GPIO class directory. The IIO device is iio:deviceN (N is a sequential number start from '0') in the order in which the devices are detected.

表5.21 Add-on Interfaces and GPIO Class Directories

Add-on InterfacePortGPIO Class Directory
CON1Digital Output 1/sys/class/gpio/gpio89
Digital Output 2/sys/class/gpio/gpio90
Digital Input 1/sys/class/gpio/gpio141
Digital Input 2/sys/class/gpio/gpio140
CON2Digital Output 1/sys/class/gpio/gpio106
Digital Output 2/sys/class/gpio/gpio107
Digital Input 1/sys/class/gpio/gpio181
Digital Input 2/sys/class/gpio/gpio180

[ティップ]

The add-on interface to which the isolated I/O add-on module is connected can be seen in the Linux kernel boot log. When connected to CON2, the output is as follows.

Atmark Techno DI/DO/AD board detected at CON2 (Rev 1, SerialNumber=xxxx).

5.13.1. Setting the Digital Output State

The output state can be set by writing a value to the value file under the GPIO class directory. "0" indicates open circuit, "1" indicates closed circuit.

An example of setting the digital output of the isolated IO add-on module connected to the add-on interface (CON2) to open is shown below.

[armadillo ~]# echo 0 > /sys/class/gpio/gpio106/value

図5.55 Changing the Digital Output State


5.13.2. Getting the Digital Input State

The input state can be obtained by reading the value from the value file under the GPIO class directory. "0" represents a connection to GND_ISO. "1" represents either open or the application of 3.15V or more.

An example of obtaining the state of the digital input of the isolated IO add-on module connected to the add-on interface (CON2) is shown below.

[armadillo ~]# cat /sys/class/gpio/gpio181/value
1

図5.56 Getting the Digital Input State


5.13.3. Getting the Analogue Input Voltage

The input voltage can be calculated from the files under the /sys/bus/iio/devices/iio:device1/ directory.

[注記]

The IIO devices are iio:deviceN (N is a sequential number from '0') in the order in which the devices are detected. IIO devices can be identified from the IIO device name. The IIO device name of the AD converter on the isolated IO add-on module is "mcp3202".

[armadillo ~]# cat /sys/bus/iio/devices/iio:device1/name
mcp3202

The input voltage to the AD converter can be calculated from the AD conversion value and the minimum input voltage variation.

[Input Voltage (mV) to AD Converter] = [AD Conversion Value] × [Minimum Input Voltage Variation]

図5.57 Calculation Formula of Input Voltage to the AD Converter


The files under the /sys/bus/iio/devices/iio:device1/ directory required for calculating the input voltage are shown below.

表5.22 Files Needed for Calculating Input Voltage

FileDescription
in_voltage0_rawAD conversion value of single end input CH 0
in_voltage1_rawAD conversion value of single end input CH 1
in_voltage_scaleMinimum input voltage variation of single end input
in_voltage0-voltage1_rawAD conversion value of the pseudo differential input
in_voltage-voltage_scaleMinimum input voltage variation of pseudo differential input

An example of calculating the input voltage to the single end input CH0 is shown below.

[armadillo ~]# cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw
2048
[armadillo ~]# cat /sys/bus/iio/devices/iio:device1/in_voltage_scale
1.220703125

図5.58 Obtaining the Input Voltage to the AD Converter


In the 図5.58「Obtaining the Input Voltage to the AD Converter」 example, the input voltage to the single end input CH0 is 2.5 V (2048 x 1.220703125 [mV]).

[ティップ]

The power supply voltage can be displayed using the awk command as below.

[armadillo ~]# adin_raw=`cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw`
[armadillo ~]# adin_scale=`cat /sys/bus/iio/devices/iio:device1/in_voltage_scale`
[armadillo ~]# echo $adin_raw $adin_scale | awk '{printf ("%d",$1*$2)}'
2500


[12] More detailed information can be displayed with the nmcli connection show [ID] command.

[13] nmcli device and nmcli device status are equivalent.

Also, more detailed information can be displayed with nmcli device show.

[14] Specifying the file system type is optional. If omitted, the mount command guesses the type. This guess is not necessarily appropriate, so if the file system type is known in advance, please explicitly specify it.

[15] Normally, SDHC cards just purchased are formatted with the FAT32 file system.