Download as pdf or txt
Download as pdf or txt
You are on page 1of 81

AMS111 IV,

Data logger with Linux

User’s guide

V 1.0
© Copyright 2022, by MicroStep-MIS.
All rights reserved. No part of this publication may be reproduced, stored in
retrieval system, or transmitted by any means, electronic, mechanical,
photocopying, recording, or otherwise without the prior written permission of
MicroStep-MIS.

Trademarks
All trademarks or registered trademarks mentioned belong
to their respective owners.

Authors
Editorial team: Csaba Ruman, Jaroslav Hutira, Radoslav Pešek

Firmware version
This version of user guide describes functionality of firmware version 1.9K.

Hardware version
This version of user guide describes functionality of hardware AMS111 IV with
Linux

Address
MicroStep-MIS, spol. s r.o.,
Čavojskeho 1, 841 04 Bratislava 4, Slovak Republic
Phone: +421 2 602 00 100,
Fax: +421 2 602 00 180,
Email: info@microstep-mis.com
AMS 111 IV USER’S GUIDE

Using this manual


Throughout this guide, several typographical conventions are used to help
reader to follow instructions and identify the important information.

Instructional icons

WARNING: Situations that could cause injury to yourself or others.

CAUTION: Situations that could cause damage to your device or


other equipment or can result in data loss.

NOTE: Notes, usage tips, or additional information.

Commands and responses


COMMANDRESPONSE

Source codes
if code == inserted
{
text = format_code
}

2
AMS 111 IV USER’S GUIDE

Table of contents
Table of contents ........................................................................................... 3
Introduction .................................................................................................... 7
1. Hardware ................................................................................................. 7
Technical description ....................................................................... 7
Power control ................................................................................... 9
CPU, RTC and Internal Memory ...................................................... 9
Single-ended Analog Inputs ............................................................. 9
Differential Analog Inputs ............................................................... 10
Digital Inputs .................................................................................. 10
Serial Interfaces RS232 ................................................................. 11
Serial Interfaces RS485 ................................................................. 11
Serial Interface SDI-12................................................................... 12
Ethernet Interface ...................................................................... 12
USB device Interface ................................................................. 12
Micro Secure Digital Interface .................................................... 13
GPRS Modem ............................................................................ 14
2. Installation ............................................................................................ 17
Data logger description .................................................................. 18
Mechanical installation ................................................................... 19
Replacement of the Lithium Battery ............................................... 21
Cards installation ........................................................................... 26
3. Display .................................................................................................. 29
Monochromatic touch screen Display LCD.................................... 29
3.1.1. Listing in the Menu ................................................................. 30
3.1.2. Entering the Text .................................................................... 30
3.1.3. Entering the Numbers ............................................................ 30
3.1.4. Structure of the Menu ............................................................ 30
Color TFT Display .......................................................................... 32

3
AMS 111 IV USER’S GUIDE
4. Software ................................................................................................ 45
Command Interpreter ..................................................................... 47
Basic Commands ........................................................................... 47
4.2.1. DATE Command .................................................................... 48
4.2.2. VER Command ...................................................................... 48
4.2.3. CLOSE Command ................................................................. 48
Status Commands ......................................................................... 48
4.1.1. PROTO Command ................................................................. 49
4.1.2. TIMELIST Command ............................................................. 49
Information about Variables and Setting ........................................ 49
4.2.1. GET, GETC, GETI, GETF, GETS, GETH Commands .......... 50
4.2.2. GETR, GETRC, GETRI, GETRF, GETRS Commands ......... 51
4.2.3. SET, SETC, SETI, SETF, SETS Commands ........................ 52
File Management Commands ........................................................ 52
4.3.1. FORMAT Command .............................................................. 52
4.3.2. DIR Command ....................................................................... 53
4.3.3. COPY Command ................................................................... 53
4.3.4. DEL Command....................................................................... 54
4.3.5. TYPE Command .................................................................... 54
4.3.6. XMODEMW and XMODEMR Commands ............................. 54
Maintenance Commands ............................................................... 56
4.4.1. HALT command ..................................................................... 56
4.4.2. TERMINAL Command ........................................................... 57
4.4.3. STTY command ..................................................................... 59
Linux console ................................................................................. 60
4.5.1. Change password .................................................................. 60
Lua scripts ...................................................................................... 60
5. General settings ................................................................................... 63
Modems ......................................................................................... 63
5.1.1. Single SIM mode .................................................................... 63

4
AMS 111 IV USER’S GUIDE

5.1.2. Dual SIM mode with switching algorithm ............................... 64


5.1.3. Common modem settings ...................................................... 64
Data Logging .................................................................................. 66
Automatic Command Mode Termination ....................................... 66
Virtual Serial Lines ......................................................................... 66
5.4.1. TCP Server ............................................................................ 66
5.4.2. TCP Client .............................................................................. 66
5.4.3. UDP........................................................................................ 67
Ethernet ......................................................................................... 67
6. Linux commands ................................................................................. 71
Editing files in console ................................................................... 71
6.1.1. Using vi editor ........................................................................ 71
6.1.2. Using joe editor ...................................................................... 72
Managing services ......................................................................... 72
Showing service outputs ................................................................ 73
Other Linux commands .................................................................. 74
7. Troubleshooting ................................................................................... 77
Inaccessible Command Mode ....................................................... 77
Inaccessible Linux .......................................................................... 77
Problem Identification Commands ................................................. 78
References .................................................................................................... 79
Register ......................................................................................................... 79

5
AMS 111 IV USER’S GUIDE

Introduction

MicroStep-MIS AMS111 IV is the fourth generation of universal data-logger


system for measurement and automated data collection. The data logger is
designed for measurement of electric and non-electric quantities using optional
sensors according to user requirements. Measured values can be shown on
display, stored to internal memory, transmitted through communication
interfaces or modems or written to secure digital cards. Data logger can be
used for many types of meteorological stations from small compact solution
(„all in one“), to big integrated airport systems. With the Linux version it offers
even more flexibility and programmability.

1. Hardware

Technical description

AMS 111 IV is designed as a precise compact single-board system, combining


advanced data-logger, user-interface and power-control functions in one
compact and small device:
• Advanced micro-controller system for intelligent data measuring and
collection, solar panel and backup-battery power control, sensor
diagnostics, remote updates of firmware, and more other functions
• Module with embedded Linux Ängström distribution
• 5 single ended analog inputs
o input voltage range (0 –5 V)
o 12 - Bit A/D converter resolution
o selectable sampling frequency, sample & hold function

7
AMS 111 IV USER’S GUIDE
• 22 differential analog inputs
o allows 4-wire connection
o 24-Bit Sigma-Delta A/D converter resolution
o selectable sampling frequency, sample & hold function
o noise rejection > 100 dB
o digital filtering
o voltage measurement accuracy 0.031 %
o resistance measurement accuracy 0.042 %
• 12 digital inputs (10 counters up to 5 kHz, 1 counter up to 500000 kHz)
• 3 independent RS232 interfaces
• 2 independent RS485 interfaces
• 2 independent SDI-12 interfaces
• Ethernet interface
• USB device interface (Virtual COM port, Mass storage)
• USB host interface (for connection USB key)
• Asynchronous serial interface
• Socket for micro secure digital card
• Socket for SIM card
• GSM modem (optional)
• Touch screen display with virtual keyboard
• Color TFT touch screen display (optional)
• Various power-supply input (AC/DC/Solar Panel/Battery)
• automatic battery charging
• 8 power supply outputs for external devices 1.5 A
• 4 digital outputs (open collector) 35 V / 1 A

