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
  Was someone able to use the Pinephone keyboard & an usb mouse at the same? Peter Gamma 3 138 10 hours ago
Last Post: Peter Gamma
Exclamation USB mouse isn't working when a PP keyboard is attached? mikeb 5 1,554 06-18-2024, 08:56 PM
Last Post: Peter Gamma
  Troubleshooting Pinedio LoRa Add-on Case nickp 1 125 06-17-2024, 10:15 PM
Last Post: tllim
  Case for Pinephone totilele 13 8,591 04-11-2024, 11:48 AM
Last Post: gramonyl
  Slip/Zippered Case for PP/KB? jakfish 0 372 03-03-2024, 04:55 PM
Last Post: jakfish
  keyboard case charging but not typing new2pinephone 18 6,645 02-19-2024, 07:30 AM
Last Post: theResonant
  Keyboard doesn't charge my phone no matter what, so can I charge my phone directly ragreenburg 3 14,249 01-14-2024, 03:34 PM
Last Post: acid andy
  I've added an I2C connector to the PP keyboard eugenr 0 531 11-26-2023, 07:24 AM
Last Post: eugenr
  Update the PinePhone keyboard driver to support missing characters? Peter Gamma 8 8,716 10-22-2023, 08:43 PM
Last Post: Peter Gamma
  key repeat with pinephone keyboard rotwang 0 549 10-22-2023, 03:39 PM
Last Post: rotwang

Forum Jump:


Users browsing this thread: 1 Guest(s)