Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pine64-pinephone: modem-control ➡ eg25-manager #464

Closed
wants to merge 2 commits into from
Closed

pine64-pinephone: modem-control ➡ eg25-manager #464

wants to merge 2 commits into from

Conversation

tomfitzhenry
Copy link
Contributor

@tomfitzhenry tomfitzhenry commented Mar 2, 2022

Fixes #348 and #463.

Background: There are ways to control the modem's lifecycle on Pinephone: eg25-manager and Megi's modem-power driver. Other Linux distros have settled on using eg25-manager.

This PR moves Mobile NixOS from modem-power to eg25-manager.

This has a few benefits:

Notes:

overlay/overlay.nix Outdated Show resolved Hide resolved
@tomfitzhenry
Copy link
Contributor Author

I've documented modem managers and how to test them (e.g. "can receive a call when asleep") in https://wiki.pine64.org/wiki/PineModems#Modem_management . I will update this PR once I've completed those tests.

@tomfitzhenry
Copy link
Contributor Author

tomfitzhenry commented Mar 5, 2022

I've performed the tests listed on https://wiki.pine64.org/wiki/PineModems#Modem_management :

  • Modem is recognized by ModemManager on boot. eg25-manager.log
  • Can make a call
  • Can receive a call
  • Can receive a call when asleep: systemctl suspend

@zhaofengli
Copy link
Member

zhaofengli commented Mar 6, 2022

Tested working as well:

  • Modem is recognized by ModemManager on boot. eg25-manager.log
  • Can make a call
  • Can receive a call
  • Can receive a call when asleep: systemctl suspend

I have tested this to be working on my Pinephone with:

systemd.packages = [
  pkgs.eg25-manager
];

systemd.targets.multi-user.wants = [ "eg25-manager.service" ];

services.dbus.packages = [
  pkgs.eg25-manager
];

Should this replace what was previously in modem.nix? The modem should work out of the box without manual configuration.

@tomfitzhenry
Copy link
Contributor Author

Should this replace what was previously in modem.nix? The modem should work out of the box without manual configuration.

Good idea. I've updated this PR to include that config.

@tomfitzhenry tomfitzhenry marked this pull request as draft April 17, 2022 04:40
@tomfitzhenry
Copy link
Contributor Author

I've moved this PR to back to draft, so I can test the changes discussed in #464 (comment).

@tomfitzhenry
Copy link
Contributor Author

I've moved this PR to back to draft, so I can test the changes discussed in #464 (comment).

Done. The modem still starts successfully on boot, with the most recent change of keeping mobile.quirks.u-boot.additionalCommands.

@tomfitzhenry tomfitzhenry marked this pull request as ready for review May 6, 2022 16:00
Copy link
Member

@samueldr samueldr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modem options needs to be trivial to enable/disable.

Lists in the NixOS modules system won't allow removing items added to them.

Couple that with the fact that eg25-manager dependencies don't cross-compile, this makes for an awkward situation when trying to build examples/hello, which should always build successfully.

Furthermore, with the Pinephone Pro, I believe this should be broken out in a more discrete option set that can be used on any device.

So I guess the option should default = false, since otherwise it would be enabled on irrelevant platforms. Then it should be mkDefault'ed to true in the pinephone [and pro] configs. Finally, cross-workarounds could warn and force disable it [though the warning would always be shown even on platforms not relying on eg25-manager... hmmmm].

Thoughts?

fx-chun added a commit to fx-chun/mobile-nixos that referenced this pull request Jun 26, 2022
@IreneKnapp
Copy link

I'm doing related work, I'm just replying to this thread so I'll see future remarks on it. We should sync up over on Matrix.

@samueldr
Copy link
Member

Adding some more notes/clues, I think adding them as quirks under the mobile.quirks.quectel.eg25-modem, gated behind an enable option would be the way to go.

I'm assuming this would also be the same exact implementation for the Pinephone Pro, maybe @wentam can confirm?

If it's not, maybe it's something that's not specific to the "host" hardware (the phone), but something specific to the "integration" of the software (kernel, services), and in that case differentiated with an option as needed.

@wentam
Copy link
Contributor

wentam commented Oct 27, 2022

Adding some more notes/clues, I think adding them as quirks under the mobile.quirks.quectel.eg25-modem, gated behind an enable option would be the way to go.

I'm assuming this would also be the same exact implementation for the Pinephone Pro, maybe @wentam can confirm?

The setup to run eg25-manager on pinephone pro should be exactly the same as pinephone, yes.

I've been running the following in my configuration.nix on PPP (with a locally packaged eg25-manager to get a newer version):

  # eg25-manager
  systemd.packages = [ eg25-manager ];
  systemd.targets.multi-user.wants = [ "eg25-manager.service" ];
  services.dbus.packages = [ eg25-manager ];

+1 for wrapping it up in a module and providing a simple enable flag.

@tomfitzhenry
Copy link
Contributor Author

tomfitzhenry commented Dec 21, 2022

[Going through my Github PRs and closing stale ones.]

My progress stalled on this a while ago. I'll close to make it clear to other contributors that I don't intend to get back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pine64-pinephone: get eg25-manager to work
5 participants