- How to step by step set up a data connection over QMI
- Uses QMI USB modem, probably quite similar for us - but over QRTR instead of USB
- An introduction to libqmi
- QMI is based on "services" which provide different functionality
- Introduction to ModemManager
- Nice PDF explaining how the pieces go together.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo uhubctl -a off -p 2 -n 2109:2812 && printf "%b" "\0x01" > /dev/ttyACM0 && sleep 15 && sudo uhubctl -a on -p 2 -n 2109:2812 | |
export TOOLSDIR=$HOME/pmos/tools | |
. $HOME/pmos/tools/pmenv | |
. $HOME/pmos/tools/automation.sh | |
. ~/pmos/pmbootstrap/helpers/envkernel.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
# Wrapper for common fastboot flash commands | |
# Example usage (as an alias) | |
# Assumes the device is running Android, syncs kernel modules (and whatever else) | |
# and then reboots and flashes the kernel | |
# $ alias aflashboot="adb remount && adb sync; aflash.sh -t -b" | |
# | |
# Flashes everything, from bootloader | |
# $ alias aflashall="aflash.sh -t -s -v -b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# You may need to disable nftables for this to work, it's probably a bad idea to do so | |
sysctl net.ipv4.ip_forward=1 | |
iptables -P FORWARD ACCEPT | |
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.250.0/24 | |
echo "ip route add default via 192.168.250.1 dev eth0; setprop net.dns1 1.1.1.1" | waydroid shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.patches as patches | |
from scipy.stats import linregress | |
pmics = ["pmi8998", "pm660"] | |
fabs = ["gf", "tsmc", "smic", "mgna"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############## | |
## WARNING: This script uses `rm -rf` with variables, make sure you know what it's doing before running it | |
## and don't hold me accountable if you accidentally delete important stuff. | |
## Whilst I have tested it, your setup will be different and you should edit this to match. | |
## See more details at the bottom. | |
ANDROID_MAINLINE_DIR="/PATH/TO/AOSP/SOURCE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#define HDMI_EDID_PATH "edid.bin" | |
#define ALOGE(...) (printf(__VA_ARGS__)) | |
struct edid_extension { | |
unsigned char tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# basically what at-to_bootloader_hard does, turns off the USB port the phone is connected to so that | |
# VBUS is low and the device won't go to EDL (yay oneplus) | |
# then sends a byte to the arduino to tell it to perform a hard reboot by pressing volume up and power | |
# finally turn the usb port back on | |
# sudo uhubctl -a off -p 2 -n 2109:2812 && printf "%b" "\0x01" > /dev/ttyACM0 && sleep 15 && sudo uhubctl -a on -p 2 -n 2109:2812 | |
export TOOLSDIR=$HOME/pmos/tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec &> /var/log/sdm845-modem-prepare.log | |
AID=$(qmicli -d qrtr://0 -p --uim-get-card-status | grep -E "([A-Z0-9]{2}:){15}[A-Z0-9]{2}" | xargs) | |
while [ -z "$AID" ]; do | |
sleep 2 | |
AID=$(qmicli -d qrtr://0 -p --uim-get-card-status | grep -E "([A-Z0-9]{2}:){15}[A-Z0-9]{2}" | xargs) | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yeah, you can get it going in postmarketOS by using my pmaports branch here: https://gitlab.com/sdm845-mainline/pmaports/-/tree/mm-tracking | |
You'll need to get rid of the top commit it was just for my testing and doesn't work. | |
Checkout HEAD~1 ("modemmanager: QRTR testing") and then change the modem manager APKBUILD to use this branch: https://gitlab.freedesktop.org/aleksm/ModemManager/-/tree/aleksander/qmap-settings-udev (from !501). Then: | |
pmbootstrap checksum modemmanager | |
pmbootstrap build libqrtr-glib --arch aarch64 | |
pmbootstrap build libqmi -- arch aarch64 | |
pmbootstrap build modemmanager -- arch aarch64 |