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>
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 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>
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>
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>
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>