Connecting Telit ME910C1 CAT M1 Module to the Internet via PPP

Connecting Telit ME910C1 CAT M1 Module to the Internet via PPP

PPP, which stands for Point-to-Point Protocol, is a communication protocol used for establishing a direct connection between a device and an internet service provider (ISP) over a serial link. PPP is commonly used in situations where a device needs to connect to the internet but cannot use traditional wired connections, such as in remote locations or on mobile devices.

In the case of cellular connectivity, PPP is used to establish a connection between a device and a cellular modem. PPP plays a critical role in the connection between a device and a cellular modem by providing a secure and reliable connection. It enables the device to authenticate with the cellular modem and establish a connection to the internet service provider. The PPP protocol also provides encryption capabilities to ensure that the data transferred between the device and the internet service provider is secure and protected from unauthorized access.

PPP is easy to establish, widely used protocol, and it is flexible with the devices. PPP may show a drop of the connection while using the AT command set for other functionality of modem. The PPP protocol is just used between the computer and the modem to make the connection look like a legacy dial-up modem-based network connection.

CAT-M1

CAT-M1 cellular connectivity is a type of communication protocol that uses a cellular network to connect devices to the internet. It is specifically designed for IoT (Internet of Things) devices, which require a low-power, wide-area network connection. PPP (Point-to-Point Protocol) is used to establish a direct connection between the device and the cellular modem, which enables the device to connect to the internet.

The CAT-M1 technology is ideal for IoT devices because it provides low-latency connectivity with a longer battery life, which means that devices can remain connected for extended periods without requiring frequent battery changes. PPP plays a crucial role in ensuring that the CAT-M1 technology provides a secure and reliable connection between the device and the internet service provider.

Photo by Dylan Ferreira on Unsplash

Photo by Dylan Ferreira on Unsplash

Here are some best practices for using CAT-M1 in IoT devices:

Optimize data transmission: Since CAT-M1 operates on LTE networks, it provides higher data rates than other LPWA technologies like NB-IoT. However, it's important to optimize data transmission to conserve power and reduce costs. You can do this by using efficient data formats, compressing data, and minimizing the number of transmissions.

Ensure network coverage: CAT-M1 provides extended coverage, but it's still important to ensure that your IoT devices are within range of a cellular tower. You can use network coverage maps to determine the strength of the cellular signal in your area

In this tutorial, we will explain step by step the PPP connection process with the Telit ME910C1 module in the Raspberry Pi Cellular IoT Kit (LTE-M).

Hardware Setup

It is important to properly setup your hardware before you get started. To setup the hardware please follow:

Cellular Connection

Before starting the cellular connection setup, the following module should be configured.

⚙️ Module Configuration

Before running the PPP make sure the module is configured to the right settings.
AT#USBCFG? should return 0, otherwise,send AT#USBCFG=0 then reboot the module after 10 seconds with AT#REBOOT

For sending AT commands, you may check the Sending AT Commands tutorial.

We will propose two options for cellular connectivity, either of which can be preferred.

1. Telit ME910C1 Quick Start Guide Provided by Module OEM

The scope of this document is to provide a general overview and basic instructions on how to get started with the Telit ME910C1 module. This guide includes the following topics.

  • ME910C1 Main Features
  • USB/UART Port Configuration
  • Application Main Flow
  • Network Registration
  • CAT-M1 / NB-IoT Registration AT Script Example
  • 2G Registration AT Script Example
  • Access Technology Selection
  • Speed Up Registration
  • Check / Set Data Service
  • TCP/UDP Script
  • and more

If you want, you can follow the AT script examples for cellular connectivity here. We do not provide any support or troubleshooting steps for these scripts. Alternatively, you can follow the method we have prepared for you below.

2. Sixfab PPP Installer

This installer facilitates your cellular connection and establishes it in quite effortless manner.

Note: Disconnect the Micro USB cable during the PPP installer installation.

Clone the repository, change it into the directory, and change the permission of the installation script. Then install it.

git clone https://github.com/sixfab/Sixfab_PPP_Installer.git 
cd Sixfab_PPP_Installer 
chmod +x ppp_install.sh
sudo ./ppp_install.sh

During the installation, the user will need to answer several questions, in order to complete the installation process. The questions are:

