You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/mpcie-4g-modem/content.md
+158-3
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,10 @@ The following image provides the position of the Power Jack on the Portenta Max
62
62
63
63

64
64
65
+
***Modems can be challenging to work with, so it is helpful to understand the software components involved to troubleshoot potential issues effectively.***
66
+
67
+
Modems are complex devices, so it is recommended that the user knows each software component involved in order to troubleshoot potential issues.
68
+
65
69
## Mini PCI Express
66
70
67
71
**Mini PCIe**, short for Mini Peripheral Component Interconnect Express, is a smaller version of the PCIe interface mainly used in laptops and small devices to add features such as Wi-Fi®, Bluetooth®, and cellular connectivity.
@@ -312,16 +316,91 @@ fw_setenv is_on_carrier yes
312
316
fw_setenv carrier_name max
313
317
```
314
318
315
-
The previous commands are used to set environment variables, which we will use to set and use the needed overlays to link the mini PCIe interface under its profile. The overlays are as follows and set using the following command:
319
+
The previous commands are used to set environment variables, which we will use to set and apply the needed overlays to link the USB modem interface under its profile. The overlays are as follows and set using the following command:
***__NOTE:__ The `ov_carrier_max_pcie_mini` overlay is __not required for modems__ such as the __GNSS Global (EG25)__ and __EMEA (EC200A-EU)__ variants of the Pro 4G Module, as these modems rely on the USB interface and not on the PCIe bus.***
326
+
321
327
Once the overlays are set, please reboot the Portenta X8 to ensure the configuration has been applied correctly.
322
328
323
329
### Connecting & Testing Network Connectivity
324
330
331
+
#### GNSS Global EG25 Module
332
+
333
+
The **GNSS Global (EG25) Module** supports the *Qualcomm MSM Interface (QMI)*, which is compatible with **NetworkManager**. You can configure the modem using **nmcli**, the command-line tool for **NetworkManager**:
334
+
335
+
```bash
336
+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn hologram connection.autoconnect yes
337
+
```
338
+
339
+
***For information on managing interface configuration rules for the EG25 module, please see [this section](https://docs.arduino.cc/tutorials/portenta-mid-carrier/user-manual/#global-eg25-module).***
340
+
341
+
If your SIM card requires a PIN, update the command as follows:
342
+
343
+
```bash
344
+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn <APN> gsm.pin <PIN>
345
+
```
346
+
347
+
For instance, if you are using Vodafone in Italy, you can replace the `<APN>` field with `mobile.vodafone.it` and include the PIN number as well:
348
+
349
+
```bash
350
+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn mobile.vodafone.it gsm.pin <PIN>
351
+
```
352
+
353
+
#### EMEA EC200A-EU Module
354
+
355
+
The **EMEA (EC200A-EU) Module** mainly uses raw AT commands over a USB serial interface and is not compatible with QMI. While it is not *natively supported* by **ModemManager**, basic connectivity can still be established using **mmcli**:
***The **EC200A-EU** modem is not compatible with __QMI__. It requires raw AT commands over a USB serial interface. For more information, refer to the [Quectel EC200A-EU documentation](https://python.quectel.com/en/products/ec200a-eu).***
362
+
363
+
The latest images include the necessary `udev` rules to automatically manage the `ec200aeu` interface. You can verify this by checking the `75-ec200aeu.rules` file using the following command:
These rules automatically manage the `ec200aeu` network interface and ensure the required service starts.
377
+
378
+
#### For QMI Based Modems
379
+
380
+
**QMI-based modems** use the *Qualcomm MSM Interface (QMI)*, a messaging format for communication between software components in the modem and peripheral subsystems. QMI follows a client-server model, where clients interact with QMI services using either a **request/response** format or **unsolicited events** for system notifications.
381
+
382
+
To check if a modem supports QMI, use the following command:
383
+
384
+
```bash
385
+
qmicli -d /dev/cdc-wdm0 --dms-get-model
386
+
```
387
+
388
+
If the modem is QMI compatible, you can manage the **Raw IP mode** and control network connections using **qmicli**, which is an alternative to **ModemManager**. Before using **qmicli**, it is recommended to stop and disable the **ModemManager** service to avoid conflicts:
389
+
390
+
```bash
391
+
sudo systemctl stop ModemManager
392
+
```
393
+
394
+
```bash
395
+
sudo systemctl disable ModemManager
396
+
```
397
+
398
+
Once **ModemManager** has been disabled, you can use **qmicli** to communicate reliably with the QMI interface for modem operations.
399
+
400
+
***The **EC200A-EU** modem is not compatible with __QMI__. It requires raw AT commands over a USB serial interface. For more information, refer to the [Quectel EC200A-EU documentation](https://python.quectel.com/en/products/ec200a-eu).***
401
+
402
+
#### Raw IP Mode Setup for QMI Based Modems
403
+
325
404
With the overlays configured, the setup process involves bringing down the `wwan0` interface, setting it to raw IP mode, and then bringing it back up:
326
405
327
406
```bash
@@ -336,6 +415,8 @@ echo Y > /sys/class/net/wwan0/qmi/raw_ip
336
415
ip link set dev wwan0 up
337
416
```
338
417
418
+
#### Inspecting and Configuring the QMI Based Modem
419
+
339
420
Following that, use `qmicli` commands to inspect the card's status and begin a network connection:
340
421
341
422
```bash
@@ -358,6 +439,75 @@ udhcpc -q -f -n -i wwan0
358
439
359
440

