keenanjohnson / cellular-featherwing-pcb

The PCB Design for a Cellular Adafruit Featherwing based on the Quectel BG96 LTE Cat M1 & Cat NB1.
1 stars 0 forks source link

Resources for driving the module from MicroPython #2

Open josuah opened 1 year ago

josuah commented 1 year ago

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

josuah commented 1 year ago
josuah commented 1 year ago

Script

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/