Open josuah opened 1 year ago
The "QMI" protocol seems to be what Linux uses for Quectel modules: https://en.wikipedia.org/wiki/Qualcomm_MSM_Interface
QMI seems native to Qualcomm, but picked-up by Quectel and many others as an ad-hoc standard: “Qualcomm default seems to permit +CLVL, +CKPD, +CMUT, +CTSA, +CBKLT, +CFUN, +CDIS, +CRSL, +CMAR, +CSO, +CSS, +CBC, $QCPWRDN and this may be extended by vendor-specific commands, such as +QFOTADL in the Quectel case” https://osmocom.org/projects/quectel-modems/wiki/QMI
The libqmi is what powers Linux's qmi-utils
that can be used to configure such a module from Linux:
https://www.freedesktop.org/wiki/Software/libqmi/
This project collects drivers and libraries for these WWAN protocols: QMI, MBIM, QRTR. These could be used as reference. It contains libqmi. https://github.com/linux-mobile-broadband
Here is a script that I use to connect to Internet using qmicli on Linux.
This would allow to test the module to make sure the hardware works, before starting a custom implementation for it.
For instance, using an USB-UART external dongle (/dev/ttyACM0
or /dev/ttyUSB0
) attached to the module's UART instead the internal USB of the module ( /dev/cdc-wdm0
).
#!/bin/sh
# change /dev/cdc-wdm0 to whatever serial interface you have that can accept AT commands...
# adjust these for your SIM provider: public information
apn=orange user=orange pass=orange
qmicli -d /dev/cdc-wdm0 \
--dms-set-operating-mode="online"
ip link set wwan0 down
qmicli -d /dev/cdc-wdm0 \
--set-expected-data-format="raw-ip"
ip link set wwan0 up
qmicli -d /dev/cdc-wdm0 \
--device-open-proxy \
--device-open-net="net-raw-ip|net-no-qos-header" \
--wds-start-network="apn='$apn',username='$user',password='$pass',ip-type=4" \
--client-no-release-cid
qmicli -d /dev/cdc-wdm0 \
--dms-get-operating-mode
qmicli -d /dev/cdc-wdm0 \
--nas-get-signal-strength
qmicli -d /dev/cdc-wdm0 \
--nas-get-home-network
udhcpc -qf \
-i wwan0
From https://www.switchdoc.com/2021/05/tutorial-using-cellular-modems-with-the-raspberry-pi-4b/
I hope this is the right place to collect information for a driver for this module. Otherwise let me know I would move the content elsewhere... Maybe also there is an ongoing effort somewhere for this?
In my understanding, LTE modules like this solely use a standard protocol based on AT commands (or at least, it is possible to operate them this way). This protocol is exposed through various serial links, such as UART or USB.
With these two protocols, one does not require too much knowledge on the internals of the quectel module itself.
Resources
Getting started with poking around with AT commands: https://www.emnify.com/developer-blog/at-commands-for-cellular-modules
The original Quectel has a lot of information about how to integrate and use the module (bottom of the page): https://www.quectel.com/product/lpwa-bg96-cat-m1-nb1-egprs
• OS-IoT, the ATIS Open Source Internet of Things is an open source software library that simplifies the development of IoT devices, particularly small clients, that connect to the oneM2M e cosystem. -- wikiepdia https://os-iot.org/c-library/ https://atis.codebasehq.com/atis-os-iot/atis-os-iot-bg96.git https://www.os-iot.org/wp-content/uploads/2019/01/os-iot-bg96-guide.pdf
It might be the
qmi_wwan
andqcserial
drivers on Linux, so there are chances that these are the same for all Quectel devices: https://github.com/torvalds/linux/blob/master/drivers/usb/serial/qcserial.c https://github.com/torvalds/linux/blob/master/drivers/net/usb/qmi_wwan.cA repository with just the Quectel Linux USB drivers: https://github.com/bacnh85/Quectel_Linux_USB_Driver
An arduino library showing compact implementation of everything needed: https://github.com/m2m-solutions/M2M_Quectel/blob/master/src/M2M_Quectel.cpp
MicroPython might as well be able to run onto the Quectel module itself? I am still confused about this. https://blog.adafruit.com/2021/10/12/quecpython-is-quectels-port-of-micropython-for-modules/ https://python.quectel.com/home