Using Keyboard Case with Mobian (complete instructions)
#1

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.
  Reply
#2
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).

    fbcon=rotate:1

+ 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
  add...

    CODESET="Lat7"
    FONTFACE="Terminus"
    FONTSIZE="16x32"
  Reply
#3
Information 
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
  Reply
#4
(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.
  Reply
#5
(02-12-2023, 06:43 PM)wigan Wrote:
(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.

Same.  I'd love the auto-detection of the keyboard and scaling etc.  But the symbols work now at least, with the non-systemd fix.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Searching for a PinePhone Keyboard Case RubiksCube 1 630 10-07-2024, 11:08 PM
Last Post: tllim
  Troubleshooting Pinedio LoRa Add-on Case nickp 2 652 09-29-2024, 09:17 PM
Last Post: lavabrilliant
  Getting started with fingerprint scanner case lolgzs 1 1,369 09-08-2024, 04:21 AM
Last Post: mfashby
  So which keyboard you suggest for the Pinephone? Peter Gamma 21 4,694 07-19-2024, 08:05 AM
Last Post: Peter Gamma
  Rii mini 4 keyboard and touchpad work over Bluetooth Peter Gamma 0 393 07-19-2024, 08:02 AM
Last Post: Peter Gamma
  Bring the Pinephone keyboard back, it is worth it! Peter Gamma 1 770 07-04-2024, 07:32 AM
Last Post: Kevin Kofler
Heart The Pinephone keyboard offers alternative layouts Peter Gamma 0 290 07-04-2024, 05:40 AM
Last Post: Peter Gamma
  Keyboard & 2.4G usb dongle for the Pinephone? Peter Gamma 2 913 06-29-2024, 09:36 PM
Last Post: Peter Gamma
  Bluetooth keyboard with trackpad Zebulon Walton 11 11,261 06-29-2024, 04:09 AM
Last Post: Peter Gamma
  Was someone able to use the Pinephone keyboard & an usb mouse at the same? Peter Gamma 4 2,386 06-26-2024, 07:11 AM
Last Post: dachalife

Forum Jump:


Users browsing this thread: 1 Guest(s)