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>
The following commits were added shortly after the release of Modemmanager
version '1.24.0'.
Patch: 0002-modem-helpers-cinterion-allow-spaces-in-SXRAT-test-r.patch
Backport: 6b6997362b
Issue: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/974
Patch: 0003-modem-helpers-fix-checking-of-CDMA-EVDO-access-techn.patch
Backport: 9e205f4784
Issue: no
Patch: 0004-iface-modem-voice-recheck-call-state-polling-when-ca.patch
Backport: 92e666e1c9
Issue: no
Signed-off-by: Florian Eckert <fe@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>
With the recent move to using ZSTD as the default compression format
for packaging git repo clones we must refresh all of the hashes for
the packages feed as well.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Virtual netdevices created for multiplexing should not be skipped
when reporting events, otherwise it is not possible to setup the
data connection.
Add these exceptions in mm_report_event function.
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
There are situation for mobile routers, that the modemmanager can not
stay connected to the mobile network. There can have various reasons.
In order for the system to reconnect automatically, the netifd must be
informed that it must re-establish the connection.
The modem manager already does have a script callback handling which is
already used by the modemmanager in openwrt. Currently the modem is marked
as not unavailable when a disconnected event is detected.
The behavior was changed with this commit, so that a reconnect of the
interface is now triggerd via the netifd if the modem disconnects.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
If a 'plmn' is set in the configuration, a registration attempt should be
established before the simple-connect command. If the plmn is set during
the simple-connect, a network change may occur during the connection setup.
To prevent this, the registration is started before the simple-connect with
a separate mmcli command. So that we can be sure that the modem is already
registered in the correct network before the simple-connect command.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Before a new connection attempt is made, the previous connection must be
cleaned up before further connection attempts are made. This is now done
by moving the cleanup and enable sequence to the beginning of the
conection setup.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Moving the openwrt related files to subdirectories as they are installed
on the system. This change makes it immediately apparent during development
where the file is to be installed in the running system.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The log is filled with 'debug' messages. This is not necessary and is
only normaly needed during development. To suppress this message, check
whether the level is 'debug' and if so, suppress it. If this message is
required again, the message can be generated by commenting out this line.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Before this change, the status of the sysfs paths from the kernel events
was cached with a cache file. This is necessary to mark configured modems
as available for the netifd.
Using the new monitor service via the mmcli command 'mmcli -M' simplifies
the whole process. There is no need to start sub shells in the background
anymore that monitors whether the modem has already been added to the
ModemManager.
For this purpose, a new service was added that reacts on add and remove
events for modems in the ModemManager and, if necessary, marks the logical
netifd interface as available.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
These moved functions are general functions. This is a preparatory
commit so that these moved functions can also be used in other
ModemManager scripts.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>