Looking for a guide how to get started with LTE on Mervis IDE? Please see this tutorial, otherwise continue here.
This manual refers to the LTE series of Patron and Edge units - currently S167, M267, M567, E410*, E412* and E413*.
Note:
*LTE is optional.
systemctl status unipi-lte
* unipi-lte.service - LED indication of embedded GSM/3G/LTE module status
Loaded: loaded (/lib/systemd/system/unipi-lte.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-07-20 07:57:07 UTC; 9min ago
Main PID: 393 (python3)
Tasks: 1 (limit: 796)
Memory: 16.6M
CGroup: /system.slice/unipi-lte.service
`-393 python3 /opt/unipi/tools/unipi-lte.py
Note:
If the operator uses the APN value internet and the SIM card is not protected by a PIN, there is no need to set anything and you can skip following steps.
sudo mc -e /etc/unipi/lte.conf
pin: 1234
internet: apn: "internet"
Note:
In older lte.conf versions parameter connection_type was included in apn. If you are using older version without connection_type parameter, it is necessary to set the apn parameter in the following format: apn: “IPV4V6”,“internet”
sudo systemctl restart unipi-lte
Note:
Be patient, registration to the mobile network can take several minutes. When registered, NET LED lights up.
Service and related packages can be updated by:
sudo apt update
sudo apt install unipi-kernel unipi-os-configurator unipi-os-configurator-data unipi-lte
Note:
To flash an old OS image or backup of OS to Patron unit with LTE in revision FID 2.0+, it is necessary that it includes LTE package in version 0.64 or newer and it's dependencies in compatible versions.
We recommend to update the packages on Patron in revision FID 1.x and then create a backup of OS with updated packages, which can be flashed on the newer Patron units.
Package version can be displayed with:
dpkg -s unipi-lte | grep Version
The lte.conf configuration file is available in the /etc/unipi/ directory. Editing the file is possible e.g. with MidnightCommander:
mc -e /etc/unipi/lte.conf
This file is divided into three sections, some settings (auto_keepon, autoswitch, Log File) are described in detail in separate chapters.
Note:
In older lte.conf versions parameter connection_type was included in apn. If you are using older version without connection_type parameter, it is necessary to set the apn parameter in the following format: apn: “IPV4V6”,“internet”
internet, this value can be different and is determined by the operatorThe auth_method and usbmode parameters are not used and are present only for backward compatibility.
Logs are stored in the log file for debugging and possible troubleshooting. For a detailed description of the log file, see the Log File chapter.
When Autoswitch feature is enabled (default state), service unipi-lte automatically selects the default network gateway based on WAN availability on the primary/backup network interface. By default, the primary network interface is fixed Ethernet (eth0) and the LTE interface is the backup connection. The Linux routing table must always contain the default routing for both interfaces. If there is a need to switch between the primary and backup interfaces, the unipi-lte service will automatically increase/decrease the LTE interface metric.
metric 0. The static configuration can be configured via systemd-networkd. The Autoswitch feature can be disabled in the configuration file in the PING section of the unipi-lte service. Feature is turned on/off by setting the values true/false.
The auto_keepon feature is also available, which automatically enables the LTE network interface when it is accidentally disabled (e.g. by an ifdown command). In this case, the feature re-enables the interface (ifup) and updates the routing table entries. The feature is enabled by default and can be disabled in the configuration file in the MAIN section.
The log file is invaluable for debugging. By default, all relevant logs from unipi-lte are stored in syslog. The location and severity of the logs can be set in the configuration file in the LOG section.
Example of log file
2023-07-25 08:33:00,047 - INFO - unipi-lte version 0.36 from 2023-03-14 10:19:01 - Logging started..
2023-07-25 08:33:00,052 - INFO - Running on Patron series, model: S167
2023-07-25 08:33:01,067 - INFO - Created/corrected wwan0 iface file
2023-07-25 08:33:02,143 - ERROR - Incorrect or undefined password (PIN). Going to sleep...
2023-07-25 08:33:02,144 - WARNING - Daemon halted forever...must be restarted manually 3
2023-07-25 08:36:06,945 - INFO - Exiting after received signal 15
2023-07-25 08:36:18,065 - INFO - unipi-lte version 0.36 from 2023-03-14 10:19:01 - Logging started..
2023-07-25 08:36:18,071 - INFO - Running on Patron series, model: S167
2023-07-25 08:36:19,084 - INFO - Created/corrected wwan0 iface file
2023-07-25 08:36:20,597 - INFO - Pin resolved
2023-07-25 08:36:36,942 - INFO - Modem init complete
2023-07-25 08:36:37,546 - INFO - Registered to: O2.CZ Network type: 7 RSSI: 31 Sigqual: 99
2023-07-25 08:36:40,562 - INFO - WAN IP ADDRESS: 100.71.129.7 INTERFACE IP ADDRESS: 100.71.129.7
2023-07-26 08:36:18,370 - INFO - RSSI: (MIN 21, MAX 31, AVG 25), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {6} PING_COUNT: 1727 PING_SUCCESS_RATIO: 99.94
2023-07-26 21:55:06,956 - INFO - Ping failure threshold reached 3 on main eth0.Switching to backup wwan0...
2023-07-26 22:06:48,490 - WARNING - Routing table metric mismatch A (changed by other application?), re-setting... 203 202
2023-07-26 22:21:49,183 - WARNING - Routing table metric mismatch A (changed by other application?), re-setting... 203 202
2023-07-26 22:36:47,974 - WARNING - Routing table metric mismatch A (changed by other application?), re-setting... 203 202
2023-07-26 22:47:38,255 - INFO - Main interface eth0 becomes available, switching to it
2023-07-27 08:36:25,783 - INFO - RSSI: (MIN 17, MAX 31, AVG 23), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {4, 6} PING_COUNT: 1727 PING_SUCCESS_RATIO: 99.36
2023-07-28 08:36:33,574 - INFO - RSSI: (MIN 18, MAX 31, AVG 24), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {6} PING_COUNT: 1726 PING_SUCCESS_RATIO: 99.94
2023-07-29 08:36:41,673 - INFO - RSSI: (MIN 21, MAX 31, AVG 24), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {6} PING_COUNT: 1727 PING_SUCCESS_RATIO: 100.00
2023-07-30 08:36:49,334 - INFO - RSSI: (MIN 21, MAX 31, AVG 24), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {6} PING_COUNT: 1727 PING_SUCCESS_RATIO: 99.94
2023-07-31 08:36:57,165 - INFO - RSSI: (MIN 17, MAX 31, AVG 24), SIGQUAL: 99, NET-TYPES: ['7'], USED_MODES: {6} PING_COUNT: 1727 PING_SUCCESS_RATIO: 99.83
By default, NAT is enabled. To turn it off/on, you need to send a specific AT command to the modem via the virtual serial line:
minicom -D /run/unipi-plc/by-sys/lte.1/tty_at1
AT+QCFG="nat",X
Note:
To disable NAT it is necessary to set parameter 1 instead of X, or parameter 0 to enable it.
AT+QCFG="nat/cid",0xYY
Note:
To disable NAT it is necessary to set parameter 00 instead of YY, or parameter 7F to enable it.
After sending the command and exiting the minicom program, it is necessary to restart the modem for the settings to take effect. Restart is possible e.g. by unplugging/plugging the power supply of the controller.
Note: The string (AT command) must be entered in the exact format, including case sensitivity. A proven method is, for example, to copy the entire AT command string and then paste it into the terminal window running minicom.
Note on minicom: To exit the minicom, press the CTRL+A key combination, followed by the Q key, which brings up a dialog where you still need to confirm the exit.
If you are using PPP for your application and therefore do not want a unipi-lte solution, we also recommend that you disable unipi-lte and remove the network interface definition.
sudo systemctl stop unipi-lte sudo systemctl disable unipi-lte
Attention:
This section refers only to Unipi units equipped with GNSS capable modem.
All GNSS AT commands and mapping of GNSS virtual serial line can be found in port mapping of the relevant Unipi unit. The antenna for the GNSS must be connected to the LTE DIV connector.
Configuration of GNSS can be done via virtual serial line tty_at1 similar to NAT configuration. Only difference is used AT commands:
AT+QGPSPOWER=1
AT+QGPSPOWER=0
AT+QGPSCFG="setting",value
for available settings see AT commands documentation.
AT+QGPS=1
AT+QGPSEND=1
AT+QGPSLOC=2
Note:
Before reading the position for the first time after enabling the GNSS it is necessary to wait for position solution fix. That process of GNSS module can take up to 20 minutes and until its not finished the command will return error code 516.