Is there a way to have ModemManager remove a modem that has been powered down?
I'm using ModemManager via Python and DBus on an embedded project to control my modem. My Raspberry Pi distro has ModemManager 1.10 as the latest.
On my embedded HW I can turn off the modem via an AT command and then trigger the modem via GPIO to turn on again. This is the normal flow which works properly:
- Raspberry Pi Powers Up
- Turn modem on with GPIO
- Tell MM to scan for modems
- Find modem
- Wait for network registration
- Use Network Manager to start and stop modem connection
- Disable modem using equivalent of mmcli -m 0 -d
- Open serial port and issue AT command to Turn off modem
- Raspberry Pi Powers Down
I have a debugging mode where I don't power down the Raspberry Pi but I would like to still power down and power up the modem. My problem is that I would have to put custom code in to skip powering the modem and instead enable the modem (equivalent of mmcli -m 0 -e). Is there anyway to remove the modem from ModemManager list of modems so on the next loop I can keep the same loop process? Such as a Modemmamanger remove modem -m 0