Pinephone Pro GPS,Camera

2023-04-02

I recently posted about getting Gentoo running on my Pinephone Pro with Pinephone Keyboard. In that post I had gotten this device to pretty much act like a laptop. I had pretty much every piece of software I have on my laptop up and running on my pinephone, under sway using wayland without Xwayland.

Since then I've been working to get GPS, and then the Camera to work. And I now have both working at a beta level at least. Time will tell how stable my efforts will be. Note that the GPS setup is also largely a prerequisite for using the cellphone modem, though I'm not interested in paying for service at this time, so I haven't tried to get that working.

GPS

I'm going to start with the GPS. Specifically my goal was to get offline puremaps to work with GPS input. gpsd has existed for ages, but modern Linux phone OSes largely use geoclue as their input. Geoclue can determine your location using a GPS, but also by looking up wifi access points and cellphone towers in a database, you can use either the database owned by Mozilla or the one owned by Google. Both have privacy implications. You can also *just* use GPS if you like.

Both the pinephone and pinephone pro use an eg5 modem for talking to cell towers. This modem also embeds a GPS unit as well, so we need to get communciation with the eg25 modem working to use the GPS. A lot of documentation I found about the eg25 modem claims that if you don't see the eg25 modem on your USB bus, the modem is faulty. This is false. There are in fact other reasons the mdoem might not appear.

You'll also need a SIM card for the modem. It doesn't need to be recent or active, any SIM card should o it. It's actually possible to get the GPS to turn on, get a lock, and spit out GPS data without the SIM using AT commands, but it's not possible to get geoclue to talk to it, because it'll only talk to the modem if the modem is "enabled", which requires the SIM card. So, my advice is jsut drop a SIM card in and move on.

Camera

As of the time of writing of this post megapixels supports the pinephone camera out of the box, but not the pinephone pro camera. This will probably be rectified soon at which point you can use the "megapixels" app from the bingch overlay. For now though, you'll need to build it yourself.

Megapixels should now be able to take photos. The green tint is only in the viewfinder, the final images will be properly post-processed and should come out with pretty okay colors.

Kernel config

Here's the kernel config I'm using right now. I'm still building some modules I don't need, but as I get things working it's becoming clearer what I can just remove. pinephonepro-kernel-config-2

One last thing. As I mentioned in my previous post, you need to ensure you're not constantly logging to the internal storage or you'll burn it out. I've set up the systemd journal stuff to only log to memory. I removed virtual/logger and told portage it was installed via /etc/portage/packages.provided, so I have no logger. After trying a few other approaches I made /var/log a small tmpfs. /tmp and /var/tmp/portage are also tmpfses for similar reasons. I tried symlinks and some other tricks for /var/log and none quite worked.

Conclusion

That just about wraps it up for the pinephone pro. At this point we have almost all of the hardware capabilities of any of the main phone linux distributions, but working on Gentoo. The one thing we don't have working is the "cell" part, because right now that's not something I particularly want. But we have the eg25 modem working, so we're a good chunk of the way there.

In addition to the cell stuff there are a couple of things that still don't work.

Otherwise though our phone can do everything (within processing power limits) that a laptop can do, AND several things only a phone can do, has a physical keyboard, and fits in a large pants pocket. This is the closest I've ever gotten to a true convergence device. There are plenty of improvements to be made, but for the first time I have a truly portable linux box that's actually *useful*.

Lastly, here's some useful resources