5 Configuring System
This chapter introduces how to configure system.
5.1 Finding Device IP
5.2 Remote Login
5.3 Configuring Storage Devices
5.4 Configuring Ethernet IP
5.5 Configuring Wi-Fi (Optional)
5.6 Configuring Bluetooth (Optional)
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:
- Customize a gsm network name, such as 4G1.
- Execute the following command to create a gsm network named 4G1.
sudo nmcli connection add type gsm con-name 4G1
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:
- Customize a gsm network name (for example, 4G2) and get the name of APN (for example, apn1).
- 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
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:
- 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).
- 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
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:
- Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
- Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
- 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:
- Get the name of APN (for example, APN22).
- Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
- Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
- Execute the following command to check the status of the wwan interface.
ifconfig
- 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
- 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. - Use Ctrl+X to save the file and exit edit mode.
- 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
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 Port | Corresponding Device File |
---|---|
RS232 | /dev/serial0 |
Preparation:
The RS232 port of ED-CM4SEN has been connected with external device.
Steps:
- Execute the following command to open the serial port serial0,, and configure the serial port baud rate to 115200.
picocom -b 115200 /dev/serial0
- 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 Port | Corresponding 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:
- 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
- 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:
- 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.
- Execute the following command to open the CAN port.
sudo ip link set can0 up
Where can0 is the port number.
- 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.