Getting Started with ECM Mode

This section will lead you step by step to create a cellular connection with the Raspberry Pi 4G/LTE Cellular Modem Kit

This guide will walk you through the process of creating a reliable cellular connection with your Raspberry Pi using the Raspberry Pi 4G/LTE Cellular Modem Kit. By following the steps outlined below, you will be able to set up the hardware, establish a cellular connection using ECM mode, and explore remote terminal access via Raspberry Pi Connect.

Box Contents


System Requirements

To getting started with the Raspberry Pi 4G/LTE Cellular Modem Kit, first check the following requirements.

Hardware RequirementsSoftware Requirements
Raspberry Pi 3, 3B+, 4 or 5Raspberry Pi OS


Header Options

All steps are shown with Raspberry Pi 4. The only assembly difference between Raspberry Pi 5 and Raspberry Pi 4 is the spacers and headers used.

Choose the Long or the Short 40-pin GPIO based on your project size and requirements.

The Long HeaderThe Short Header
Allows stacking with full access to all GPIO pins on the Raspberry Pi.More compact and space-saving for smaller projects.
Ideal for broad applications or prototyping purposes.Ideal for embedded systems or productized projects where access to all GPIO pins may not be necessary.


Step 1: Assembly

1. Attach the mini PCIe module to the HAT

Sixfab Raspberry Pi 4G/LTE Cellular Modem Kit

2. Attach the antenna to the mini PCIe module

Make sure the right antenna is connected to the right port. Attach LTE full band PCB antenna/LTE connector of the LTE-GNSS dual antenna to the main Antenna interface/diversity antenna interface & GPS Antenna portion goes to the GNSS antenna interface.

3. Attach the header under the board

Sixfab Raspberry Pi 4G/LTE Cellular Modem Kit

4. Attach the micro SIM as shown

Sixfab Raspberry Pi 4G/LTE Cellular Modem Kit

5. Attach the Base HAT to the Raspberry Pi and stack it with the plastic spacer kit

Sixfab Raspberry Pi 4G/LTE Cellular Modem Kit

6. Plug the USB cable

7. Connect the power supply to your Raspberry Pi




Step 2: Sixfab SIM Activation

Log in to connect.sixfab.com to register and activate your Sixfab SIM.

Navigate to the "Assets" section and select "+ Register Asset"

Sixfab Raspberry Pi 4G/LTE Cellular Modem Kit

Enter ICCID (SIM Card ID) and Asset name (optional), then click the "Register" button.

After completing the registration, go to the asset details and verify that the "Status" is active.

Sixfab Jetson Nano Modem Kit

Step 3: Uninstall Modem Manager

The Modem Manager service is installed by default on the Raspberry Pi OS (Bookworm). For a smooth ECM connection, this service must be uninstalled. To uninstall it, run the following command. If it is not installed, skip this step.

sudo apt purge modemmanager -y

If it is not installed, skip this step.


Step 4: Cellular Internet Connection in ECM Mode

This step will guide you through setting up a cellular internet connection in ECM mode using the 4G/LTE Cellular Modem Kit. Depending on your chosen module —Telit or Quectel— the instructions will vary slightly. Please follow the steps specific to your module to ensure a successful connection.

Configuration

First, let's ensure that the Telit cellular module is correctly loaded in Raspberry Pi OS. Telit modules are most often automatically detected in recent Linux kernels, this can be verified in different ways by the commands below.

The lsusb command is used to display the information about USB buses and the devices connected to them.

lsusb

It can look e.g. like this:

pi@raspberrypi:~ $ lsusb Bus 001 Device 112: ID 1bc7:1206 Telit Wireless Solutions LE910C4-NF

The lsusb -t command shows the USB endpoints of detected USB devices and related drivers.

pi@raspberrypi:~ $ lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 112, If 0, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 112, If 1, Class=Vendor Specific Class, Driver=, 480M |__ Port 1: Dev 112, If 2, Class=Communications, Driver=cdc_ether, 480M |__ Port 1: Dev 112, If 3, Class=CDC Data, Driver=cdc_ether, 480M |__ Port 1: Dev 112, If 4, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 112, If 5, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 112, If 6, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 112, If 7, Class=Vendor Specific Class, Driver=option, 480M

We can start communicating with the cellular module over AT commands. There are different implementations on Linux that enable communication with serial interfaces. You can check out the Sending AT Commands tutorial.

Configure APN

APN is super if you are using Sixfab SIM. In this case, the command should be:

AT+CGDCONT=1,"IPV4V6","super"

Configure Module

Now, we can start to configure the modem for ECM mode. Execute the following command for the LE910Cx series module.

AT#USBCFG=4

The modem may reboot after the execution of the command.

Reboot the Module

Then reboot the modem using the following command.

AT#REBOOT

Wait for the modem to boot again. It may take 30 seconds. After the reboot, open a new Linux terminal and check for usbX in the network interface using ifconfig or ipaddr commands.

Internet Connection

Then start the internet connection using the following command. If you get ERROR please try the same command again.

AT#ECM=1,0
Note 2: When the modem reboots or the internet connection is lost for any reason, you have to run AT#ECM=1,0 command again to establish the internet connection. It may take a few minutes to establish the connection depending on the network.
Note 3: The response to all AT commands should be OK.

Test Internet Connection

Once the internet is active you should see wwan0 in your internet interface. You can use route -n or ip addr and look for wwan0 interface. Now check the assigned IP address and test the connection.

