I've got the Portenta x8 connected to the max carrier board, with a Sim card in the sim slot. I dont know how to proceed and set up the modem. i'"m really confused by ModemManager documentation and i dont know how i have to use that. could you please someone help me what should i do? thanks in advanced
Here's my version info for the OS:
cat /etc/os-release
ID=lmp-xwayland
NAME="Linux-microPlatform XWayland"
VERSION="4.0.3-699-88"
VERSION_ID=4.0.3-699-88
PRETTY_NAME="Linux-microPlatform XWayland 4.0.3-699-88"
HOME_URL="{redacted}"
SUPPORT_URL="{redacted}"
DEFAULT_HOSTNAME="portenta-x8"
LMP_MACHINE="portenta-x8"
LMP_FACTORY="arduino"
LMP_FACTORY_TAG="devel"
IMAGE_ID=lmp-factory-image
IMAGE_VERSION=699
by running the command: mmcli -L, No modems were found. do i have something to configure the modem?
You need to give the max carrier external power via barrel jack i believe it can take up to 32V. Most of the devices on the carrier board wont work with just usb-c power. Here's a basic script on the things needed to get cellular working, you need to replace the apn=hologram with whatever apn you're using.
#!/bin/sh
modemNum=$(mmcli -L | sed -n 's/^.*\/Modem\/\(.\).*/\1/p')
result=$(mmcli -m $modemNum --simple-connect='apn=hologram,ip-type=ipv4')
if [[ $result != *"successfully"* ]]; then
echo "Unable to bring modem online"
exit
fi
bearerNum=$(mmcli -m $modemNum | sed -n 's/^.*Bearer.*\/Bearer\/\(.*\).*/\1/p')
interface=$(mmcli -m $modemNum --bearer=$bearerNum | sed -n 's/^.*interface: \(.*\).*$/\1/p')
ipaddr=$(mmcli -m $modemNum --bearer=$bearerNum | sed -n 's/^.*address: \(.*\).*$/\1/p')
dns1=$(mmcli -m $modemNum --bearer=$bearerNum | sed -n 's/^.*dns: \(.*\).*$/\1/p')
dns2=$(echo $dns1 | sed -n 's/^.*,\(.*\).*$/\1/p')
dns1=$(echo $dns1 | sed -n 's/^\(.*\),.*$/\1/p')
mtuNum=$(mmcli -m $modemNum --bearer=$bearerNum | sed -n 's/^.*mtu: \(.*\).*$/\1/p')
sudo ip link set $interface up
sudo ip addr add $ipaddr/32 dev $interface
sudo ip link set dev $interface arp off
sudo ip link set dev $interface mtu $mtuNum
sudo ip route add default dev $interface metric 200
sudo sh -c "echo 'nameserver $dns1' >> /etc/resolv.conf"
sudo sh -c "echo 'nameserver $dns2' >> /etc/resolv.conf"
Oh and don't forget to have an antenna hooked up to the SMA connector, tutorial warns of damage otherwise.
1 Like