Using Keyboard Case with Mobian (complete instructions)

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 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: 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.

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

$ 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.)

  Description=Pinephone Keyboard Service Daemon



(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.
NOTE: This works for Mobian (and other Tow-boot installs by extension).

+ Rotate the screen:
  Tow-boot parses an installed u-boot configuration file at
  '/boot/extlinux/extlinux.conf' containing boot settings. Add this at the end
  of the line beginning w/ 'append' (w/ a space seperating last entry).


+ Increase console font size:
  This needs to be in '/etc/default/console-setup'.  Running '>sudo
  dpkg-reconfigure console-setup' from a console might write it to
  'console-setup' for you. If not, edit '/etc/default/console-setup' and

Just wanted to add that the instructions on the mobian wiki for the keyboard worked for me (though they may not help you) and were much less hassle. (be sure to do the last step! or it will not work.)
Mobian wiki Pinephone keyboard
(12-26-2022, 03:41 PM)Jeremiah Roise Wrote: Just wanted to add that the instructions on the mobian wiki for the keyboard worked for me (though they may not help you) and were much less hassle. (be sure to do the last step! or it will not work.)
Mobian wiki Pinephone keyboard

I tried the first part of that (Automatic Settings) w/o success, but the part at the bottom  under(Symbol Keys) worked by adding XKB_DEFAULT_MODEL=ppkb' to ~/.profile to activate the top row symbols.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why do mouse, keyboard and HDMI did not work with any usb-c adapter on the Pinephone? Peter Gamma 2 29 4 hours ago
Last Post: fxc
  fully functional keyboard with Debian/Mobian wigan 1 336 02-12-2023, 06:50 PM
Last Post: wigan
  experience: pinephone keyboard drains pp battery faster? tuxcall 2 237 02-11-2023, 11:52 PM
Last Post: RTP
  pinephone keyboard case how to use the = f8 - etc tuxcall 0 181 02-05-2023, 11:15 AM
Last Post: tuxcall
  keyboard case charging but not typing new2pinephone 12 1,148 02-01-2023, 05:32 AM
Last Post: theResonant
  How to disassemble a Pinephone Keyboard? apricot 2 385 01-09-2023, 10:02 PM
Last Post: apricot
  KB: Using bus powered USB peripherals with the pinephone keyboard mounted docsunset 6 1,730 01-09-2023, 03:08 AM
Last Post: theResonant
  Convert Pinephone Keyboard into Powerbank magdesign 5 1,895 01-09-2023, 03:02 AM
Last Post: theResonant
  Pine phone keyboard ? bcnaz 66 28,247 12-27-2022, 05:13 AM
Last Post: hlaube
  PinePhone Keyboard issue GoldenArches 0 237 12-26-2022, 02:08 PM
Last Post: GoldenArches

Forum Jump:

Users browsing this thread: 1 Guest(s)