pi@raspberrypi:~ $ ifconfig wwan0 wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.225.45 netmask 255.255.255.0 broadcast 192.168.225.255 inet6 fe80::ee84:31a0:e65d:c5c3 prefixlen 64 scopeid 0x20 ether f2:0a:30:b7:9c:73 txqueuelen 1000 (Ethernet) RX packets 391 bytes 19933 (19.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 438 bytes 30915 (30.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pi@raspberrypi:~ $ ping -I wwan0 -c 5 sixfab.com PING sixfab.com (172.67.75.126) from 100.67.114.164 wwan0: 56(84) bytes of data. 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=1 ttl=29 time=247 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=2 ttl=29 time=205 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=3 ttl=29 time=207 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=4 ttl=29 time=204 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=5 ttl=29 time=216 ms --- sixfab.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 8ms rtt min/avg/max/mdev = 204.050/215.839/247.004/16.201 ms

Troubleshooting

If the wwan0 interface is not visible reboot your whole system, check your SIM, antenna, module and USB.

After issuing the AT#ECM command to the Telit module, if the wwan0 interface doesn't appear under the ifconfig or route -n but available under ip addr command, run sudo dhclient -v wwan0. Later add nameserver 8.8.8.8 in /etc/resolve.conf.

Check the configuration of the module.

AT#USBCFG? # Should return 3 or 4

Check the TCP context is activated.

AT#ECM? # Should return 0,1. If return is 0,0 run the AT#ECM=1,0,"","",0 command in minicom.

Check the SIM is detected by the module.

AT+CPIN? # Should return READY

Check if the module is registered to the network.

AT+CREG? # Should return 0,1 or 0,5

Check the APN is right and have an IP.

AT+CGDCONT? # Should return the APN details and IP address

Configuration

First, let's ensure that the Quectel cellular module is correctly loaded in Raspberry Pi OS. Quectel modules are most often automatically detected in recent Linux kernels, this can be verified in different ways by the commands below:

The lsusb command is used to display the information about USB buses and the devices connected to them.

lsusb

It can look e.g. like this:

pi@raspberrypi:~ $ lsusb Bus 001 Device 002: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem

The lsusb -t command shows the USB endpoints of detected USB devices and related drivers.

pi@raspberrypi:~ $ lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 2, If 1, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 2, If 2, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 2, If 3, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 2, If 4, Class=Communications, Driver=cdc_ether, 480M |__ Port 1: Dev 2, If 5, Class=CDC Data, Driver=cdc_ether, 480M

We can start communicating with the cellular module over AT commands. There are different implementations on Linux that enable communication with serial interfaces. You can check out the Sending AT Commands tutorial.

Configure APN

APN is super if you are using Sixfab SIM. In this case, the command should be:

AT+CGDCONT=1,"IPV4V6","super"

Configure Module

Now, we can start to configure the modem for ECM mode.

AT+QCFG="usbnet",1

The modem may reboot after the execution of the command.

Reboot the Module

Then reboot the modem using the following command.

AT+CFUN=1,1

Wait for the modem to boot again. It may take 30 seconds. After the reboot, open a new Linux terminal and check for usbX in the network interface using ifconfig or ipaddr commands.

Note 2: It may take a few minutes to establish the connection depending on the network.
Note 3: The response to all AT commands should be OK.

Test Internet Connection

Once the internet is active you should see usbX in your internet interface. You can use ifconfig or ipaddr and look for usbX interface. Now check the assigned IP address and test the connection.

pi@raspberrypi:~ $ ifconfig usb0 usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.225.60 netmask 255.255.255.0 broadcast 192.168.225.255 inet6 fe80::8543:f6a0:e678:2e20 prefixlen 64 scopeid 0x20 ether 4a:aa:f8:62:36:bb txqueuelen 1000 (Ethernet) RX packets 73 bytes 5047 (4.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 100 bytes 15116 (14.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pi@raspberrypi:~ $ ping -I usb0 sixfab.com -c 5 PING sixfab.com (104.26.9.221) from 192.168.225.60 usb0: 56(84) bytes of data. 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=1 ttl=52 time=209 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=2 ttl=52 time=202 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=3 ttl=52 time=192 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=4 ttl=52 time=193 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=5 ttl=52 time=195 ms --- sixfab.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 9ms rtt min/avg/max/mdev = 191.895/198.244/209.463/6.636 ms

Troubleshooting

If usbX interface is not visible reboot your whole system, check your SIM, antenna, module and USB.

Check the configuration of the module.

AT+QCFG="usbnet" # Should return 1

Check the SIM is detected by the module.

AT+CPIN? # Should return READY

Check if the module is registered to the network.

AT+CREG? # Should return 0,1 or 0,5

Check the APN is right and have an IP.

AT+CGCONTRDP # Should return the APN details and IP address.



Raspberry Pi Connect for Remote Access

Once your cellular connection is established, you can manage your Raspberry Pi remotely using Raspberry Pi Connect. This service allows you to access a terminal from anywhere, making it easy to monitor and control your Raspberry Pi over the internet without physical access.

Raspberry Pi Connect simplifies the process by providing a browser-based terminal, file access, and management tools. It can be used as an alternative to setting up remote SSH, and it's particularly useful when working with remote cellular connections.

For more information on using Raspberry Pi Connect, refer to the official documentation: Raspberry Pi Connect