Month: February 2020

Taking Screenshots on the PinePhone… sort of

We all know that, when playing around with a new device, the most important thing you can do is record the experience so that others can behold your techno-wizard glory.  Pics or it didn’t happen, no?  Which makes it that much more frustrating that the PinePhone currently can’t take screenshots in seemingly any of the OSes that are compiled for it.

Attempt 1: The Built-In Option

I’ve been using Ubuntu Touch, since at the moment it has the most features and the least suck of the available OSes.  (Technically the build is from UBPorts, but I’m going to use the terms interchangeably because I’m lazy.)  Allegedly, UBPorts lets you take a screenshot by simultaneously pressing Volume Up and Volume Down, but that doesn’t work on the PinePhone – best I can gather, that only works on Android ports of Ubuntu Touch.

Attempt 2: The Command Line Option

Other posts suggest that you can use phablet-screenshot from the phablet tools package, but that too leads to disappointment, with the program freezing.  Running debug mode (-d) shows that it’s trying to pull the screenshot from adb:

...
+ adb start-server
+ check_devices
+ set +e
+ adb wait-for-device

Since the PinePhone isn’t running Android, adb isn’t really a thing, and you’ll end up waiting forever.

Attempt 3: The Raw Option

Looks like we’re going to have to create this from scratch.  All of the above-mentioned techniques essentially do the same thing: they dump the framebuffer /dev/fb0 to a file and then convert that file to PNG, JPEG, or whatnot.  How hard can that possibly be?

Dump the Framebuffer

The first step is easy enough: cat /dev/fb0 > img.raw.  This dumps the framebuffer (i.e. what’s on screen) to a raw file.

Figure Out Your Screen Size

The raw image file is just that: a raw stream of pixels, with no dimensions built in.  As such, you next need to figure out how big your screen is.  For the PinePhone, this is 720×1440 pixels.  If you want to discover this yourself, you can just type fbset (sudo apt install fbset if necessary).

Get the Script

This helpful chap cooked up a lovely little Perl script that will then convert the raw image to png.  Download the script, chmod + xto mark as executable, and invoke with ./iraw2png 1440 720 img.raw img.png.

NB: I swapped the dimensions.  You’ll see why.

Inspect the Results

Here’s the result, which doesn’t exactly look like the Desktop:

Success!

It definitely captured a thing.

Mope!

It captured some manner of console, perhaps the TTY output? I don’t know. Evidently there are other framebuffers to be found. If you know how to find them, please do send a comment since I’m up a creek on this one.

Posted by Adam Labay, 5 comments

Mistakes to Avoid With the PinePhone

As mentioned before by me and many, many others, the PinePhone Brave Heart edition is very much not road ready.  That’s fine, but it does mean you’ll probably find yourself reflashing your device’s image a few times.  What follows are the various mistakes that have led me to re-flash my phone.

Decreasing the Brightness

As soon as you move that slider, your brightness will go to nil. As in no image at all.  If you have SSH enabled, you can probably set that brightness back, but there’s a good chance that you’ll make the move prior to having SSH set up.  Whoopsie.

Applies To

  • Sailfish OS
  • Ubuntu Touch (only if you decrease it fully)
  • PostMarketOS (only if you decrease it fully)

Turning off WiFi

Under Ubuntu Touch, turning off WiFi somehow borks the radio, requiring you to toggle it off and back on.  Not a huge nuisance, but not nothing either.

Applies To

  • Ubuntu Touch

Following that modem.txt document

A lot of folk, myself included, have tried to enable voice calls by following this file.

Don’t. do. it.

The file relies on a custom kernel, and if you set your QDAI settings per this file, you will end up unable to make phone calls until you reset it to factory defaults – which you have to do manually.

Posted by Adam Labay, 1 comment

Ubuntu – The Most Stable PinePhone OS So Far

Of the four operating systems I’ve tried so far on the PinePhone, Ubuntu Touch (aka UBPorts) is the most stable, getting me nearest to actually placing a successful call.

Installation

The process starts by downloading the latest image, either from the Pine64 wiki or from the UBPorts Jenkins site. Flash the image onto a microSD card using Balena Etcher or your favorite flashing tool.

First Use

Initial startup works like a charm. You’ll want to attach to WiFi since the SIM won’t initially be read. Once you’re in, hop on the Interwebs and have some fun. Just nothing that requires audio, since that’s the next step.

Enable Mobile Data

Ironically, your fancy new phone won’t be able to use any mobile functions. You need to enable the modem, this time and every time you boot. There’s probably a way to turn the process into a startup script; I’ll report back if so.

At any rate, open the Terminal app and enter these commands (taken from this post):

