10-21-2021, 02:40 AM
Glad it works! What I'm using, on Manjaro Phosh (where restarting eg25-manager works), is a systemd timer to check the modem every minute (as long as the phone is awake) and bring it back up when lost automatically. In my case the modem as /dev/ttyUSB2 disappears, so if that file is gone, eg25-manager is restarted. You could check if in your case /dev/ttyUSB2 disappears as well (or if you find other symptoms of it) and adapt the service unit to restart ModemManager:
/etc/systemd/system/modem-test.timer:
/etc/systemd/system/modem-test.service:
/etc/systemd/system/modem-test.timer:
Code:
[Unit]
Description=Check presence of modem every minute
[Timer]
OnBootSec=60
OnUnitActiveSec=60
[Install]
WantedBy=timers.target
/etc/systemd/system/modem-test.service:
Code:
[Unit]
Description=Check if modem is present and restart eg25-manager if necessary
ConditionPathExists=!/dev/ttyUSB2
[Service]
Type=oneshot
ExecStart=systemctl restart eg25-manager.service