Please choose your Sixfab Shields/HATs

Type "6" and press ENTER.

pi@raspberrypi:~ $ sudo ./install.sh Please choose your Sixfab Shield/HAT: 1: GSM/GPRS Shield 2: 3G, 4G/LTE Base Shield 3: Cellular IoT App Shield 4: Cellular IoT HAT 5: Tracker HAT 6: 3G/4G Base HAT

What is your carrier APN?

Type your APN and then press ENTER. For Sixfab SIM, it is super.

pi@raspberrypi:~ $ sudo ./install.sh Checking requirements... Updating headers... Get:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB] Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB] ... Reading package lists... Done Copying setup files... ppp installing... Reading package lists... Done Building dependency tree... Done Reading state information... Done ... Selecting previously unselected package ppp. Preparing to unpack .../ppp_2.4.9-1+1_armhf.deb ... Unpacking ppp (2.4.9-1+1) ... What is your carrier APN? super

Does your carrier need username and password?

Type "n" and press ENTER. You don't need this for the Sixfab SIM.

pi@raspberrypi:~ $ sudo ./install.sh ... ... Selecting previously unselected package ppp. Preparing to unpack .../ppp_2.4.9-1+1_armhf.deb ... Unpacking ppp (2.4.9-1+1) ... What is your carrier APN? super Does your carrier need username and password? [Y/n] n

What is your device communication PORT?

Type "ttyUSB2" and press ENTER.

pi@raspberrypi:~ $ sudo ./install.sh ... ... Selecting previously unselected package ppp. Preparing to unpack .../ppp_2.4.9-1+1_armhf.deb ... Unpacking ppp (2.4.9-1+1) ... What is your carrier APN? super Does your carrier need username and password? [Y/n] n What is your device communication PORT? (ttyS0/ttyUSB3/etc.) ttyUSB2
Note: The use of UART (ttyS0) and its pins are not compatible with Telit ME910C1.

Do you want to activate auto-connect/reconnect service at Raspberry Pi boot up?

This option allows you to connect to the Internet via your HAT automatically when your Raspberry Pi starts. Since this option is not supported in Raspberry Pi Cellular IoT Kit, you need to type "n" and proceed.

pi@raspberrypi:~ $ sudo ./install.sh ... ... Selecting previously unselected package ppp. Preparing to unpack .../ppp_2.4.9-1+1_armhf.deb ... Unpacking ppp (2.4.9-1+1) ... What is your carrier APN? super Does your carrier need username and password? [Y/n] n What is your device communication PORT? (ttyS0/ttyUSB3/etc.) ttyUSB3 Do you want to activate auto connect/reconnect service at R.Pi boot up? [Y/n] n

Press ENTER key to reboot.

Connect the USB cable from the Base HAT to the Raspberry Pi.

Connection Usage

The steps for installing PPP have been completed, and now there is only one final step left for the cellular connection.

  • For PPP connection, execute the sudo pon command from the terminal. If everything goes smoothly, an IP address will be assigned to your ppp0 interface and connection will be established through this interface.
  • If you want to terminate the cellular connection, run the sudo poff command.

These two commands can be used for managing cellular connections. The cellular connection can be started/stopped according to your needs at any time.