8
AMS 111 IV USER’S GUIDE

Power control

The device may by supplied by:


• DC external source for charging (5 – 17 V)
• Main battery (12 V Pb accumulator, battery pack of NiCD
accumulators)

Usually, the primary source can be mains power with transformer, or a solar
panel. In both cases, 12 V Pb accumulator is recommended as backup -
secondary source. If battery is not used, the external voltage must be
connected to battery (main) input.
The data logger monitors the voltage levels of the battery and charges the
battery when needed.

CPU, RTC and Internal Memory


The AMS 111 IV is controlled by two-chip microcontrollers of ARM Cortex
family. It uses 512 MB FLASH nonvolatile memory for main Linux OS with
internal 256 MB DDR3 memory. Up to 64 GB available in Secure Digital card
for data storage.
The Real-Time Circuit (RTC) has external “button-battery” backup (therefore
the actual time is not erased in case of power failures). See chapter 2.1 for
battery replacement.

Single-ended Analog Inputs


Single ended analog input allows measuring up to 5 independent analog
values, updated with sampling rate up to 1 Hz and 12-bit resolution. Each input
is connected between AINi and common GND.
All inputs are over-voltage protected, input range is 0 to +5 V.

9
AMS 111 IV USER’S GUIDE
Differential Analog Inputs
Differential analog inputs are usual used for precise measurements of analog
quantities. The board directly supports 4-wire connection of PT100
thermometers. Updated with sampling rate up to 4 Hz and 24-Bit resolution.
Input range can be chosen in 8 steps (±19.53125mV, ±39.0625mV,
±78.125mV, ±156.25mV, ±312.5mV, ±625mV, ±1.25V, ±2.5V)). Common
terminals EXO+ (Excitation Out) and EXI- (Excitation In) represent a constant
current source for measuring resistances. The voltage is measured between
signals ADFINPi and ADFINNi. Both voltages must not exceed ±2.5 V relative
to common GND.

Digital Inputs
Digital input allows connecting up to 12 single-bit digital inputs. All are over-
voltage protected.

Voltage Signal

0–2V Logical 0

2–5V Undefined

5 – 15 V Logical 1
Table 1 : Voltage levels of digital inputs

Ten inputs can be used for measurement of frequency up to 5 kHz, one input
for frequency up to 500kHz. These inputs can be configured to have several
measurement modes:

10
AMS 111 IV USER’S GUIDE

Mode Meaning
Periodic sample of logic state
None
(0 of 1)
Number of pulses recorded during the defined
Counter
time (can calculate frequency)

Gray code Combination of multiple inputs as one code

Serial synchronous Clocked serial interface only on DIN11


Table 2 : Modes of digital inputs

Serial Interfaces RS232


Standard serial interface supports asynchronous communication at speeds
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400,
460800 and 921600 bps.

RS232 interface may be used for communication with a nearby computer, as


well as an input for an intelligent sensor.

Serial Interfaces RS485


This serial interface is galvanic isolated and supports communication speeds
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400 and
460800 bps.

RS485 interface provides communication capabilities for serial line up to 1200


meters long (depending on the cable type and baud rate), therefore it is
suitable for interconnection of the logger with remote data collection PC or
other data distribution systems.

11
AMS 111 IV USER’S GUIDE
Serial Interface SDI-12
SDI-12 stands for serial data interface at 1200 baud. It is a standard to interface
battery powered data recorders with microprocessor-based sensors designed
for environmental data acquisition (EDA).
EDA is accomplished by means of a sensor, or sensors, and a data recorder
which collects and saves the data. An intelligent sensor typically takes a
measurement, makes computations based on the raw sensor reading, and
returns the measured data in engineering units.

Ethernet Interface
The Ethernet interface supports 10/100MBits Ethernet connection. See the
chapters 5.4 Virtual Serial Lines and 5.5 Ethernet to configure the logger to act
as TCP server, client, or to enable UDP data transfer. Linux services may work
as clients and servers.

USB device Interface


USB interface can be used as virtual serial port for entering command mode
or as solid-state disk for accessing the data stored on secure digital cards.
A standard USB A to B cable is necessary for the interconnection of the
computer and the logger.

NOTE: During the first connection of AMS 111 IV to computer


running Microsoft Windows via the USB cable, it is necessary to
install the virtual serial port driver.
In Windows 10 and newer the driver is automatically downloaded
from Microsoft driver center (during the installation the computer
needs to be connected to the internet).

12
AMS 111 IV USER’S GUIDE

Entering the command mode:


1. Connect the computer and logger using USB A to B cable (install the
driver, if necessary).
2. Two “Gadget Serial” or “USB Serial Device” ports are detected by the
Microsoft Windows and mapped to COM ports. One of them is a
console to Linux, the other is a console to the data logger application.

Figure 1: Virtual serial lines in device manager

3. Open the terminal program; select the second COM port assigned to
“Gadget Serial” or “USB Serial Device” port and enter the command
mode the same way as through RS232 connection (see the chapter
4.1 Command interpreter).
4. After finishing the work, close the command mode and disconnect the
USB cable.

Micro Secure Digital Interface


AMS 111 IV directly supports reading data from / to secure digital (SD) memory
cards.

13
AMS 111 IV USER’S GUIDE
User interface supports upload or download of data, and of configuration files
by using keyboard and display.
This feature allows manual data collection from far-away stations without
serial-line or modem connection, safe storage of important data, easy manual
data exchange between loggers – when they are changed or serviced, etc.

GPRS Modem
GPRS Modem module allows wireless connection via 4G GSM – responsible
communication solution for places without wired internet. The modem supports
the following bands:
FDD LTE: B1/B3/B5/B7/B8/B20
UMTS: B1/B5/B8
GSM: 850/900/1800/1900MHz
The data logger supports external modem to be used instead of the internal
modem.

14
AMS 111 IV USER’S GUIDE

15
AMS 111 IV USER’S GUIDE

2. Installation
NOTE: This chapter does not provide information on power and
sensor cabling; since those differ from application to application
(E.g., wind speed sensor could provide analogous output, one-bit
digital output or RS232 interface). If the AMS 111 IV was
delivered/installed by MicroStep-MIS, refer to the respective
layouts and project documentation.

NOTE: To install or replace any devices, switch the logger off.


Installation and/or replacement of devices while logger is turned on
may result in a damage of the equipment.

Main board internal clock is powered by the CR2032 lithium battery while the
logger is switched off - therefore switching the logger off results in no loss of
date-time.

NOTE: The loggers are delivered by MicroStep-MIS with a lithium


battery insulated from contacts with the insulating tape to prevent
the battery from discharging during shipment. A loose end of
insulating tape is marked by the label “Pull out after installation” and
protrudes through the opening in the logger cover. Pull out the tape
at the time of logger installation to put the battery into the operation.

17
AMS 111 IV USER’S GUIDE
Data logger description

Figure 2: Data logger description

18
AMS 111 IV USER’S GUIDE

Mechanical installation
The AMS 111 IV is suitable only for indoor installation. In outdoor environment
industrial panel enclosure with sufficient weather protection (IP 65 (EN 60529),
IP 67) is needed. The environment where AMS 111 IV is used must not contain
condensed water. The case of the charger is equipped with DIN rail clip
(located at the rear side). The following picture shows some examples of DIN
rails but also other 35 mm types can be used.

Figure 3: DIN rail sizes

