Skip to content

Commit c6cf68d

Browse files
committed
PCIe modem tutorial update - Max Carrier section
1 parent 80180b9 commit c6cf68d

File tree

1 file changed

+104
-2
lines changed
  • content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/mpcie-4g-modem

1 file changed

+104
-2
lines changed

content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/mpcie-4g-modem/content.md

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,68 @@ fw_setenv is_on_carrier yes
312312
fw_setenv carrier_name max
313313
```
314314

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:
315+
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:
316316

317317
```bash
318-
fw_setenv overlays 'ov_som_lbee5kl1dx ov_som_x8h7 ov_carrier_enuc_bq24195 ov_carrier_max_usbfs ov_carrier_max_sdc ov_carrier_max_cs42l52 ov_carrier_max_pcie_mini'
318+
fw_setenv overlays 'ov_som_lbee5kl1dx ov_som_x8h7 ov_carrier_enuc_bq24195 ov_carrier_max_usbfs ov_carrier_max_sdc ov_carrier_max_cs42l52'
319319
```
320320

321+
***The `ov_carrier_max_pcie_mini` overlay is not required for USB modems such as the GNSS Global (EG25) and EMEA (EC200A-EU) variants of the Pro 4G Module.***
322+
321323
Once the overlays are set, please reboot the Portenta X8 to ensure the configuration has been applied correctly.
322324

323325
### Connecting & Testing Network Connectivity
324326

327+
#### GNSS Global EG25 Module
328+
329+
For the **GNSS Global (EG25) Module**, you can configure the modem using **nmcli**:
330+
331+
```bash
332+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn hologram connection.autoconnect yes
333+
```
334+
335+
If your SIM card requires a PIN, update the command as follows:
336+
337+
```bash
338+
nmcli c add type gsm ifname cdc-wdm0 con-name wwan0 apn mobile.vodafone.it gsm.pin <PIN>
339+
```
340+
341+
#### EMEA EC200A-EU Module
342+
343+
For the **EMEA (EC200A-EU) Module**, which requires **mmcli**, use the following command to connect to the network after patching **ModemManager**:
344+
345+
```bash
346+
mmcli -m 0 --simple-connect='apn=iot.1nce.net,ip-type=ipv4v6'
347+
```
348+
349+
Ensure the `udev` rule remaps the USB `eth0` interface to `ec200aeu`. The rule can be applied as follows:
350+
351+
```bash
352+
sudo nano /etc/udev/rules.d/99-remap-ec200aeu.rules
353+
```
354+
355+
Add the following line:
356+
357+
```bash
358+
SUBSYSTEM=="net", ACTION=="add", KERNEL=="eth0", NAME="ec200aeu"
359+
```
360+
361+
Then reload the rules:
362+
363+
```bash
364+
sudo udevadm control --reload-rules
365+
```
366+
367+
```bash
368+
sudo udevadm trigger
369+
```
370+
371+
#### For QMI-based Modems
372+
373+
For **QMI-based modems**, modems that use *Qualcomm MSM Interface*, following steps can help configure the modem, which involves managing the **Raw IP mode** and using **qmicli** for network control.
374+
375+
#### Setting up Raw IP Mode for QMI-based Modems
376+
325377
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:
326378

327379
```bash
@@ -336,6 +388,8 @@ echo Y > /sys/class/net/wwan0/qmi/raw_ip
336388
ip link set dev wwan0 up
337389
```
338390

391+
#### Inspecting and Configuring the QMI-based Modem
392+
339393
Following that, use `qmicli` commands to inspect the card's status and begin a network connection:
340394

341395
```bash
@@ -358,6 +412,54 @@ udhcpc -q -f -n -i wwan0
358412

359413
![PRO 4G GNSS Module - Dynamic IP Configuration](assets/portentaMAXcarrier_mpcie_dynamic.png)
360414

415+
### Modem Power Management
416+
417+
The modems might become unresponsive, so it is recommended that power can be controlled through software to allow modem rebooting when necessary. The **gpioset** command should include a jumper and a 20 second delay for proper initialization.
418+
419+
```bash
420+
gpioset gpiochip5 5=1 #PCIE 3V3 BUCK EN (stm32h7 PE10)
421+
```
422+
423+
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:
424+
425+
```bash
426+
sleep 20
427+
```
428+
429+
This ensures the modem powers up correctly and becomes available for network operations.
430+
431+
### Docker Container Considerations
432+
433+
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:
434+
435+
```bash
436+
sudo systemctl stop ModemManager
437+
```
438+
439+
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.
440+
441+
Ensure that the Docker container has access to the GPIO device files by passing them into the container:
442+
443+
```bash
444+
docker run --device /dev/gpiochip5 <docker-image>
445+
```
446+
447+
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:
448+
449+
```bash
450+
gpioset gpiochip5 5=1
451+
```
452+
453+
***It is required to have **PCIE Enable (GPIO5)** pin connected to the **VCC (3V3)** pin to secure the power supply line.***
454+
455+
This will enable the power to the modem and add a delay for proper modem initialization:
456+
457+
```bash
458+
sleep 20
459+
```
460+
461+
### Testing Network Connectivity and Speed
462+
361463
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:
362464

363465
```bash

0 commit comments

Comments
 (0)