5 Configuring System

This chapter introduces how to configure system.

5.1 Finding Device IP

Finding Device IP

5.2 Remote Login

Remote Login

5.3 Configuring Storage Devices

Configuring Storage Devices

5.4 Configuring Ethernet IP

Configuring Ethernet IP

5.5 Configuring Wi-Fi (Optional)

Configuring Wi-Fi

5.6 Configuring Bluetooth (Optional)

Configuring Bluetooth

5.7 Configuring 4G (Optional)

User can choose the device with 4G version, which needs to be configured before using 4G network.

Use The NetworkManager Tool To Configure The Network

If you need to connect to a 4G network, you need to create a gsm network connection first. The following configuration is based on different scenarios.

Scenarios Without APN Configuration

If the user's 4G network does not need to be configured with APN, it can be configured according to the following steps.

Steps:

  1. Customize a gsm network name, such as 4G1.
  2. Execute the following command to create a gsm network named 4G1.
sudo nmcli connection add type gsm con-name 4G1
image-20240603171201731

Scenarios With APN Configuration

If the user's 4G network needs to be configured with APN, it can be configured with reference to the following steps.

Steps:

  1. Customize a gsm network name (for example, 4G2) and get the name of APN (for example, apn1).
  2. Execute the following command to create a gsm network named 4G2.
sudo nmcli connection add type gsm con-name 4G2 ifname cdc-wdm0 gsm.apn apn1
image-20240603171237161

Scenario Where Username And Password Need To Be Configured

If the user's 4G network needs to be configured with a username and password, you can refer to the following steps.

Steps:

  1. Customize a gsm network name (for example, 4G3), and respectively obtain the number, name and password of the gsm network to be configured (for example, 777, mycdma, mobile).
  2. Execute the following command to create a gsm network named 4G3.
sudo nmcli connection add type gsm con-name 4G3 ifname cdc-wdm0 ifname cdc-wdm0 gsm.number 777 gsm.username mycdma gsm.password mobile
image-20240603171435803

Configure The Network By Using The dhcpcd Tool

By default, automatic dialing is prohibited in 4G networks. If users want to start automatic dialing and use the network, they need to enable "lte-reconnect.service" service. You can configure as follows according to different scenarios requirements.

Scenarios Without APN Configuration

If the user's 4G network does not need to be configured with APN, it can be configured according to the following steps.

Steps:

  1. Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
  1. Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
  1. Execute the following command to check the status of the wwan interface.
ifconfig

Scenarios With APN Configuration

If the user's 4G network needs to be configured with APN, it can be configured with reference to the following steps.

Steps:

  1. Get the name of APN (for example, APN22).
  2. Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
  1. Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
  1. Execute the following command to check the status of the wwan interface.
ifconfig
  1. Execute the following command to open /usr/share/ed-ec20-qmi/lte-reconnect.sh file.
sudo nano /usr/share/ed-ec20-qmi/lte-reconnect.sh
  1. Change the dialing command "$BSP_HOME_PATH/quectel-CM -4 -f $LOGFILE &" to "$BSP_HOME_PATH/quectel-CM -4 -f $LOGFILE -s apn22 &". Where "apn22" is the name of the obtained APN.
  2. Use Ctrl+X to save the file and exit edit mode.
  3. Execute the following command to restart the "lte-reconnect.service" service.
sudo systemctl restart lte-reconnect.service

Configure 4G Module Reset

When the device fails to recognize the SIM card, you can reset the 4G module through the command line.

Steps:

Execute the script 4GReset.sh to reset the 4G module. The code is as follows.

#!bin/bash
raspi-gpio set 10 pd
raspi-gpio set 10 op dl
sleep 0.5
raspi-gpio set 10 dh
sleep 0.5
raspi-gpio set 10 dl

5.8 Configuring Buzzer

The buzzer is controlled using GPIO11.

Execute the following command to turn on the buzzer:

raspi-gpio set 11 op dh

Execute the following command to turn off the buzzer:

raspi-gpio set 11 op dh

5.9 Configuring RTC

Configuring RTC

5.10 Configuring Serial Port

This chapter introduces the configuration method of RS232 and RS485.

5.10.1 Installing picocom tool

In the Linux environment, you can use the picocom tool to debug the serial ports RS232 and RS485.

Execute the following command to install the picocom tool.

`sudo apt-get install picocom`

5.10.2 Configuring RS232

ED-CM4SEN includes 1 RS232 port with their corresponding COM ports and device files, as shown in the table below:

RS232 PortCorresponding Device File
RS232/dev/serial0

Preparation:

The RS232 port of ED-CM4SEN has been connected with external device.

Steps:

  1. Execute the following command to open the serial port serial0,, and configure the serial port baud rate to 115200.
picocom -b 115200 /dev/serial0
  1. Input commands as needed to control external device.

5.10.3 Configuring RS485

ED-CM4SEN includes 4 RS485 ports with their corresponding COM ports and device files, as shown in the table below:

RS485 PortCorresponding Device File
RS485-1/dev/ttyAMA3
RS485-2/dev/ttyAMA4
RS485-3/dev/ttyAMA2
RS485-4/dev/ttyAMA5

Preparation:

The RS485 port of ED-CM4SEN has been connected with external devices.

Steps:

  1. Execute the following command to open the serial port RS485-4, and configure the serial port baud rate to 115200.
picocom -b 115200 /dev/ttyAMA5
  1. Input commands as needed to control external devices.

5.10.4 Configuring CAN

Introducing the configuration method of CAN.

5.10.4 Installing can-utils tool

Execute the following commands in sequence to detect and install the can-utils tool.

sudo apt update
sudo apt install can-utils

5.10.4 Setting CAN state

Preparation:

The connection of the CAN port of the ED-CM4SEN to external devices has been completed.

Steps:

  1. Execute the following command to set the baud rate of the CAN port to 1000000.
sudo ip link set can0 type can bitrate 1000000

Where can0 is the port number.

  1. Execute the following command to open the CAN port.
sudo ip link set can0 up

Where can0 is the port number.

  1. Execute the following command to set up the CAN port for communication.
  • Receive data:
candump can0
  • Send data:
cansend can0 123#1122334455667788

Where can0 is the port number.

123#1122334455667788 is the message to be sent, which can be customised by the user according to the format.