Intel XMM 7360 LTE mPCIe modem support

Started by QBANIN, January 09, 2022, 09:31:00 PM

Previous topic - Next topic
Hi. Is Intel XMM 7360 LTE mPCIe modem supported by OPNsense?

It's not in the hardware compatibility list for the current release:
https://www.freebsd.org/releases/12.1R/hardware/

Neither in the one for the upcoming release 22.1:
https://www.freebsd.org/releases/13.0R/hardware/

On the other hand, if this modem is e.g. internally a USB to serial converter with a modem accepting AT commands attached, it might work. You will have to do some investigating what precisely this thing is ...
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Thank you for your answer. If so... what is in your opinion the best/most BSD-compatible mPCIe LTE CAT6 (or higher) modem? I can't figure out from linked hardware list...

Sorry - no idea. Any product that provides a serial port and an AT command set should work but you will need to test yourself.

It could be a good approach to use a generic FreeBSD 13.0 installation for testing - if the product works with that, it will work with the upcoming OPNsense 22.1 release. Depends on your time frame, though.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: QBANIN on January 09, 2022, 09:31:00 PM
Hi. Is Intel XMM 7360 LTE mPCIe modem supported by OPNsense?
What's the outcome did you try XMM 7360? I wonder about it and about XMM 7560.

November 12, 2022, 04:43:07 AM #5 Last Edit: November 12, 2022, 04:49:38 AM by regs
So, I got Fibocom L860-GL, which is Intel XMM 7560.

TLDR: It's working.


Detailed:

It doesn't work out of box in Windows. Needs drivers, didn't install it. It doesn't work in Ubuntu. Seem to receiving IP, but failing out shortly with no internet. But that a side story.

As of OPNSense so far I tried it on a testing OPNSense in a VirtualBox with Windows host with no plan on a SIM card. I got it with USB 3.0 adapter. Did not update firmware or did anything else. Just inserted SIM, connected antennas and passed through into virtual machine with USB 3.0 enabled. Three devices appeared - /dev/cuaU0, /dev/cuaU1 and /dev/cuaU2. /dev/cuaU0 and /dev/cuaU2 do accept AT commands. /dev/cuaU1 does not. I can only type in ~.

So I tried to make a Point-to-Point connection. Selected /dev/cuaU0 only, entered *99# phone and my APN. Then assigned connection and enabled it. So, it's working. I'm getting IP and i can open ISP homepage and account.

Didn't try anything else, like aggregation etc.

The question is why those 3 devices, which one is for which and how it should work ideally?

Was not able to take screenshot, it slept away. Only photo. And it didn't went entirely into logs.
https://i.imgur.com/ZklezBg.jpeg

In fact Fibocom L860-GL is compatible with the FreeBSD.
Moreover it is one of the LTE modems that can work over a high speed CDC-NCM interface (using cdce(4) driver) so you would not be limited to 115200 baud rate and all that old PPP stuff like mpd5.
You'll be able to achieve speeds up to the USB port bandwidth you'll connect it to (if your ISP will provide you with a such bandwidth).
Since there are still no QMI or MBIM drivers available in the current FreeBSD and OPNSense distributions, this modem is one of the few that can allow to achieve a high bandwidth over the modern LTE networks.

Fibocom L860-GL expose several devices over USB interface to the FreeBSD host.
There are three USB Serial ports (CDC-ACM devices), usually named /dev/cuaU0, /dev/cuaU1 and /dev/cuaU2.
The /dev/cuaU0 is a PPP modem and an AT command port.
The /dev/cuaU1 is a debug port, so we shouldn't try to send any commands to it.
And the /dev/cuaU2 is another AT command port.
So you can use /dev/cuaU0 or /dev/cuaU2 to send AT commands to this modem, but it is recommended to use the /dev/cuaU2 if you plan to run it in a CDC-NCM mode.

There are also three USB Network adapters (CDC-NCM devices) usually named /dev/ue0, /dev/ue1 and /dev/ue2.
They are all equal, so you can use any of them to route network traffic.

So here are the simple steps to bring up that modem and a CDC-NCM network interface under FreeBSD installation, but they should be also appliable to an OPNSense.
Let's assume that we'll use /dev/cuaU2 to send AT commands to the modem and /dev/ue0 as a network interface to send our network traffic.
The following commands should be run from the command prompt so you'll need a direct or SSH connection to the box.

First we'll need to connect to the Serial port with the cu utility using 115200 baud rate to issue some AT commands:
cu -s 115200 -l /dev/cuaU2
and we should receive
Connected
as a reply.
Then we can test if the modem is receiving (and replying to) our commands, using standard ATI command:
ATI
And we'll receive something simillar to this in reply:
".Built@May 29 2020:10:45:41"

