Commit 7885dff933 ("modemmanager: skip virtual net devices in hotplug
script") exited 25-modemmanager-net for every device under
/devices/virtual/* to stop the per-device "event processed" line from
spamming daemon.info on every boot and hotplug replay.
That blanket exit also dropped the QMAP/QMI/MBIM multiplexing netdevices
(qmapmux*, qmimux*, mbimmux*). Those live under /devices/virtual too,
but they are real modem data ports and mm_report_event() deliberately
keeps them (ModemManager then resolves their lower_* link back to the
physical modem). Skipping them in the hotplug script broke multiplexed
data connections.
Rather than duplicating that qmapmux/qmimux/mbimmux allow-list in the
hotplug script -- where it would drift out of sync with the copy in
mm_report_event() -- keep the filter in one place. mm_report_event()
now returns non-zero when it drops a virtual device, and the hotplug
scripts only emit their "event processed" info log when the event was
actually reported. The noisy log lines are gone for the dropped
devices, and the mux ports still reach ModemManager.
Fixes: 7885dff933 ("modemmanager: skip virtual net devices in hotplug script")
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
The custom initial EPS bearer code uses init_username, which agrees
with the documented UCI option. However, the option was registered
and read as init_user, so init_username was discarded before the
custom EPS bearer settings were passed to mmcli.
Register and read the option consistently as init_username.
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
Make the timeout for command execution configurable, as not all modems and
mobile networks behave in the same way.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Remove the trailing '...' from the log messages to bring them into line
with the other log messages in this file.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Every net uevent - eth ports, USB hubs, bridges, taps, SQM IFB,
GRE tunnels, veth, tun/tap - is handed to mmcli via
25-modemmanager-net's mm_report_event call, so ModemManager logs a
'not supported by any plugin' notice per device on every boot and
hotplug replay:
ModemManager[15132]: <msg> [base-manager] couldn't check support
for device '.../fsl-ehci.0/usb1/1-1/1-1.1':
not supported by any plugin
mm_report_event() already discards virtual devices internally, but
only after mm_log "info" has written a "hotplug: add network
interface XXX: event processed" line to daemon.info for every one
of them.
Mirror the same guard in the hotplug script by exiting early when
DEVPATH points under /devices/virtual/*, which covers SQM IFB, GRE,
bridges, veth, tun/tap. This never rejects a physical modem port
(kernel wwan, MHI, USB CDC/RNDIS/QMI/MBIM are all under real bus
subtrees).
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
At boot procd replays every previously-seen uevent before
/etc/init.d/modemmanager starts. Each replay walks the hotplug.d/
tree, which calls mm_report_event() in modemmanager.common. That
helper does two independent things:
1) appends the event to ${MODEMMANAGER_EVENTS_CACHE}, and
2) runs 'mmcli --report-kernel-event=...' to notify a live MM.
Step 1 is what matters for boot; step 2 exists so events fired
after MM is running get reported without waiting for the next
cache replay. The cache path is intentional: ModemManager-wrapper
starts MM, then mm_report_events_from_cache() polls 'mmcli -L'
until the bus is available and replays every cached event.
At boot the modemmanager service instance hasn't been spawned by
procd yet, so step 2 always fails with:
daemon.err ModemManager[NNN]: hotplug: Couldn't report kernel
event: error: couldn't get bus: Could not connect: No such
file or directory
That's one daemon.err line per hotplug script per port, per boot.
On a dual-modem board that's a dozen spurious errors before the
service even starts. Nothing is lost -- the wrapper's cache
replay picks them all up seconds later -- but the log noise makes
real ModemManager errors harder to spot.
Guard the live call with a cheap pidfile-based liveness check.
The pidfile is procd's, so it proves the service instance has
been spawned, not that MM is already reachable on the bus; the
brief wrapper-startup window (procd spawns the wrapper -> wrapper
execs MM -> MM reaches the bus) is not covered. In practice no
fresh uevents fire in that window on the boards this was tested
on, and events that do arrive there are still cached. If the
service hasn't been spawned yet, the event is silently cached and
the wrapper handles it. If it has, behavior is unchanged.
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
This adds the feature to choose which plugins to include or not.
Additionally, the needed shared plugins are added automatically.
Signed-off-by: Christian Korber <ckorber@tdt.de>
This commit enables to choose whether to compile the plugins into the
binary or not. If not included, it moves the plugins to
`/usr/lib/ModemManager/`.
Signed-off-by: Christian Korber <ckorber@tdt.de>
lua-cjson depends on liblua, so add missing lua dependency.
modemmanager-rpcd has no version, so add a simple test, and skip version check.
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Use specific SIM path instead of 'any' when unlocking with PIN
code. This fixes PIN unlock issues on devices with multiple modems
where 'any' could select the wrong modem.
Bump modemmanager PKG_RELEASE
Signed-off-by: micpf <micpf@westermo.com>
This commit removes the non-empty APN requirement for initial EPS
bearer. An empty APN value is valid and means that the modem will use a
network provided APN offered by the operator.
Signed-off-by: Simonas Tamošaitis <simsasss@gmail.com>
The initial EPS is stored on the modem side. When establishing a connection,
it must therefore be deleted if no EPS has been configured. This is because
the system does not know whether one was configured previously.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The pppd supports the option to configure the name of the network interface
at startup using the ifname option.
The pppd can overwrite the name of the network interface at startup using
the 'ifname' configuration option. If this option is not specified, the new
network interface is created according to the following scheme:
ppp<number>, e.g. ppp0, ppp1 and so on. This can therefore change with
every start if the number has been already assigned to another ppp connection.
In order to always get the same interface name with the modemmanger proto via
ppp, it is created according to the new scheme by setting the 'ifname':
ppp-<uci network interface name>, e.g. ppp-wwan.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf needs to be 644
so that it can be read to prevent the following since dbus runs as an
unprivileged user:
dbus-daemon[12465]: Encountered error 'Failed to open "/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf": Permission denied' while parsing '/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf
Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc
Signed-off-by: John Audia <therealgraysky@proton.me>
This commit sets default of `disable_modem` to 1 and disconnects modem.
If set otherwise it keeps the modem connected.
Signed-off-by: Christian Korber <ck@dev.tdt.de>
If the ModemManager is stopped via '/etc/init.d/modemmanager', mmcli calls
always remain in the process list. This is because the ModemManager-monitor
call is not terminated properly, as the kill signals are not handled
correctly in the startup script for mmcli.
To fix this, the signal handling is refactored.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The default 'timeout' value is 30 seconds when calling an mmcli action. That
is too long. For this reason, the mmcli 'timeout' option is specified for
calls and the value is set to 10 seconds.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This change introduces an optional configuration
of the netifd integration in the ModemManager package.
When disabled, it removes the NETIFD dependency and
other unwanted components from the root filesystem
during the build phase.
Additionally, in the modemmanager.common the netifd-proto.sh
inclusion line can be savely removed as there is no usage
of it in its functions.
Signed-off-by: Gilles Lenaerts <gilles.lenaerts_ext@softathome.com>
If the modem loses the connection, an attempt is made to re-establish the
connection via the report-down script.
Until now, the modem was disabled when the modem processed the teardown of
the modemmanager protohandler. The immediate up events of netifd renables
the modem right away. This takes time, which is not necessary.
This commit changes the behavior so that the modem is not disabled when
the modemmanager is disconnected via the report-down script.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
After the SIM has been successfully unlocked, it is initialized. This can
take longer on some modems, so we must wait until the modem is ready to
execute the next commands.
Otherwise the modem cannot be enabled and aborts with the following
error message:
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: modem in initializing state'
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
If a configured 'plmn' is deleted from the configuration between a connection
setup, it will continue to be used because the modem remembers it.
Therefore, the 'plmn' stored in the modem must be deleted when a new
connection is established if it is no longer in the configuration.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
In the current implementation of the modemmanager 'proto', if a 'plmn' and a
'technology' is configured, the 'plmn' is set first and then second the
'technology' on a 'proto' setup.
However, this is problematic if a 'technology' has already been set in an
earlier run. It is possible, that this previously set 'technology' is not
available at the current location, as the modem remembers the setting.
To fix this, first set the technology and then the plmn.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
If the ModemManager is started with debug, all outputs are written to the
system log. To simplify debugging, a logging file is now created under
'/var/log/mm.log' in this case. This simplifies error analysis.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This new check in the proto modemanager prevents the SIM card from being
blocked and therefore PUK is not required. If the PIN is entered incorrectly
in the 'uci' configuration, it makes no sense to try this several times
until the PUK is required. Should it nevertheless happen that the PUK
is required, then this will logged.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The variable interface is used in the sub-function 'modemmanager_check_state'.
However, this is not an argument of the function and so the global value
is used. Addding the variable as an function call argument fixes this.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
To make the source clearer, the program parts for the 'locked' and 'failed'
cases are outsourced to sub-functions.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The correct values are prefixed with 'modem.generic'. This is missing
for the value 'state' and 'state-failed-reason.
While we're at it, let's move the readout of 'state-failed-reason' to the
failed case, because that's the only place it's needed.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This makes debugging at system startup easier and shows how long we are
waiting for the ModemManager to start.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
ModemManager does not depend on Lua by its own, so make it possible to
not have a requirement on Lua if the rpcd integration is not needed.
Signed-off-by: Christian Svensson <blue@cmd.nu>
The 'modemmanager' uses the 'dbus'. Status information can be retrieved
with the 'mmcli' command, this can also be output in json format.
This commit adds a new 'ubus' backend with which this information can
be easily accessed via ubus.
* ubus call modemmanager info
* ubus call modemmanager dump
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The message 'MM_CONNECT_IN_PROGRESS' is a status message, not an error
message. To avoid confusion, the message has been removed.
Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
This commit improves the automatic reconnect logic. If the modem cannot
establish a connection, for example due to poor reception, the
proto_block_restart prevents the interface from trying to reconnect.
To enforce the connection, this commit adds a new option that allows the
system to attempt to establish a connection indefinitely.
Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
It seems that PR #24113 introduced incorrect hashes for multiple packages.
So, lets fix all of them at once.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Due to the change in the version description, the package must be
downloaded again. In addition, the standard compression method has changed
to zst. The checksum must therefore be recalculated.
Fixes: 22f8fd5c5b ("modemmanager: add missing PKG_VERSION for APK")
Signed-off-by: Florian Eckert <fe@dev.tdt.de>