The data logger can be quickly attached or released as the following picture
illustrates. The first step during the attachment is putting the bottom of the DIN
rail clip on to DIN rail. The second step is pushing AMS 111 IV upwards until a
click sound is heard and the case of the AMS 111 IV is in a straight position.

19
AMS 111 IV USER’S GUIDE

Figure 4: Installation to DIN rail

WARNING: Do not press on display surface or front panel of the


AMS 111 IV during installation because the display could be
damaged!

20
AMS 111 IV USER’S GUIDE

Figure 5: Data logger dimensions

Replacement of the Lithium Battery


A new CR2032 (3 Volts - lithium) battery has normal lifetime about 3-5 years,
depending on usage conditions.

NOTE: If the logger is switched off for more than 1 year, the RAM
data persistence is not guaranteed.

If the battery voltage is lower than 2.8 V, it is recommended to replace it.

The replacement of the battery is done in following steps:


1. Dismount the logger:
a. Switch off the power
b. Disconnect the connectors out from terminal
c. Remove data logger from DIN rail

21
AMS 111 IV USER’S GUIDE
2. Eject battery from data logger
a. Use small slotted screwdriver (see picture bellow)
b. Pull screwdriver to the other side, until the moment it come out
battery holder.

Figure 6: Ejecting the battery from data logger

22
AMS 111 IV USER’S GUIDE

Figure 7: Battery holder

3. Remove old battery from battery holder, and insert new battery
according to the figure below. Be carefully, new battery must insert in
correct polarity in to the holder.

23
AMS 111 IV USER’S GUIDE

Figure 8: Correct orientation of the battery in the holder

4. The battery must be installed in correct polarity, otherwise the battery


or data logger may be damaged.

24
AMS 111 IV USER’S GUIDE

Figure 9: Correct orientation of the battery holder

5. After inserting new battery in to the battery holder, install battery holder
with battery in to the data logger, see next picture.

25
AMS 111 IV USER’S GUIDE

Figure 10: Inserting the battery bolder

Cards installation

The procedure to inserting Micro SIM card is shown on the picture below.

Figure 11: SIM card orientation

26
AMS 111 IV USER’S GUIDE

The procedure to inserting Micro Secure Digital card is shown on the picture
below.

Figure 12: SD Card orientation

27
AMS 111 IV USER’S GUIDE

28
AMS 111 IV USER’S GUIDE

3. Display
The AMS111 IV data logger comes with two types of displays: Monochromatic
and color TFT.

Monochromatic touch screen Display LCD


Data-logger AMS 111 IV has as optional integrated graphic touch screen
display. This simple user terminal enables the user to enter system commands
(it enables for example to configure system parameters, set time, date etc.)
and present measured values.

The utilization of LCD display is intuitive and simple. The display is turned on
by pressing on any of its parts.
The display is turned off by pressing the icon „X“ in upper right part of the
display in main menu. If the terminal is not used for more than 10 minutes, it
will be turned off automatically. After turning on, last selected function will be
displayed.

In the main menu, symbols for moving in the menu items, for selecting the
specific function or for returning to the previous menu level are situated in the
right part of the main menu.
By pressing the cursor key [▲] (up arrow) or [▼] (down arrow), the user can
list in the menu items.
It is possible to confirm the actually selected item by pressing the key [┘], or to
leave without saving changes by key [X].
In the multilevel menu, it is possible to return to the nearest higher level by
pressing the key [X] (by key [┘] to the nearest lower level).

29
AMS 111 IV USER’S GUIDE
3.1.1.Listing in the Menu
All items (actually displayed on the display) can be confirmed by pressing the
key [┘], or left by key [X]. Higher level of menu (if exists) would be displayed
after pressing [X]. If [X] is pressed in the main menu, this will cause turning off
of the display.

3.1.2.Entering the Text

By selecting the function of text entering, a couple of letters, numbers and


special symbols are displayed in the bottom part of display. The character is
selected by clicking on specific character from the list.

The character in front of the cursor is deleted by clicking on the backspace


arrow. It is possible to move the cursor in the text to left and to right with cursor
arrows [◄] [►].
3.1.3.Entering the Numbers

By selecting the function of number entering, numbers and special symbols


are displayed in the bottom part of display. The character is selected by clicking
on specific character from the list.

The character in front of the cursor is deleted by clicking on the backspace


arrow. It is possible to move the cursor in the text to left and to right with cursor
arrows [◄] [►].
3.1.4.Structure of the Menu
The basic menu screen contains different items according to the configuration
of a specific station. The menu usually contains at least:

• Measurement (the list of actually measured variables) –showing


cyclically all measured variables with their values. It is possible to

30
AMS 111 IV USER’S GUIDE

prohibit/allow automatic cyclical imaging by pressing the key [┘]. In the


manual mode; it is also possible to list the variables by keys [▲] (up
arrow) and [▼] (down arrow)
• Variables (the set of commands for setting of variables)
o Show - shows the variable value (selected from the list of
variables)
o Set - shows the variable value and enables the change of the
variable; to save the change, press the key [┘]
o Presentation - shows all variables cyclically with their values. The
names of the values have to agree to variables in the
Measurement menu. It is possible to prohibit/allow the automatic
cyclic imaging by pressing the key [┘]. In the manual mode, it is
possible to list the variables by keys [▲] (up arrow) and [▼] (down
arrow)
• Time
o Show time - shows actual time
o Set time - enables to set the actual time of data logger
• Events - enables to define the initialization and termination times of
events
• Calibrate - enables the calibration of sensors
• Pause Disks - stops write operations to SD card to safely eject it
• Update firmware - loads firmware file from SD card. The File name
must be RTX_AUTO.IEX
• Version/LOG file info - Shows firmware version and sample of the
latest log files.
• Calib File View/Edit - View or edit calibration file if present
• Export Logfiles to H - Copy the log files to the USB mass storage

31
AMS 111 IV USER’S GUIDE
Color TFT Display

Figure 13 Loading screen

Main menu: shown after logger boots up with “Loading…” message being
displayed while system initialization is in progress. You can navigate by clicking
the icons or arrows on the sides. To return to main menu, click on House icon.

32
AMS 111 IV USER’S GUIDE

Figure 14 Set variables

Set variables: Allows to show and change values of variables defined in


configuration; which variables are to be displayed in the table is determined by
file VARS.TXT. If needed, variables can be divided in separate tables using
additional files named VARSN.TXT, where N is number > 0. Buttons’ labels
(“Settings” and “Maintenance”, in the picture) are defined in file NAMES.TXT –
if not present or particular file name doesn’t match any record in NAMES.TXT,
file’s name is used as a label.
Measurements: Similar to Set variables screen, it allows to show (but not
change) values of variables defined in configuration (e. g. physical values
measured by sensors); the same applies as for Set variables screen, except
file’s names are MEAS.TXT and MEASN.TXT, respectively

33
AMS 111 IV USER’S GUIDE

Figure 15 Storage manager

Storage manager: shows storage devices (namely USB and SD card) currently
plugged in to logger, information about their size and free space (both as
numerical values and graph (on the left side of screen)) and allows basic
operations such as ejecting and device formatting. Button Copy Logs copies
log files from SD card to USB device.

34
AMS 111 IV USER’S GUIDE

Figure 16 Format confirmation

To prevent accidental format of storage device, user is asked to confirm her


intention.

35
AMS 111 IV USER’S GUIDE

Figure 17 Graph with disabled user interface

Figure 18 Graph loading data