After that we should check if the modem has received an APN configuration from the LTE operator.
Fibocom L860-GL has an "Auto connect" feature enabled by default and the most of the LTE operators now are pushing their APN information automatically. So we should send the following command and check it's output:
AT+CGDCONT?
This command will list all the PDP (Protocol Data Point) configured in the modem.
We'll receive something simillar to the following line in reply:
+CGDCONT: 0,"IP","internet","10.108.216.30",0,0,0,0,0,0,0,0,0,0
Take a note that there is a PDP with an ID "0" exist and an IP address "10.108.216.30" is being assigned by an LTE operator to our modem and an APN called "internet" is being used.
If there is no IP address in the output of this command is being displayed or it is all zeroes then some additional
configuration steps are required but it's a part of another post =).
There could be several lines displayed in a reply to that command, since this modem supports up to 30 PDP's concurrently.

Next we should check if that PDP is active or if we have several PDP's configured, we need to know wich one is currently active. We'll use the following command to check for an active PDP configuration:
AT+CGACT?
And we'll receive something similar to the following line:
+CGACT: 0,1
The output of this command will list the PDP number and a state of that PDP separated by comma. Where "1" means that PDP is in active state and "0" means that it inactive. So in this example we've got a PDP with ID "0" active and configured.
We'll use this PDP ID later on, so take a note of it.

Now we need to setup a routing inside the modem from that PDP to a CDC-NCM device.
We'll use the following command for that purpose:
AT+XDATACHANNEL=1,1,"/USBCDC/2","/USBHS/NCM/0",1,0
Where the first parameter is the routing mode (set to "1" to enable routing), the second one is the channel type (set to "1" for GPRS/LTE), the third one is the name of our command interface (set to "/USBCDC/2" for /dev/cuaU2), the fourth one is the name of the modem NCM device (set to "/USBHS/NCM/0" for /dev/ue0), the fifth one is the connect flag (you should set it to "1" or "2"), and the sixth one is the PDP ID (it is set to "0" in our case since we've got PDP with ID "0" configured and active).
We'll receive the simple
OK
in reply to this command.

Now we need to enable data transfer from the PDP (and the LTE network) to our NCM device.
So we'll send the following command to the modem:
AT+CGDATA=M-RAW_IP,0
where "M-RAW_IP" is a layer 2 protocol type (should always be set to "M-RAW_IP") and "0" is our PDP ID.
Here we'll also get just
OK
in reply if everything went fine.
If the "connect flag" option in the AT+XDATACHANNEL command was set to "2" we'll also get the
CONNECT
message from the modem.

Now we've got our modem configured and connected to the LTE network.
But we need some additional information to setup our /dev/ue0 network interface.
We should issue the following command to get that information from the modem:
AT+CGCONTRDP=0
where "0" is our PDP ID number.
The response will be similar to the following line:
+CGCONTRDP:0,5,"internet","10.108.216.30.255.0.0.0","10.108.216.31","10.205.171.68","10.205.171.77","","",0,,0,,0
where the "10.108.216.30.255.0.0.0" is an interface IP address and a network mask (dot separated), "10.108.216.31" is a gateway address, and "10.205.171.68","10.205.171.77" are the DNS server addresses.
Take a note of all theese addresses since we'll need them to configure our ue0 network interface and routing.

Now we can quit the cu session using
~.
command or open another terminal or SSH connection to our FreeBSD or OPNSense box and configure network interface settings.
First of all we should take a note of the MAC address that was assigned by the OS to the ue0 interface.
We can issue an
ifconfig -a
command and look for the ue0 interface and it's MAC address.
Check the "ether" parameter in the ifconfig output.
Most of the time the ue0 interface will be assigned with the "00:00:11:12:13:14" MAC address.

Now we can assign an IP address to the ue0 interface:
ifconfig ue0 10.108.216.30/32 -arp
Where "10.108.216.30" is an IP address we've got from the AT+CGCONTRDP command earlier.

Next we need to add a static route to the gateway address:
route add 10.108.216.31 -interface ue0
Where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier.

And a static ARP entry for the gateway:
arp -s 10.108.216.31 00:00:11:12:13:14
Where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier and "00:00:11:12:13:14" is a MAC address of the ue0 interface.

For the name resolution to work we should add the DNS addresses to the /etc/resolv.conf file by manually editing it or using OPNSense GUI. Use DNS addresses that were obtained from the AT+CGCONTRDP command output earlier.

And at last we can switch a default gateway from the currently assigned one to the LTE operator gateway obtained from the AT+CGCONTRDP command.
Use
route add default 10.108.216.31
command if there were no default gateway assigned or
route change default 10.108.216.31
if there was a default gateway defined
or use OPNSense GUI for that, where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier.