modemmanager: delay the launch of MM for XBee Cellular

The XBee Cellular needs more time to settle down before MM is able to
detect it on boot. As this is connected to one of the 'ttymxc' serial
ports, use that port to conditionally delay the launch of MM.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-04-27 18:21:20 +02:00
parent 7554f05b5f
commit b1f2b85197
1 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,13 @@ POLLING_WAIT=5
[ -z "${IF_APN}" ] && exit 0 [ -z "${IF_APN}" ] && exit 0
background_connect() { background_connect() {
# The XBee Cellular needs more time to settle down before MM is able
# to detect it. As the XBee is connected to a 'ttymxc' serial port,
# we check those ports to conditionally delay the launch of MM.
if echo "${IF_PORT}" | grep -qs ttymxc; then
sleep 25
fi
# Ensure ModemManager is running # Ensure ModemManager is running
killall -0 ModemManager 2>/dev/null || ModemManager --log-file=/var/log/modemmanager.log & killall -0 ModemManager 2>/dev/null || ModemManager --log-file=/var/log/modemmanager.log &