36
AMS 111 IV USER’S GUIDE

Figure 19 Graph daily data

Figure 20 Graph weekly data

37
AMS 111 IV USER’S GUIDE

Figure 21 Graph two variables

Graphs: allows to show historical values of variables defined in configuration


as graphs – these values are stored in log files under DATA directory on SD
card as consecutive lines, each line containing several fields such as
timestamp, logger ID, variables names, their values, etc. If particular log file’s
first record’s timestamp and logger ID don’t conform to current logger ID and
system time (e. g. system time being older than time derived from record’s
timestamp), logger treats this file as invalid and shows screen with disabled
user interface as shown in Figure 17.
When log files present on SD card are valid, logger parses these files one by
one, starting with the oldest, and shows progress in progress bar as shown in
Figure 18. Parsing consists of two parts –daily data are loaded to memory as
found in log files; hourly data, on the other hand, are hourly averages computed
from daily data. They allow user to see variable’s values in longer time span

38
AMS 111 IV USER’S GUIDE

(weekly, monthly or yearly, which is switchable by upper left button with arrows)
in one graph.
Due to memory constraints, only daily data for (up to) past month are loaded
into memory and as user navigates (using top right button with arrows) to older
log files they are dynamically loaded and the newest are unloaded (and vice
versa as user goes back to newer log files) - so at every moment there is
maximum one month window of data loaded into memory. This doesn’t apply
for hourly data which, because being usually less memory heavy, are loaded
in memory at once.
Graphs screen also allows user to choose to view graphs of (at most) two
variables at the same time – e. g. to compare them – using orange and yellow
button with arrows on bottom of the screen. Their current values are displayed
on scales with respective color coding on right side of graph area. There are
also available standard operations such as scrolling and zooming in and out
(with corresponding zoom value and time interval between two vertical bars in
graph area being displayed in status bar at the top of graph area).

39
AMS 111 IV USER’S GUIDE

Figure 22 Settings screen

Figure 23 Setting a password

40
AMS 111 IV USER’S GUIDE

Figure 24 Screen password enabled

41
AMS 111 IV USER’S GUIDE

Figure 25 Requesting screen password

Settings: this screen allows to set password to protect screens (currently,


screens Set variables and Settings can be protected), set, whether slideshow
should be run instead of screensaver and change language.
Initially, there is no password set and screens which can be locked are freely
available – this is signified by lack of lock button on top of the screen. When
needed, password can be set. Then, lock
button is displayed – as shown in Figure 24 – besides indicating, whether
screen locking is enabled or disabled, it can be used to manually lock screens,
which also lock automatically after 5 minutes of inactivity.
Whenever password is set on this screen, it’s also changed for Linux account
user, since they share password database (and vice versa, changing
password using Linux command passwd for the user named user changes
password for screens protection).

42
AMS 111 IV USER’S GUIDE

Figure 26 About screen

About: this screen shows basic information about logger’s firmware version.

43
AMS 111 IV USER’S GUIDE

4. Software
The AMS 111 IV software consists of multiple parts:

• MicroStep-MIS basic software stored in the internal flash memory.


Firmware includes real-time executive, optimized for effective
processor time utilization, and Command Interpreter. The real-time
executive in logger handles the measurements, logging and similar
tasks. The real-time execution is common to all loggers (the version
may differ).
• Configuration stored in the internal configuration file. Configuration
defines the logger operation (meteorological monitoring,
environmental monitoring, industrial application, etc.); therefore, it
differs significantly from logger to logger and may also change during
the logger lifetime. The configuration is interpreted during the run-time
and plays similar role, as the application settings in a personal
computer.
• Other services running under the Linux. This may include special
software for particular tasks (complex handling of sensor data),
settings of Linux standard services or extensions to basic configuration
in scriptable form (in Lua programming language)

The firmware provides parameters setting, configuration changes and status


information; all these functions are accessible through the Command
Interpreter.

The AMS 111 IV is delivered with the preloaded configuration based on the
customer specification (i.e., with MicroStep-MIS firmware + configuration) or
with MicroStep-MIS firmware only (basic software). In the latter case the

45
AMS 111 IV USER’S GUIDE
customer may create his own configuration using the AWS Setup application
running on the Windows® based PC.

See the AWS Setup User’s Guide [2].

Figure 27: AWS Setup

Having a PC connected to AMS 111 IV, the user can browse the
actual/historical data, download/upload files (including firmware, configuration
and modem firmware), and set the run time parameters using the AWS Service
application. Refer to the AWS Service User’s Guide [1].

46
AMS 111 IV USER’S GUIDE

Figure 28: AWS Service

Command Interpreter
Connection with the logger through serial RS232, USB or TCP interface using
standard terminal program is required. After serial line parameters setup and
establishing of the communication, you can open Command Interpreter by
entering the access code - predefined as #MICRO# [ENTER].

Command Interpreter next shows opening message:

Command mode started

Basic Commands
One of the logger basic functions is maintaining of the real-time – that is read
upon startup from CMOS memory with battery backup. Correct time should be
set during initialization of the logger. Equally, it is recommended to check time
deviation regularly and correct it whenever required.

47
AMS 111 IV USER’S GUIDE
4.2.1.DATE Command
Command for actual date and time display is DATE:

DATE
21.07.2020 21:04:36

To set new date and time, use command DATE with parameters

DATE 21.07.2020 21:05:10


21.07.2020 21:05:10

The interpreter with new date and time print confirms the result.
4.2.2.VER Command
VER command shows actual version of the application software.

VER
PICOLO4_BIG 1.8X
MicroStep-MIS
25.02.2019 11:13:10

In case a restart of whole application software would be required (e.g. after


new configuration upload), you can use command HALT, which will cause
restart of all running tasks.
4.2.3.CLOSE Command
Command Interpreter quits upon CLOSE command. If there is no recognized
command typed till one minute after OPEN command, the Command Interpreter
will close on inactivity timeout automatically.

CLOSE
Command mode ended

Status Commands
Status of the logger can be reported using following commands:

48
AMS 111 IV USER’S GUIDE

4.1.1.PROTO Command
The PROTO command shows actual list of reports logged by each of the running
tasks. Basic message informs about logger startup status.

4.1.2.TIMELIST Command
The command provides detailed information about running tasks status.
TIMELIST command shows status for all running tasks. It displays how many
tasks are currently running at the system and how much time was dedicated
to IDLE task (i.e., no activity task). All other tasks have calculated their
processor time and information about the stacks.

TIMELIST

SystemT: 2:14:18.886 99.99988% 99.99988% FreeStack:0180 UsedStack: 83% P:00


