Installation of Cellular Modem (All-in-one Feature)

Information
Cellular modem’s is an optional installation and can be provided on request.

If the Display comes equipped with a cellular modem, such as a 3G or LTE modem, it can act as a telematics device to transmit CAN and sensor data to the cloud. The cellular module also enables the Display to upload log and event-capture files and share geolocation information with the cloud through the internet.

Information
MRS Electronic has a cloud solution that can be used by end users as a portal to stream real-time data from the Display and visualize it using dashboards. For further information, contact MRS Electronic.

Structure

The Display handles the communication and setup with the different GSM modules. Depending on the service provider, distinctive settings for the SIM card’s usage apply. Display supports Micro SIM card (15x12mm) and allows you to create the necessary scenarios for the SIM card setup.

The standard scenario, which is already active, contains the following fields:

Feature Description
SIM authentication PIN and PUK
PDP context configuration APN, Address, Type, etc.
Enable PDP context Enable PDP context Enable the Packet data connection over which a device and the mobile network can exchange IP packets.

Configuration

To apply the configurations, use the /etc/wan-config.conf configuration file:

# General 
SCENARIO="default" 
SIM_PIN=6879 
SIM_PIN2=9988 
SIM_PUK=68514769 
SIM_PUK2=57391908 
# PDP 
PDP_SET=false 
PDP_ENABLE=true 
PDP_CONTEXT=1 
PDP_TYPE="IP" 
PDP_APN="iot.1nce.net" 
PDP_ADDR="0.0.0.0" 
PDP_D_COMP=0 
PDP_H_COMP=0

Technical Fields and Functions Information The following table lists the variables and their description used in the config file above:

Field/Function Description
SCENARIO Custom scenario which should be executed. Read more about it in Scenario Scenario section
SIM_PIN PIN1 of a SIM card
SIM_PIN2 PIN2 of a SIM card
SIM_PUK PUK of a SIM card
SIM_PUK2 PUK2 of a SIM card
PDP_SET Describes whether the PDP setting should be set (Default: false)
PDP_ENABLE Describes whether the PDP context should be activated (Default: true)
PDP_CONTEXT Packet data connection over which a device and the mobile network can exchange IP packets
PDP_TYPE Type of the IP address assigned to the PDP (IPv4 or IPv6)
PDP_APN Identifies the packet data network (PDN) that the user of mobile data wants to communicate with.

GSM Tools

The Display is equipped with essential tools that facilitate communication with the GSM module, help to get information, and to make settings of the module.

GSM Status

The GSM status script is used to attain information about the network. The following table defines the flags to use in the script along with their respective descriptions:

GET

Flag Description
-r Status of network registration
-q Signal quality
-s Information of the serving cell
-h Attain additional information about the script

Following is the method of using flags in the script:

$ wan-status.sh -r -q -s

For additional information about the script, add the -h flag:

$ wan-status.sh -h

To use it in the Reference App via C++, refer to the code below:

#include "wan.h"
int main(int argc, char *argv[])
{ 
	// Initialize GSM library. Optional parameters are described in ReferenceApp
    	wan *m_wan = new wan();
	// Status of network registration
	QString networkRegistration = m_wan-> statusNetworkRegistration();
	// Status of signal quality
	QString signalQuality = m_wan-> statusSignalQuality();
	// Status serving cell
	QString servingCell = m_wan-> statusServingCell();
}

GSM PDP

With the GSM PDP script, it is possible to configure the PDP context. The following table defines the flags to use in the script along with their respective descriptions:

SET

Flag Description
-i PDP context identifier
-t PDP type
-a Access point name
-d PDP address
-c Data compression
-o Header compression
-h Attain additional information about the script

Following is the method of using flags in the script:

$ wan-pdp.sh -i 1 -t IP -a iot.1nce.net

For additional information about the script, add the -h flag:

$ wan-pdp.sh -h

GSM Authentication

GSM authentication script allows to get the status of SIM authentication or to enter the SIM pin. The following tables define the options and the flags to use in the script along with their respective descriptions:

GET

Flag Description
-i SIM PIN authentication status
-h Attain additional information about the script

SET

Flag Description
-s Set required authentication value, such as PIN/PUK
-h Attain additional information about the script

Following is the method of using flags in the script:

$ wan-auth.sh -i
$ wan-auth.sh -s 1234

For additional information about the script, add the -h flag:

$ wan-auth.sh -h

To use it in the Reference App via C++, refer to the code below:

#include "wan.h"
int main(int argc, char *argv[])
{ 
	// Initialize GSM library. Optional parameters are described in ReferenceApp
    	wan *m_wan = new wan();
	// Status SIM authentication
	QString statusSimAuth = m_wan-> simAuth();
	// Set SIM authentication
	m_wan->simSetPIN(“1234“);
}

GSM Communication

GSM communication script allows to send direct commands to the GSM device. The following table defines the flags to use in the script along with their respective descriptions:

SET

Flag Description
-c AT command
-h Attain additional information about the script

Following is the method of using flags in the script:

$ wan-at-command.sh -c AT+COPS?

For additional information about the script, add the -h flag:

$ wan-at-command.sh -h

GSM Restart

GSM restart script allows the restarting of the GSM device. To do so, use the following command:

$ wan-dev-restart.sh

To execute it in the Reference App via C++, use the following code:

#include "wan.h"
int main(int argc, char *argv[])
{ 
	// Initialize GSM library. Optional parameters are described in ReferenceApp
    	wan *m_wan = new wan();
	// Restart the device
	m_wan->deviceRestart();
}

Scenario

The scenario describes a configuration process for the GSM module. When certain processes such as registration of a SIM card with extended parameters are required, scenario can help in its implementation.

Create a Scenario

There are certain rules to create a scenario that are as follows:

  1. Scenario must be a shell script.
  2. Scenario must follow the naming format of {scenario-name}.sh, where scenario-name is the name or description of the scenario.
  3. The created scenario must be placed at the location: /etc/wan.conf.d/{scenario-name}.sh

Example Scenario

This section defines an example of scenario for better understanding. Follow the steps below to create an example scenario:

  1. The scenario enters the PIN for the SIM card.
  2. It is located at /etc/wan.conf.d/enter-pin.sh.
  3. The scenario uses four parameters that can be changed in /etc/wan-config.conf. The example values for the parameters are described in the table below:
Parameter Example Value
Device /dev/ttyACM0
Baud rate 15200
APN context number 1
Interface number of wan 1

Now, enter the following commands to create the scenario:

#!/bin/sh
dev=${1}
baud=${2}
apn_number=${3}
wan_interface=${4}

Execute the scenario using the following commands:

# Execute command 
status=$(wl_command ${dev} ${baud} "AT+CPIN="\"1234\" "Auth") 
echo "${status}"
Information
Note that the wl_command function is part of the **wan-libcmd.sh** script and is already included in the scenario script.

Scenario Configuration

To activate the specific scenario, change the value of the SCENARIO parameter in the /etc/wan-config.conf file. For example, SCENARIO=”enter-pin”.