Professional Documents
Culture Documents
A5 AMS111 IV Linux User Guide en v1.0
A5 AMS111 IV Linux User Guide en v1.0
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
Instructional icons
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
AMS 111 IV USER’S GUIDE
Introduction
1. Hardware
Technical description
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
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.
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)
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.
12
AMS 111 IV USER’S GUIDE
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.
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.
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.
17
AMS 111 IV USER’S GUIDE
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.
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
20
AMS 111 IV USER’S GUIDE
NOTE: If the logger is switched off for more than 1 year, the RAM
data persistence is not guaranteed.
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.
22
AMS 111 IV USER’S GUIDE
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
24
AMS 111 IV USER’S GUIDE
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
Cards installation
The procedure to inserting Micro SIM card is shown on the picture below.
26
AMS 111 IV USER’S GUIDE
The procedure to inserting Micro Secure Digital card is shown on the picture
below.
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.
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.
30
AMS 111 IV USER’S GUIDE
31
AMS 111 IV USER’S GUIDE
Color TFT Display
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
33
AMS 111 IV USER’S GUIDE
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
35
AMS 111 IV USER’S GUIDE
36
AMS 111 IV USER’S GUIDE
37
AMS 111 IV USER’S GUIDE
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
40
AMS 111 IV USER’S GUIDE
41
AMS 111 IV USER’S GUIDE
42
AMS 111 IV USER’S GUIDE
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:
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.
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
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].
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
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
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
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.)
GETH ATEMP
Valid: 1 , Status: 0
3E A2 04 00
Length: 4.
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
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
52
AMS 111 IV USER’S GUIDE
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
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.
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):
XMODEMW G:MEAS.TXT
Waiting for XMODEM transfer.
CCC
XMODEM: Data received.
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.
HALT 1
HALTED !
56
AMS 111 IV USER’S GUIDE
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.
where:
SNUM number of communication line
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
58
AMS 111 IV USER’S GUIDE
Line
Communication port
number
TTL level serial line
2
/dev/ttyLP1
4-6 Reserved
12 Synchronization port
15 Reserved
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:
regular user
user userP4 display password, SSH
forbidden
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).
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
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
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.
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.
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
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
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
73
AMS 111 IV USER’S GUIDE
Here is a list of some used services:
Command Usage
cd change directory, navigation
74
AMS 111 IV USER’S GUIDE
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 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
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