manjaro-pinephone / plasma-mobile

Manjaro Plasma-Mobile
189 stars 18 forks source link

Modem does not enable on load #39

Open jerobarraco opened 2 years ago

jerobarraco commented 2 years ago

Im using a pinephone pro. The cellular modem was working fine. Then i did a system upgrade to the recent update a few days ago. And now the modem won't turn on on boot.

When i tried using mmcli at first it errored with 'invalid transition', something like https://forum.pine64.org/showthread.php?tid=16283&pid=107942#pid107942

I tried a couple of times and now i can turn it on using 'mmcli -m any -e -vvv' as root. I've tried creating a service to do this automatically but it always fails saying there is no modem, i have to do it manually.

I tried latest mobian and danct's arch, and the modem works well and starts on boot always.

ghost commented 2 years ago

it has been months that the modem is not recognised on Pinephone(not PRO), before that the Plasma had always been unstable with its communication with the modem, Ubuntu Touch and Phosh work fine

previously the communication would be lost when the USB hub restarted due to power surges

for you to have you an idea of the scheme read below

the kernel establishes a QMI communication channel with the modem and then the KDE Telepathy stack connects it to the Plasma and the applications

the modem can always be found as a QMI device in /dev/cdc-wdm0 and in the D-Bus through the "qdbus" utility, give "qdbus --system" and you will see the /quectelqmi_0 device

theoretically you can control the QMI device with the "qmicli" utility

from there on it seems that KDE Telepathy fails completely to manage the modem

so when I go out I boot another OS from the SD card if I want to have telephony and mobile data

jerobarraco commented 2 years ago

Thanks a lot for the information. Im new to Pp ecosystem and im not sure where to post things, and don't know who can fix what. In my case though i can make the modem work fine after logging in by typing that mmcli -e command, is just really annoying. Also danct build which is similar and also uses plasma was working (though im not entirely sure wether it also broke on the last update i cant recall clearly ).

I was wondering wether the servíce file that i create needed some tweaks to work (eg wait for KDe telepathy) . I'll try pasting it here later on the week. I'll also try wth qmcli. Thanks!

ghost commented 2 years ago

the updates can always break something, the worst thing is when they break the Plasma and you have to connect a keyboard and switch to terminal 3 to perform an update everyday until it is fixed and use another OS through the SD card

the qmicli is difficult to work with, the QMI can not perform parallel commands so because it is already occupied by the OS you have to force it to execute parallel commands and most of the times it does not respond, I have mastered the AT commands, you can have a look at my repositories especially if you want to upload the satellite almanac for the GPS to be able to fix the location in seconds

how did you fix it with mmcli?

you could use a script to automate the process and execute it automatically on boot

jerobarraco commented 2 years ago

you could use a script to automate the process and execute it automatically on boot

That exactly what im trying to do but im failing :/

Tried using this on /etc/systemd/system/mymodem.service

[Unit] Description=start the modem on boot After=ModemManager.service eg25-manager.service Network-Manager Requires=ModemManager.service eg25-manager.service [Service] ExecStart=mmcli -m any -e -vvv Type=oneshot TimeoutStopSec=3 [Install] WantedBy=multi-user.target

That one gets executed on boot but fails saying that it can't find any modem. If i manually start it after loging to desktop it does work.

note that mmcli command needs to run as root. i do not want to have to enter password on each boot

ghost commented 2 years ago

I remember that you should run only one modem manager, in the case of Plasma, Ofono is used by default so you start another modem manager.

I would try to write a bash script which will be the last thing to run after everything has been initialized.

Considering the following diagram I believe the problem is on the top layer because I can find the modem in the D-Bus so for some reason the Plasma shell can not detect the D-Bus entries, it is difficult for me to trace the problem both because the code is C++ and I have to understand the KDE code ex nihilo.

https://develop.kde.org/docs/build/plasma-mobile/telephony/

ghost commented 2 years ago

try the ofonoctl command to manipulate the modem without starting the modem manager, you may have a different problem on Pinephone PRO

jerobarraco commented 2 years ago

thanks!

jerobarraco commented 2 years ago

hmm i think that is not the issue. modemmanager seems the default. i dont even have ofonoctl installed.

ghost commented 2 years ago

So Pinephone Pro uses a different modem manager by default. I am still far from solving the problem, for the time being I use either Phosh or Ubuntu Touch for a stable phone performance, for everything else I use Plasma.

jerobarraco commented 2 years ago

I see. Thanks. No prob, i have faith (and love on) Plasma, so I'll wait patiently and help if possible.