Idle: 0:43:54.054 32.68505% 0.00025% FreeStack:1136 UsedStack: 5% P:00
0.Task: 0:00:00.317 0.00393% 0.01570% FreeStack:0496 UsedStack: 59% P:64
1.Task: 0:01:03.652 0.78984% 0.00130% FreeStack:0112 UsedStack: 91% P:12
2.Task: 0:00:18.910 0.23465% 0.00036% FreeStack:0896 UsedStack: 25% P:03
3.Task: 0:58:00.415 43.18724% 2.44828% FreeStack:1688 UsedStack: 30% P:02
4.Task: 0:00:00.225 0.00279% 0.00000% FreeStack:1080 UsedStack: 10% P:20
5.Task: 0:00:00.000 0.00000% 0.00000% FreeStack:1048 UsedStack: 12% P:03
6.Task: 0:00:15.999 0.19853% 0.00000% FreeStack:0912 UsedStack: 24% P:18
7.Task: 0:00:00.097 0.00120% 0.00294% FreeStack:0808 UsedStack: 53% P:05
8.Task: 0:01:07.256 0.83456% 0.00000% FreeStack:0608 UsedStack: 49% P:13
9.Task: 0:00:04.040 0.05013% 0.00334% FreeStack:0864 UsedStack: 50% P:03
13.Task: 0:00:02.584 0.03206% 0.00000% FreeStack:0960 UsedStack: 20% P:03
14.Task: 0:00:00.000 0.00000% 0.00000% FreeStack:1048 UsedStack: 12% P:08
15.Task: 0:00:00.001 0.00001% 0.00000% FreeStack:0752 UsedStack: 42% P:04
16.Task: 0:00:00.000 0.00000% 0.00000% FreeStack:0968 UsedStack: 19% P:03
17.Task: 0:00:21.381 0.26531% 0.01871% FreeStack:0032 UsedStack: 97% P:17
18.Task: 0:27:02.341 20.13106% 0.00007% FreeStack:0792 UsedStack: 34% P:50
19.Task: 0:00:00.297 0.00369% 0.00000% FreeStack:0864 UsedStack: 28% P:09
20.Task: 0:00:03.609 0.04478% 0.00000% FreeStack:1072 UsedStack: 10% P:10
21.Task: 0:00:04.720 0.05857% 0.00000% FreeStack:1080 UsedStack: 10% P:11
22.Task: 0:00:00.136 0.00169% 0.00000% FreeStack:4456 UsedStack: 3% P:02
23.Task: 0:01:11.508 0.88732% 0.00002% FreeStack:0656 UsedStack: 45% P:03
OffTime: 0:00:41.116 0.51019% 0.00000%
RtxExec: 0:00:06.228 0.07728% 97.50890% FreeStack:0000 UsedStack: -1% P:00
IntLate:0 MemFreeAll:84810 MemFreeBlkMax:59251 MemFreeBlkCount:2.
OK

Information about Variables and Setting


Variables in the logger create the basic configuration. Configuration
differentiates between variables stored in non-volatile memory and other
variables that are updated only during run of the application software.
However, the access from the user interface is identical.

49
AMS 111 IV USER’S GUIDE
4.2.1.GET, GETC, GETI, GETF, GETS, GETH Commands
For actual status of the variable, a GET command and its modifications GETC,
GETI, GETF a GETS are used. Individual modifications work with type bounded
variables CHAR, INTEGER, FLOAT and STRING. GETH command is available
to get binary data in hexadecimal form. To get also the validity information use
suffix V to any of the modifications of this command (e.g., GETV, GETRV or
GETRHV, etc.)

Example of GET command usage:


GET ATEMP
Valid: 1 , Status: 0
0.3146973000

GETH ATEMP
Valid: 1 , Status: 0
3E A2 04 00
Length: 4.

Example of GETF command usage:


GETF ATEMP
Valid: 1 , Status: 0
0.3146973000
Example of GETS command usage:
GETS SNAME
Valid: 1 , Status: 0
LZIB

Example of GETV command usage (validity 79 seconds):


GETV mWS1A
Valid: 1 , Status: 2
79 0.0010000000

The variable name can contain wildcard * which replaces parts of the variable
name.
GET MWS1*
mWS1Akph 0.0036000002
mWS1A 0.0010000000

50
AMS 111 IV USER’S GUIDE

mWS1X 0.0010000000
OK

4.2.2.GETR, GETRC, GETRI, GETRF, GETRS Commands


To display actual status of the variable repeatedly (every 1 second), a GETR
command and its modifications GETRC, GETRI, GETRF a GETRS are used.
Individual modifications work with type bounded variables CHAR, INTEGER,
FLOAT and STRING. Press any key to stop the listing. After the listing being
stopped, command interpreter displays OK message.

Example of GETRF command usage:


GETRF ATA1
0.3209534000
0.3209534000
0.3196716000
0.3196716000
0.3196716000
0.3196716000
0.3196716000
0.3188477000
0.3188477000
0.3188477000
OK

Example of periodic command with multiple responses (wildcard used):


GETR MWS*
mWS1Akph 0.0036000002
mWS1A 0.0010000000
mWS1X 0.0010000000
***
mWS1Akph 0.0036000002
mWS1A 0.0010000000
mWS1X 0.0010000000
***
mWS1Akph 0.0036000002
CANCELED...
OK
Example of periodic response with validity and wildcard:
GETRHV MWS*
mWS1Akph 78 0.0036000002

51
AMS 111 IV USER’S GUIDE
mWS1A 76 0.0010000000
mWS1X 76 0.0010000000
***
mWS1Akph 76 0.0036000002
mWS1A 75 0.0010000000
mWS1X 75 0.0010000000
***
mWS1Akph 75 0.0036000002
mWS1A 74 0.0010000000
mWS1X 74 0.0010000000
***
mWS1Akph 0.0036000002
CANCELED...
OK

4.2.3.SET, SETC, SETI, SETF, SETS Commands


Variable value settings are provided through similar commands SET, SETC,
SETI, SETF and SETS. The new value is set after the equals (=) character. The
variable name must be full, wildcards are not allowed here.

Example of SETF command usage:


SETF GLOBSENS=0.01124
OK

File Management Commands


AMS 111 IV enables storage of the data into multiple files and to various virtual
“memory discs”. Memory discs are created from Secure Digital (SD) memory
cards. External SD card is recognized in system as Disk M (in Linux file system
/media/mmcblk0p1), USB Mass storage device is recognized as disk H
(/media/sda1). The maximum capacity is limited by the type of file system used.
The supported file systems are FAT16, FAT32. The operating system is able
to read NTFS, but no write is available. It is possible to use capacity up to 2TB,
if the SD card uses correct file system.
4.3.1.FORMAT Command
Before the first usage of memory card this must be formatted using FORMAT
command to create the file structure. File structure is compatible with structure

52
AMS 111 IV USER’S GUIDE

used in Microsoft operating system (FAT16, optionally FAT32), what enables


easy data transfer to personal computers or systems supporting this disk
format.
4.3.2.DIR Command
The DIR command shows a directory listing of the files on disk together with
information of its size and last modification time. There is an additional
information about the disk capacity (total, usable, used, and free) and actual
block size at the end of listing.

DIR M:
Disk M DIR:
080220.LOG 7150 8. 2.2020 23:50:10
BV0220.LOG 2587 14. 2.2020 11:00:00
010220.LOG 18460 1. 2.2020 23:50:10
020220.LOG 18720 2. 2.2020 23:50:10
030220.LOG 18720 3. 2.2020 23:50:10
050220.LOG 40526 5. 2.2020 23:59:04
060220.LOG 66240 6. 2.2020 23:59:04
070220.LOG 66240 7. 2.2020 23:59:04
080220.LOG 38692 8. 2.2020 14:40:10
090220.LOG 18720 9. 2.2020 23:50:10
100220.LOG 18720 10. 2.2020 23:50:10
110220.LOG 7020 11. 2.2020 23:45:10
130220.LOG 5535 13. 2.2020 23:45:10
140220.LOG 6345 14. 2.2020 11:30:10

Number of files: 14 Size of files: 9968936 Free Bytes:


1014005760
OK
4.3.3.COPY Command
The files can be copied from one disk to another using COPY command.

COPY M:\090220.LOG C:\090220.LOG

Copying M:\090220.LOG -> C:\090220.LOG


OK

