Skip to content

Instantly share code, notes, and snippets.

@parrotmac
Created November 15, 2018 08:14
Show Gist options
  • Save parrotmac/59fc81076e475866a8645b5ff2bdce72 to your computer and use it in GitHub Desktop.
Save parrotmac/59fc81076e475866a8645b5ff2bdce72 to your computer and use it in GitHub Desktop.
Send serial command to modem using ModemManager via DBus
#!/bin/sh
# Sends command 'ATI' to modem #3
# Get a list of modems by running `mmcli -L`
# Timeout is (probably) 2 seconds
# Also see https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.Command
dbus-send --system --dest=org.freedesktop.ModemManager1 --print-reply /org/freedesktop/ModemManager1/Modem/3 org.freedesktop.ModemManager1.Modem.Command string:'ATI' uint32:2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment