Using Keyboard Case with Arch (DanctNix) (complete instructions)
#10
(02-24-2022, 08:51 PM)Megamemnon Wrote:
I recently installed Megi's userland keyboard driver on the PinePhone running Mobian. What I really wanted to do was get my pinephone and keyboard case running as a mini-computer with a CLI (no GUI). I discovered DanctNIX barebones Arch Linux image and finally got the userland driver running on that also. So this is a complete list of steps required to do so. You can find all of this information in various places, but I'm hoping it's handy to have it all in one location for someone...

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. Install Arch Linux

Arch Linux ARM builds for pinephone (and PPPro and other devices) are located here: https://github.com/dreemurrs-embedded/Pi...h/releases The latest versions include kb151, the i2c keyboard driver needed by the pinephone's keyboard case. I installed the barebones version which merely boots to a tty and the rest of these instructions are specifically for CLI.

I used the Jumpdrive method which is documented here: https://wiki.pine64.org/wiki/PinePhone_I..._JumpDrive

Connect to your local WIFI...
$nmtui

Select Activate Connection, then select your WIFI and enter password. You can use the arrow keys to move around the TUI (FN+> is UP, FN+{ is DOWN, FN+" is LEFT, and FN+} is RIGHT).

Determine your pinephone's IP address...
$ip a

Look for the ip address for the WLAN0 network connection.

For simplicity, SSH into your pinephone from a linux PC (x.x.x.x is the ip address of your pinephone)...

$ssh alarm@x.x.x.x

Update and upgrade with the following:
$ sudo pacman -Syu

Install some stuff you'll need...
$ sudo pacman -S nano terminus-font git gcc php make

3. Rotate the screen and increase font size

Still SSH'ing into your pinephone...
$ cd /boot
$ sudo nano boot.txt

Locate the line starting with setenv bootargs... This is a list of kernel parameters. Append the following to the end of the list (include a single space to separate it from the prior parameter). The fbcon parameter will rotate your screen 90 degrees clockwise putting it in landscape mode and the kb151 parameter will effectively disable kb151 so we can use the userland driver, which we'll install later. (if you're entering all this from the pinephone keyboard case, don't do the kb151 parameter yet, or make sure you finish everything before rebooting).

fbcon=rotate:1 kb151.disable_input

(Megi added a second fbcon parameter to set the font, but I wasn't able to get this to work, so I added it to the system-wide bash script, which we'll get to in a second....)

To save changes and close Nano, type CTRL-X, Y, and Enter.

back on the command line, run the following to update the boot.scr file from boot.txt...

$ sudo ./mkscr

Reference https://xnux.eu/log/#058 regarding disabling kb151; I tried a couple other methods, but only this one worked.

Add a setfont step to the system wide bash login script /etc/bash.bashrc...

$ sudo nano /etc/bash.bashrc

Add the following line at the end of the file to change the tty font to Terminus c32n (or whatever you like)...

setfont ter-c32n

To save changes and close Nano, type CTRL-X, Y, and Enter.

4. Download, build, and install the userland driver

$ git clone https://mff.cz/git/pinephone-keyboard/
$ cd pinephone-keyboard
$ make

Now we write the systemd unit file...

$ sudo nano /etc/systemd/system/ppkb-i2c-inputd.service

Enter the following into this new .service file...

  [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 enable this service the next time we boot with ...

$ sudo systemctl enable ppkb-i2c-inputd.service

Reference https://wiki.mobian-project.org/doku.php...-case-ppkc regarding runningn this userland driver as a systemd service.

5. Reboot and test

You're done.

$ sudo reboot

When the system reboots, it will still load kb151, but that driver will be disabled. The systemd service ppkb-i2c-inputd will be loaded by systemd and be the driver for the new keyboard case.

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-1 to switch back to tty1 which is the default tty.
I made good use of your post, thanks for putting it up. However, two things in
Step 3 didn't work for me:

3. Rotate the screen and increase font size.

  The cmd to update boot.scr...

  X $ sudo ./mkscr (didn't work)

    $ sudo pp-uboot-mkscr (did work)


  The cmd to change the font...

    Editing /etc/bash.basrc

  X $ sudo nano /etc/bash.bashrc (didn't work)

    The FONT variable in /etc/vconsole.conf is used to set the font at boot,
    persistent for all consoles.

      $ sudo nano /etc/vconsole.conf (did work)

        FONT=ter-c32n
        FONT_MAP=8859-2
  Reply


Messages In This Thread
RE: Using Keyboard Case with Arch (DanctNix) (complete instructions) - by ludgate - 05-26-2022, 01:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Case for Pinephone totilele 13 7,245 04-11-2024, 11:48 AM
Last Post: gramonyl
  Slip/Zippered Case for PP/KB? jakfish 0 281 03-03-2024, 04:55 PM
Last Post: jakfish
  keyboard case charging but not typing new2pinephone 18 5,781 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 8,537 01-14-2024, 03:34 PM
Last Post: acid andy
  I've added an I2C connector to the PP keyboard eugenr 0 424 11-26-2023, 07:24 AM
Last Post: eugenr
  Update the PinePhone keyboard driver to support missing characters? Peter Gamma 8 8,170 10-22-2023, 08:43 PM
Last Post: Peter Gamma
  key repeat with pinephone keyboard rotwang 0 451 10-22-2023, 03:39 PM
Last Post: rotwang
Exclamation USB mouse isn't working when a PP keyboard is attached? mikeb 3 1,232 10-21-2023, 08:21 PM
Last Post: Peter Gamma
  Pinephone with mini keyboard, trackpad and large power bank? Peter Gamma 0 515 10-21-2023, 07:50 AM
Last Post: Peter Gamma
  Which mini keyboard and mouse to choose for the PP? Peter Gamma 0 615 10-21-2023, 02:55 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)