File copy progress is indicated by sign ‘.’ (dot).

53
AMS 111 IV USER’S GUIDE
4.3.4.DEL Command
Obsolete files can be erased using DEL command.

DEL M:\080220.LOG
Deleting file M:\080220.LOG ... Are you sure ? (Yes/No/All)
OK

During normal logger operation, while data are stored into files automatically,
there is no need to erase the files manually. Application software takes care of
them and deletes files automatically on circular base (oldest first).
4.3.5.TYPE Command
File content is displayed using the TYPE command. This operation can take up
to several minutes in case the file size is long, therefore press of any key during
listing will terminate this command.

TYPE M:BV0220.LOG
0.01
01-01 0.01
01-02 0.01
01-03 0.01
OK
4.3.6.XMODEMW and XMODEMR Commands
These commands are used for file transfer from/to logger disks. XMODEMW writes
the file to the disk of the logger and XMODEMR reads the file from disk of the
logger.

These commands are used for logger configuration upload or download – in


this case no parameter for file name is given. Configuration upload is
irrevocable as this operation rewrites previously stored configuration.

Example of XMODEMR command usage:

XMODEMR M:220222.MLG
Waiting for XMODEM receive.

54
AMS 111 IV USER’S GUIDE

After this command you should start file receive on terminal program using
XMODEM transfer protocol (procedure depends on particular terminal
application). After successful transfer negotiations the screen looks similar to
following screenshot from Hyperterminal (a standard Windows communication
application):

Figure 29: Xmodem receive in hyperterminal

After successful file transfer, the logger displays message:

XMODEM: Data send.

The usage of XMODEMW command is similar:

XMODEMW G:MEAS.TXT
Waiting for XMODEM transfer.
CCC
XMODEM: Data received.

NOTE: if the destination file exists, the XMODEMW command


appends new data in the end of existing file. If this is not desired,
delete the destination file first.

55
AMS 111 IV USER’S GUIDE

NOTE: The file size will be rounded to entire 128-byte block (that’s
why the same logger file and PC-file may appear different sizes)

Maintenance Commands
Maintenance commands enable user to restart the logger, and to manipulate
the configuration. Moreover, a special usage of serial ports is possible via
maintenance commands.
4.4.1.HALT command
Command HALT 1 causes software restart of the logger.

Example of HALT 1 command usage:

HALT 1
HALTED !

Soon after this the logger is software-restarted and an invitation message


appears:

MICRO LOGGER START

NOTE: The HALT 1 command can be even used to restart the


logger remotely (via modem). Any changes in the configuration and
software performed before logger reset will take effect, therefore in
case of misconfiguration the logger may stop answering.

CAUTION: In case of modem misconfiguration the logger may stop


communicating through the modem even when the connection is
not dropped.

56
AMS 111 IV USER’S GUIDE

HALT command arguments:

Command What happens

HALT 0 Only the backend application is restarted

The whole data logger is restarted (measurement


HALT 1
processor and Linux module)
Only the Linux module is restarted, the measurement
HALT 2
processor remains running
Only the Linux module is restarted and then the TFT
HALT 3
touch screen calibration tool is started.
Table 3: Various restart modes

4.4.2.TERMINAL Command
The TERMINAL command enables the so-called pass-through mode – i.e. a
connection to any serial line via currently connected service line. In this way, it
is for example possible to check the state of the modem connected to any serial
line of logger, or eventually to communicate with the connected device directly.

The command TERMINAL is used with some parameters:

TERMINAL SNUM BAUD BITS STOPB PAR FLOW

where:
SNUM number of communication line

BAUD Baud rate (if serial communication is used)

BITS number of data bits (7 or 8)

STOPB number of stop bits (1 or 2)

PAR parity (0-none, 1-odd, 2-even)

FLOW checking of dataflow (0 – none, 1 – hardware)

57
AMS 111 IV USER’S GUIDE
Example of TERMINAL command usage:

TERMINAL 8 9600 8 1 0 1
To close TERMINAL type ^X ^X ^X

Serial line 8 is opened (SNUM = 8), on baud rate 9600 bauds, 8 data bits, 1
stop bit, without parity, with hardware checking of dataflow. The selected
port is RS232 – 0 on main board. See the Table 4 below for the list of
available serial lines.

It is necessary to close the terminal mode after the working with the serial line
is finished. To do so, press Ctrl + X + X + X on keyboard. Following message
appears:

Terminal closed

NOTE: To communicate through the respective serial line, the user


must know the serial line parameters before issuing the command.
If the serial line is already defined in the configuration, then the only
required parameter is the snum parameter. If the TERMINAL
command is issued with wrong parameters, the user is not able to
communicate with the device connected to the respective serial
line. However, after the terminal is closed, the original settings of
the line are restored automatically and the application
communicating through the serial line continues operation.

Number assignments of the logger serial lines:


Line
Communication port
number
RS3232 port on Processor module
0
/dev/ttyLP0
Internal GSM, GPRS, 3G 4G or Wi-Fi module
1
/dev/ttyLP2

58
AMS 111 IV USER’S GUIDE

Line
Communication port
number
TTL level serial line
2
/dev/ttyLP1

3 USB Virtual serial line

4-6 Reserved

7 Com. line with CLI MCU Main board

8 RS232 – 0 port on main board

9 RS232 – 1 port on main board

10 RS485 – 0 port on main board

11 RS485 – 1 port on main board

12 Synchronization port

13 SDI-12 – 0 port on main board

14 SDI-12 – 1 port on main board

15 Reserved

16-31 Virtual serial line defined through TCP/UDP


Table 4: List of communication lines

4.4.3.STTY command
STTY command displays actually configured serial lines and its parameters.
The order and meaning are the same as in the TERMINAL command. See 4.4.2.

STTY
0: 115200 8 1 0 0
1: 115200 8 1 0 0
8: 115200 8 1 0 0
9: 115200 8 1 0 0
10: 115200 8 1 0 0

59
AMS 111 IV USER’S GUIDE
Linux console
The Linux console is accessible over SSH and USB. To log in to the data
logger use one of the provided user accounts with their factory default
passwords:

User name Password Role

root rootP4 super user

regular user
user userP4 display password, SSH
forbidden

ftpuser ftpuserP4 FTP server user


Table 5: Linux users and their default passwords

4.5.1.Change password
We recommend you to change the default passwords to a safe one, especially
if the data logger is exposed to the public network. To do so, you need to first
log in as the user and execute passwd command. You will be prompted to
enter the new password twice. The password for username “user” can be
changed over TFT Display and is used as a password protection of the screen.

Lua scripts
The data logger software is capable to extend its functionality with Lua
modules, which are tied to some events in the configuration. Lua modules are
located in the directory /home/user/picolo4modules/. Each module has a
directory with descriptive name and inside a file named main.lua. To create
these Lua modules, see the document [3] Lua modules.
If a Lua module should be disabled, delete or rename the main.lua file to
different name, for example: main.lua.disabled.

60
AMS 111 IV USER’S GUIDE

61
AMS 111 IV USER’S GUIDE

5. General settings
Modems
Proper operation of the modem requires initial setting of necessary
parameters. It’s recommended to store most of the parameters directly in the
modem configuration. When it’s necessary to supplementarily change the
modem configuration, this can be set to variables of the logger.
The modem communication is done by PPP Daemon (pppd). See chapter 6.2
describing the operations with Linux services.
The configuration files are located under /etc/ppp/. The first line in file
/etc/ppp/options-mobile is the serial line of Linux, where the modem is
connected. See Table 4 to find the path to this device in Linux.

