02-24-2022, 08:26 AM
You can piece this together from a variety of sources, which I've linked to in this post, and I DID eventually put it all together but I'm posting this hoping to help make it a bit easier one someone.
I've got the regular PinePhone (not Pro) running Mobian, (because I'm most familiar with Debian). This should be everything you need to know to get the new keyboard case working.
1. Fix the keyboard case's pogo pads
First, the hardware of the keyboard needs to be hacked a bit. It won't work out-of-box. Locate the Pogo pin pads in the back cover of the new keyboard case where the phone's pogo pins are supposed to make contact. The pogo pads on the keyboard case will not make contact with the pogo pins on the back of the phone unless you do something to raise the pads.
I carefully pried the plastic holding the pogo pads from the back of the case and slipped a small folded strip of paper beneath them. The plastic holding the pads is glued to the case (which will be the new back of the phone case) and can be pried away carefully. There were no screws in my keyboard case holding the pogo pads.
reference https://xnux.eu/pinephone-keyboard/faq.html#ts in the troubleshooting section at the bottom.
2. Update to a version of Mobian that has the kb151 driver in the kernel
I reinstalled Mobian using the most recent weekly build found here: https://images.mobian-project.org/pinephone/weekly/. The Stable release, at the time, didn't yet include the KB151 module that supports the I2C keyboard. I used the Feb 20th release; note the list is in ascending order and the most recent release is at the bottom.
I used the Jumpdrive method to install directly onto the eMMC. https://wiki.pine64.org/wiki/PinePhone_I..._JumpDrive
3. Install the pinephone in the pinephone keyboard case
Once a current version of Mobian is installed and the pinephone is installed in the keyboard case, the keys are mostly functional. I think the only problem is that the FN keys don't work. The kernel used by Mobian includes a module called kb151, which is an i2c keyboard driver specifically for this keyboard case.
4. Build and enable the userland driver
A 'userland' driver is available which also supports the FN keys. To install this userland version of the driver (and disable kb151), do the following from King's Cross, or any other terminal emulator on the phone...
$ git clone https://xff.cz/git/pinephone-keyboard/
$ cd pinephone-keyboard
$ make
If make indicates a command is not found available, install it. I had to install PHP using the following:
$ sudo apt install php
Next, we'll write a systemd service file for the userland keyboard driver we just compiled...
$ sudo nano /etc/systemd/system/ppkb-i2c-inputd.service
Enter the following into Nano... (note that the ExecStart line must reference the ppkb-i2c-inputd which we compiled. If you put it somewhere else, you'll need to modify that line.)
[Unit]
Description=Pinephone Keyboard Service Daemon
[Service]
Type=simple
ExecStart=/home/mobian/pinephone-keyboard/build/ppkb-i2c-inputd
[Install]
WantedBy=multi-user.target
(to save changes and close Nano, type CTRL-X, Y, and Enter)
Now we will blacklist kb151 so it won't be loaded by the kernel next time we boot...
$ sudo nano /etc/modprobe.d/blacklist.conf
Add this single line to the file...
blacklist kb151
(to save changes and close Nano, type CTRL-X, Y, and Enter)
The new blacklist.conf file won't make any difference until you update the ram filesystem with this command, which will take a couple minutes to complete:
$ sudo update-initramfs -u
Now we'll enable the new systemd service...
$ sudo systemctl enable ppkb-i2c-inputd.service
you'll be prompted for your pw a couple times. Once this process completes, reboot.
You're done.
Use the Pine key (pinecone symbol) with number keys to enter FN keys. Try it out by typing CTRL-ALT-PINE-2 to switch to tty2 and then CTRL-ALT-PINE-7 to switch back to tty7 where the GUI is (maybe mobian uses tty1 for login??).
Now I just need to rotate the tty2-tty6 screens and increase the font size... Let me know if you already know how to do that.