sudo /usr/share/ofono/scripts/enable-modem
sudo /usr/share/ofono/scripts/online-modem

The sudo password is phablet

Once you’ve entered the first command, the second one is a piece of cake thanks to Ubuntu Touch’s nifty keyboard. Swiping up on the keyboard reveals the cursor, which is moved by swiping around. Nice touch, UBPorts.

Enable Audio

Much like enabling mobile data, you’ll have to do this every time you start the device.

Open the Terminal app and enter the following:

sudo modprobe snd_soc_simple_amplifier
sudo modprobe snd_soc_simple_card_utils
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'Line Out' unmute

Optionally, add the line amixer sset 'Line Out' 100% to max out the volume (best I can tell, you’re setting the volume that 100% on the volume rocker corresponds to; i.e. if you leave this at 55% (the default), the loudest you can make your phone is 55% of its true potential).

Don’t Disable Wifi

If you do, it won’t come back. Rather, it will appear enabled, but no access points will appear and even saved APs won’t connect. To remedy, open Terminal and enter the following:

sudo nmcli radio wifi off
sudo nmcli radio wifi on

What Works

So far, I have successfully

  • Played YouTube videos
  • Surfed the web on mobile data
  • Rebooted the phone a bunch of times

What May Yet Work

It turns out that my cheapo FreedomPop SIM requires some proprietary app to do text and calls, so I can’t test that at present. But if the Reddits and the forums are any indication, I’ll be a lucky son of a gun if I manage to successfully place a call. Texts shouldn’t be a problem.

What Doesn’t Work

Taking a friggin screenshot. Maybe there’s another app required?

Updates to follow.

Posted by Adam Labay, 0 comments

PinePhone First Impressions

My PinePhone BraveHeart edition arrived yesterday, and the past few hours have been spent playing around with it and trying to place a basic call.  Findings so far:

For Developers and Maniacs Only

The folks at Pine64 make very clear that this phone is not a daily driver, but it bears repeating: this is not so much a phone as a fun Linux project with a SIM slot.  You have to install your own operating system, and none of the choices on offer claim to be even remotely road-ready.  In particular, the four I’ve installed so far have had one or more of these symptoms:

  • Unusably slow
  • Can’t find the SIM
  • Require a light to be shined on them to display anything
  • Lock you out without a password

Further, even the folks online who have managed to get past the above nuisances still generally can’t get the silly thing to successfully place calls – you know, the one thing a phone is supposed to do.  So again, not a daily driver.

But All Kinds of Fun to Play With

With all those caveats out of the way, the thing’s a hoot to mess with. If something goes pear-shaped, just pull out the microSD card and re-flash it. And at $150, the price point is great for a project.

What Lies Ahead

I’ll do my best to make the silly thing work, and will report back with whatever tips and tricks I come across.

Posted by Adam Labay, 0 comments

Adventures with XYO – The Thrilling Conclusion

Back in November I decided to try out mining XYO using the Coin app on an old Nexus 5X that I reappropriated for the purpose.

Now it's February, and I think I'm about done with the whole thing.

To be candid, the main reason is that my sentinel went through the wash, and while it looked like a fresh battery would fix it back up, the new batteries don't seem to last more than a couple weeks. As such, I'm out $12.95 for the sentinel and $7 for a set of replacement batteries. In the same amount of time, I've earned about 8,000 COIN, which, if I could convert them to XYO (that option doesn't start until 10,000), would be worth...

31 cents.

I'll probably throw a few other posts about the various aspects of the COIN app and geomining, but for now here are my main takeaways:

Great for Truckers

Perusing the Reddits, the one group of people who seem to get a decent-ish return from geomining are truckers, who spend literally all their time cruising from tile to tile.  I'd wager that Uber drivers fit this description as well, though truckers have the advantage that they can geoclaim gobs of regions every cycle.  Truckers, who pass from cell to cell quickly and thus need a rapid recharge cycle, are probably the only group who benefit from Pro accounts as well.

And Nobody Else

As an ordinary schlub who works in an office and either drives to work or takes a train, there's simply no return to be had.  Five miles of walking net about 100 COIN, which isn't a whole lot greater than just sitting around refreshing the tile periodically while I work from my desk.  Geoclaiming isn't an option either, since the two regions I can claim (work and home) are both chronically oversubscribed, making the a losing proposition for everyone involved.

It's a shame, really.  The premise of geomining, as outlined on an XYO Medium post, ain't bad.  Using a fleet of smartphone-armed passers-by to determine whether packages arrived is clever, and I really do hope they figure out a way to make it work.  For now, though, it's just another GPS device attached to yet another freight truck.

Posted by Adam Labay, 0 comments