360
441
442
+
### Modem Power Management
443
+
444
+
Modems can become unresponsive, so it is recommended that power can be controlled through software to allow rebooting when necessary. By default, this process is handled automatically by **ModemManager** using customized scripts such as:
445
+
446
+
-`/usr/sbin/modem_on.sh`
447
+
-`/usr/sbin/modem_off.sh`
448
+
449
+
These scripts contain the logic to manage modem power for different carrier boards and are used by **ModemManager** to distinguish between each board type. You can review these scripts by checking the **ModemManager** service configuration:
450
+
451
+
```bash
452
+
systemctl cat ModemManager
453
+
```
454
+
455
+
If you prefer to manage the modem manually, you can use these scripts directly, as they provide a simpler way to handle modem power. For cases where **ModemManager** is disabled, you can use the **gpioset** command to control the modem’s power and add a 20 second delay for proper initialization:
456
+
457
+
```bash
458
+
gpioset gpiochip5 5=1 #PCIE 3V3 BUCK EN (stm32h7 PE10)
459
+
```
460
+
461
+
This is applicable to both USB based and QMI based modems. After powering on the modem, allow **20 seconds** for the modem to initialize properly:
462
+
463
+
```bash
464
+
sleep 20
465
+
```
466
+
467
+
This ensures the modem powers up correctly and becomes available for network operations.
468
+
469
+
### Docker Container Considerations
470
+
471
+
In a Docker environment, it is often useful to disable **ModemManager** to avoid conflicts and instead control the modem using **qmicli** for QMI-based modems or use **nmcli/mmcli** for USB-based modems:
472
+
473
+
```bash
474
+
sudo systemctl stop ModemManager
475
+
```
476
+
477
+
```bash
478
+
sudo systemctl disable ModemManager
479
+
```
480
+
481
+
For modem power management, the connection between the **PCIE Enable (GPIO5)** pin and **VCC (3V3)** pin is required for a proper power setup. This bridge ensures proper hardware functionality when controlling the modem power. Moreover, you should manage power through software to allow the modem to be rebooted in case it becomes unresponsive.
482
+
483
+
Ensure that the Docker container has access to the GPIO device files by passing them into the container:
484
+
485
+
```bash
486
+
docker run --device /dev/gpiochip5 <docker-image>
487
+
```
488
+
489
+
The `<docker-image>` field is the name of the Docker image you want to run with access to the GPIO device files. For example, if your Docker image is called `my_modem_image`, the command would look like this:
490
+
491
+
```bash
492
+
docker run --device /dev/gpiochip5 my_modem_image
493
+
```
494
+
495
+
Inside the container, an **entrypoint.sh** script can control the modem's power via GPIO, with the 3.3V Buck Converter line connected to the **PCIE Enable (GPIO5)** pin. The following command can be added to the script:
496
+
497
+
```bash
498
+
gpioset gpiochip5 5=1
499
+
```
500
+
501
+
***It is required to have **PCIE Enable (GPIO5)** pin connected to the **VCC (3V3)** pin to secure the power supply line.***
502
+
503
+
This will enable the power to the modem and add a delay for proper modem initialization:
504
+
505
+
```bash
506
+
sleep 20
507
+
```
508
+
509
+
### Testing Network Connectivity and Speed
510
+
361
511
We now have the Pro 4G Module with the Portenta X8 on the Porteta Max Carrier ready for use. To test the connection speed, perform a speed test by downloading the `speedtest-cli` script, making it executable, and running it within a Docker container:
362
512
363
513
```bash
@@ -386,7 +536,6 @@ After the speed test, you might observe results similar to the following image.
386
536
387
537
***The download and upload speed may vary depending on the region.***
388
538
389
-
390
539
For a more streamlined approach, you can use the following single-line command:
391
540
392
541
```bash
@@ -395,6 +544,12 @@ nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn hologram connection.auto
395
544
396
545
If your SIM card requires a PIN, adjust the command as follows:
397
546
547
+
```bash
548
+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn <APN> gsm.pin <PIN>
549
+
```
550
+
551
+
For instance, if you are using Vodafone in Italy, you can replace the `<APN>` field with `mobile.vodafone.it` and include the PIN number as well:
552
+
398
553
```bash
399
554
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn mobile.vodafone.it gsm.pin <PIN>
0 commit comments