NOTE: Only those serial lines are supported, which are directly
connected to the Linux module. These are ttyLP0, ttyLP1, ttyLP2.

There is a built-in auto restart feature of the modem, if the connection is not
established correctly (watchdog). It cycles the power for the modem when a
problem is detected. This watchdog is prepared for the internal modem and no
action is needed if the internal modem is used. However, if an external modem
is used, there is a script in Lua language, which can restart the power of this
modem if the connection is not correct.
5.1.1. Single SIM mode
Single SIM mode is used, if either file is missing from these following two files:
/etc/ppp/chatscripts/mode.SIM1
/etc/ppp/chatscripts/mode.SIM2
In this case, the switching algorithm will use the fixed files or symbolic links
under these paths:
/etc/ppp/chatscripts/apn
/etc/ppp/chatscripts/mode
/etc/ppp/chatscripts/pin
/etc/ppp/peers/provider

63
AMS 111 IV USER’S GUIDE
See 5.1.3 what should these files (or the files where the symbolic links point)
contain. If symbolic links are used, use ls -l command to see where it points
to.
5.1.2. Dual SIM mode with switching algorithm
The data logger has a support for switching the SIM cards of the modem with
this switching ability (AMS111 Connect). The algorithm will decide which SIM
is being used, but the configuration of both SIM cards needs to be prepared
separately for each SIM. You may need to edit the following files:
/etc/ppp/chatscripts/apn.SIM1
/etc/ppp/chatscripts/apn.SIM2
/etc/ppp/chatscripts/mode.SIM1
/etc/ppp/chatscripts/mode.SIM2
/etc/ppp/chatscripts/pin.SIM1
/etc/ppp/chatscripts/pin.SIM2
/etc/ppp/peers/provider.SIM1
/etc/ppp/peers/provider.SIM2

The switching algorithm will make symbolic links to SIM1 or SIM2 files
automatically. The dialer doesn’t use these files directly, but rather the
symbolic links without .SIMn file extension.
5.1.3. Common modem settings
The paths described in previous sections contain the AT commands which are
used during initialization of data call. Here is the explanation of the content. It
is possible to edit these files using a file editor in Linux (see chapter 6.1).

NOTE: If you change the settings, the service pppd must be


restarted using systemctl restart pppd command. See
chapter 6.2.

CAUTION: If you are making changes remotely over PPP


connection, then there is a risk of breaking the connection in case
of misconfiguration. You may lose the access to the data logger.

File /etc/ppp/chatscripts/apn

64
AMS 111 IV USER’S GUIDE

This file contains the AT command for setting up the connection. The dialer will
always try to dial the profile number 1 (first argument in the AT command)
Example content to set APN to internet:
AT+CGDCONT=1,"IP","internet"

File /etc/ppp/chatscripts/mode

This file contains the commands for switching the SIM card to selected mode.
If nothing is needed (modem with one slot, or internal modem), the content
may be simply AT without any argument. Example content:
AT#GPIO=6,1,1,1

File /etc/ppp/chatscripts/pin

This file contains the AT command for unlocking the PIN code. If no PIN code
is used, leave the content to AT only. We recommend to disable the pin code.
File /etc/ppp/peers/provider
This file contains the main settings of dialing. Only change the user command
if the PPP connection is with authentication. The commented-out line begins
with character hash #. Example content:
file /etc/ppp/options-mobile
#user xxx@yyyy
connect "/etc/ppp/peers/dialer"

If the user is set up, then the corresponding password must be defined in the
file /etc/ppp/chap-secrets or /etc/ppp/pap-secrets

Example content of pap-secrets file:

# Secrets for authentication using PAP


# client server secret IP addresses
#xxx@yyyy * "pass" * # SIM1

To enable that user, uncomment the last line and change the user name to the
same as in the provider file, and change the pass with the actual password.
The first asterisk character (*) is a restriction to use the password only to the

65
AMS 111 IV USER’S GUIDE
provided server. If * is used, then the credentials will be used against any
server. If you know the server, replace the asterisk with the server. After these
settings the data logger will try to authenticate itself with these credentials.

Data Logging
Predefined disk for data logging is set into variable LOGDRIVE.
SETS LOGDRIVE=M
OK
GETS LOGDRIVE
Valid: 1, Status: 0
M

Automatic Command Mode Termination


Command mode is automatically terminated if no recognized command is
issued till defined timeout. Inactivity timeout is set into variable CMDTOUT with
250ms resolution. For one-minute inactivity timeout the variable should be set
as 240 (240 * 0,25s = 60s).

SETI CMDTOUT=240
OK

In case that inactivity timeout is set for less than 25 seconds, the value is
ignored and minimum timeout of 25 seconds is used.

Virtual Serial Lines


5.4.1.TCP Server
The command enables to configure a virtual serial line which is handled as
TCP port by the data logger. Following command defines such a virtual line 16
on port 4001:
SETS VIRTUALCOM16=TCP:0.0.0.0:4001
OK

5.4.2.TCP Client
The command enables to configure a virtual serial line which is handled as
TCP port on other device with defined IP address. Following command defines
such a virtual line 16 at address 192.168.145.240 on port 4001:

66
AMS 111 IV USER’S GUIDE

SETS VIRTUALCOM16=TCP:192.168.145.240:4001
OK

5.4.3.UDP
The command enables to configure a virtual serial line which is receiving data
at UDP port on data logger, and sends the data to UDP port of other device
address. Following command defines such a virtual line 16 receive/send port
4001 and send address 192.168.145.240:
SETS VIRTUALCOM16=UDP:192.168.145.240:4001
OK

Ethernet
It is necessary to set up the IP address of the Ethernet interface before
connecting to Ethernet:
SETS ETHMYIP=192.168.145.100
OK

In case that data logger is supposed to operate not only on LAN but will also
be accessible through a router, it is necessary to set the gateway:
SETS ETHDEFGTW=192.168.145.254
OK
It is also possible to redefine network mask:
SETS ETHNETMASK=255.255.255.0
OK
It is possible to define primary and secondary DNS server:
SETS ETHPRIDNS=10.21.2.1
OK
SETS ETHSECDNS=10.22.2.1
OK

In case the default MAC address needs to be redefined please use following
settings:
SETS ETHMAC=DC-1D-D4-00-00-00
OK

67
AMS 111 IV USER’S GUIDE
NOTE: Each data logger has a unique MAC address assigned. If
the ETHMAC variable is empty, then it uses the globally unique
MAC address. This can be verified in PROTO command

68
AMS 111 IV USER’S GUIDE

69
AMS 111 IV USER’S GUIDE

6. Linux commands
In this chapter we describe few of standard Linux commands, available in the
data logger.

Editing files in console


To edit the content of a file you have two built-in text editors, use the one you
are more familiar with.
6.1.1. Using vi editor
To open a file, use the command “vi <file name>”. Example:
root@colibri-vf:/etc/ppp# vi options-mobile

After you opened the file, you cannot directly write to it. You have to switch to
the INSERT mode by pressing character “i”. You can see the actual mode in
the last line of window (first character in the line). To switch back to “no mode
selected” press ESC key.
This is without selected mode (-):
- options-mobile 1/19 5%
This is insert mode (I):
I options-mobile 1/19 5%