pi@raspberrypi:~ $ sudo pon pppd options in effect: debug # (from /etc/ppp/peers/provider) updetach # (from /etc/ppp/peers/provider) persist # (from /etc/ppp/peers/provider) dump # (from /etc/ppp/peers/provider) noauth # (from /etc/ppp/peers/provider) remotename 3gppp # (from /etc/ppp/peers/provider) /dev/ttyUSB3 # (from /etc/ppp/peers/provider) 115200 # (from /etc/ppp/peers/provider) lock # (from /etc/ppp/peers/provider) connect chat -s -v -f /etc/chatscripts/chat-connect -T super # (from /etc/ppp/peers/provider) disconnect chat -s -v -f /etc/chatscripts/chat-disconnect # (from /etc/ppp/peers/provider) nocrtscts # (from /etc/ppp/peers/provider) modem # (from /etc/ppp/peers/provider) asyncmap 0 # (from /etc/ppp/options) lcp-echo-failure 4 # (from /etc/ppp/options) lcp-echo-interval 30 # (from /etc/ppp/options) hide-password # (from /etc/ppp/peers/provider) novj # (from /etc/ppp/peers/provider) novjccomp # (from /etc/ppp/peers/provider) ipcp-accept-local # (from /etc/ppp/peers/provider) ipcp-accept-remote # (from /etc/ppp/peers/provider) ipparam 3gppp # (from /etc/ppp/peers/provider) noipdefault # (from /etc/ppp/peers/provider) ipcp-max-failure 30 # (from /etc/ppp/peers/provider) defaultroute # (from /etc/ppp/peers/provider) usepeerdns # (from /etc/ppp/peers/provider) noccp # (from /etc/ppp/peers/provider) noipx # (from /etc/ppp/options) abort on (BUSY) abort on (NO CARRIER) abort on (NO DIALTONE) abort on (ERROR) abort on (NO ANSWER) timeout set to 30 seconds send (AT^M) expect (OK) ^M OK -- got it send (ATE0^M) expect (OK) ^M ^M OK -- got it send (AT+CPIN?^M) expect (OK) ^M ^M +CPIN: READY^M ^M OK -- got it send (AT+CSQ^M) expect (OK) ^M ^M +CSQ: 27,99^M ^M OK -- got it send (AT+CREG?^M) expect (OK) ^M ^M +CREG: 0,5^M ^M OK -- got it send (AT+CGREG?^M) expect (OK) ^M ^M +CGREG: 0,5^M ^M OK -- got it send (AT+COPS?^M) expect (OK) ^M ^M +COPS: 0,0,"Twilio",7^M ^M OK -- got it send (AT+CGDCONT=1,"IP","super",,0,0^M) expect (OK) ^M ^M OK -- got it send (ATD*99#^M) expect (CONNECT) ^M ^M CONNECT -- got it Script chat -s -v -f /etc/chatscripts/chat-connect -T super finished (pid 3399), status = 0x0 Serial connection established. using channel 1 Using interface ppp0 Connect: ppp0 <--> /dev/ttyUSB3 sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x1f1aee7b> <pcomp> <accomp>] rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x7f83c33d> <pcomp> <accomp>] No auth is possible sent [LCP ConfRej id=0x0 <auth chap MD5>] rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x1f1aee7b> <pcomp> <accomp>] rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7f83c33d> <pcomp> <accomp>] sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x7f83c33d> <pcomp> <accomp>] sent [LCP EchoReq id=0x0 magic=0x1f1aee7b] sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>] rcvd [LCP DiscReq id=0x2 magic=0x7f83c33d] rcvd [LCP EchoRep id=0x0 magic=0x7f83c33d 1f 1a ee 7b] rcvd [IPCP ConfReq id=0x0] sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>] rcvd [IPCP ConfNak id=0x1 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>] sent [IPCP ConfReq id=0x2 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>] rcvd [IPCP ConfReq id=0x1] sent [IPCP ConfAck id=0x1] rcvd [IPCP ConfAck id=0x2 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>] Could not determine remote IP address: defaulting to 10.64.64.64 not replacing default route to wlan0 [192.168.1.1] local IP address 100.82.153.48 remote IP address 10.64.64.64 primary DNS address 8.8.8.8 secondary DNS address 8.8.4.4

Checking The Connection

pi@raspberrypi:~ $ ifconfig ppp0 ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 100.64.140.89 netmask 255.255.255.255 destination 10.64.64.64 ppp txqueuelen 3 (Point-to-Point Protocol) RX packets 18 bytes 1392 (1.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 20 bytes 1395 (1.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Check if your connection is working by sending a ping to any address.

pi@raspberrypi:~ $ ping -I ppp0 -c 5 sixfab.com PING sixfab.com (104.26.9.221) from 100.64.29.57 ppp0: 56(84) bytes of data. 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=1 ttl=53 time=316 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=2 ttl=53 time=318 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=3 ttl=53 time=314 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=4 ttl=53 time=333 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=5 ttl=53 time=334 ms --- sixfab.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 7ms rtt min/avg/max/mdev = 314.010/323.157/333.655/8.553 ms

APN or device port

You can change APN and PORT from /etc/ppp/peers/provider.

To understand PPP further you can check PPP documentation.