In insert mode you can write the content and use arrow keys to navigate in file.
Once finished the modification, leave the insert mode by pressing ESC. You
can enter a command by pressing colon (“:”) key, then one of few available
commands.
Examples of commands:
:w write the changes to file, leave file open
:q quit the application. This will fail if there were changes to the file.
:q! quit the application. Any unsaved changes are discarded.
:wq write the changes and then quit the application.

71
AMS 111 IV USER’S GUIDE
You can find more details on web:
https://man7.org/linux/man-pages/man1/vi.1p.html

6.1.2.Using joe editor


To open a file, use the command “joe <file name>”. Example:
root@colibri-vf:/etc/ppp# joe options-mobile

The file is editable after open, so you can make the required changes. Then to
save the file press CTRL+K+X (CTRL + K followed by CTRL + X)

To exit without saving the changes, press CTRL+C. If there were changes you
can confirm losing changes by pressing character “y”. For more details press
CTRL+K+H to open help. You can hide the help panel by repeating the same
command.

Managing services
The Linux in data logger is using “systemd” system, so to manage the services
use command systemctl. This command requires root privilege.
There are multiple services preinstalled, their state may be inspected by
issuing the command:
systemctl status <service name>
Each service may be active or not active, you can control this by issuing
command to start, stop or restart the service. Example of commands:
systemctl start pppd
systemctl restart pppd
systemctl stop pppd

In addition to actual state, you may control the state after system restart. To
allow to start the service after system startup you must to enable it. Example:
systemctl enable pppd
systemctl disable pppd

The actions of the service are stored in the service file which are stored here:
/etc/system/system/<service name>.service

72
AMS 111 IV USER’S GUIDE

If you modify the service file and you want to try to start the service with
modified file, then you must first reload the systemctl daemon, with command:
systemctl daemon-reload

If you modified also the order of execution of the service, it is recommended to


disable the service and enable it again. It will recreate internal symbolic links.

Showing service outputs


The services are applications which may produce some output, which are
useful for debugging if there are problems with that service. The services are
not running directly in console, so their output is redirected to a n application,
which manage messages. To show the output of a service enter the following
command:
journalctl -u <service name>

In this view you will see the response of the service. To navigate in this list,
you may use arrows Up, Down, PgUp and PgDown. To go to the beginning
of the log press g, to go to the end of the log press Shift+G. Jumping to end
of long files may take a while. To stop the command press q or Ctrl + C.
If you want to see the real time update of the end of the log file, add f flag to
command:
journalctl -fu <service name>

Example response:
Feb 21 03:32:59 colibri-vf pppd[25156]: Connect script failed
Feb 21 03:32:59 colibri-vf start.bash[25144]: Script
/run/pppd/peers/dialer finished (pid 25436), status = 0x3

To stop the command press Ctrl + C.

73
AMS 111 IV USER’S GUIDE
Here is a list of some used services:

Service name Description


picolo4back The main application (back-end)

picolo4front The GUI application of color TFT


display (front-end)
pppd Point to Point protocol daemon –
GPRS data connection of data logger
vsftpd FTP server

systemd-timesyncd NTP synchronization service

systemd-resolved DNS lookup service

Table 6 : Available services

Other Linux commands


List of Linux commands which are useful when working with datalogger:

Command Usage
cd change directory, navigation

ls show the contents of the directory

cat writes the whole content of the file to console

head writes the beginning of the file to the console

tail writes the end of the file to the console.

grep filters the output of anything (contents of file,


messages of other applications etc.)
rm remove files or directories

cp copy files or directories

mv move or rename files

74
AMS 111 IV USER’S GUIDE

ln create links (or symbolic links -s) to a file

kill stop application

ifconfig network settings, IP address

ping ICMP request to another device

netstat network statistics, list of active connections and


active ports to listen
df file system disk space usage

du estimate file space usage

Table 7 : Basic Linux commands

For more details about usage and parameters you can find documentation
online. There are plenty of Linux command cheat sheets.

75
AMS 111 IV USER’S GUIDE

7. Troubleshooting
The state of the logger software can be determined within help of the
Command mode commands. User is required to provide the speed that the
corresponding serial port is set to.

Inaccessible Command Mode


Use the escape sequence during the start of a system, if there are problems
to start the Command mode even when the serial port speed is assumed to be
right.
After the starting of the data logger software is completed (approximately 10
seconds), all processes are ready to work, except the reading of the
configuration, which takes an additional 5 seconds. This state is indicated on
Main Board RS232 port with question mark output listing. The setting of this
RS232 serial port is (regardless of the definition in configuration) always
115200 bauds, 8 data bits, 1 stop bit, no parity. When the question mark is
returned, user has 5 seconds to login to the Command mode. Afterwards the
user can record the new configuration.

Inaccessible Linux
If the Linux is not accessible because during the boot there is a critical error,
which requires manual intervention, then you can use the RS232 port to enter
to the Linux console. This console is by default disabled, to be available as a
serial line for users. To enable this line if you have no other possibilities (SSH
and USB is not yet started, because of critical system error) you can use the
following procedure:
You will need RS232 converter (with female-to-female DB-9 cable).
1. Open this serial line (baud 115200) in a terminal program, be prepared to
enter the # character once the data logger is powered on. You can write it
many times while the logger is turned off.

77
AMS 111 IV USER’S GUIDE
2. Turn the data logger on and write # character to data logger until it
responds with Colibri VFxx # prompt. When this happens, you are in the
bootloader application UBoot.
3. Enter command: setenv console ttyLP0
4. Enter command: reset
5. The data logger restarts, but the console is now enabled on this serial line.
Wait until the OS starts to load. You will have access to Linux console and
you may try to fix the problems with the Linux startup
6. When finished, repeat steps 1 and 2, to get again into the bootloader.
7. Enter command: setenv console null
8. Enter command: reset

Problem Identification Commands


The software reports hardware and software problems with error messages.
Use PROTO command to list these messages. The output of PROTO
command is useful and intended for an appropriate specialist, according to the
problems indicated in equipment. Therefore, in case of problems, it is
recommended to send (e.g., by e-mail) the output of this command for further
analysis. Simply use clipboard to copy the selected text (Ctrl + C) and paste it
(Ctrl + V) to the desired e-mail text editor.

Repeat the same steps for TIMELIST command, which listing is necessary,
too.
If you have problems with some of the Linux services, then copy the messages
from the journalctl command (see chapter 6.3).

78
AMS 111 IV USER’S GUIDE

References
[1] AWS Service User's Guide, MicroStep-MIS, 2015
[2] AWS Setup User's Guide, MicroStep-MIS, 2015
[3] Lua modules, Reference guide, MicroStep-MIS, 2019

Register
Command SETF, 52
#MICRO#, 47 SETI, 52, 66
CLOSE, 48 SETS, 52, 66
DATE, 48 TERMINAL, 57, 58, 59
DEL, 54 TIMELIST, 49
DIR, 53 TYPE, 54
GET, 50 VER, 48
GETC, 50 XMODEMR, 54
GETF, 50, 51 XMODEMW, 54, 55
GETI, 50 Ethernet, 12, 67
GETR, 51 Linux, 60, 63, 71, 74, 77
GETRC, 51 joe, 72
GETRF, 51 journalctl, 73, 78
GETRHV, 51 systemctl, 72
GETRI, 51 vi, 71
GETRS, 51 Modem, 63, 64
GETS, 50, 66 USB, 12, 13
HALT, 48, 56, 57 Variable
PROTO, 49 CMDTOUT, 66
SET, 52 LOGDRIVE, 66
SETC, 52 VIRTUALCOM, 66, 67

79

You might also like