ahlfors / beepy

Personal build files and docs for https://beepy.sqfmi.com/docs/getting-started

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Give your Beepy a fresh start!

The "official" steps will load an earlier version of the drivers and firmware, but instead you can take the steps I'm sharing here to install Ardangelo aka Excel's drivers and firmware using 1) their install process or 2) my custom script.

This started as a personal log of what build files worked and documentation for the Beepy

But then developed into little more than a "guide for dummies" version of the Ardangelo method


Software Setup

Use the Raspberry Pi Imager tool to flash an SD card with the latest Raspberry Pi OS image

Choose the Raspberry Pi OS Lite (32-bit) image Click the gear icon ⚙ to also setup WiFi and enable SSH SSH into the Pi and update the kernel and reboot

sudo apt-get update && sudo apt-get install raspberrypi-kernel
sudo shutdown -r now

Removing/cleaning old source builds of drivers

If you already ran the "official" process and installed those drivers, and you don't want to start over with a fresh SD flash of the system, you can perform the following steps to remove the old drivers first before you proceed with installing the Ardangelo drivers.

If you have not installed previous versions of the drivers from source, disregard this section.

Driver packages in the Driver install options further down this page will detect if one of these old modules is installed and cancel installation of the package.

The `bbqX0kbd` driver has been renamed to `beepy-kbd`, and `sharp` to `sharp-drm` - with a note from the developer:

"I renamed `bbqX0kbd` to `beepy-kbd` because: 1) the driver is heavily customized for Beepy and 2) The Debian DKMS system does not allow capital X in driver package names. I renamed `sharp` to `sharp-drm` because it diverged heavily from the original `sharp` driver, I rewrote it entirely to use the Linux DRM system. And as a side effect, this allows the driver packages to check for any previous source installs of the drivers. There are a lot of people here with drivers built from source and having the old versions lying around can eventually be an issue for the firmware and software updates."
  1. Remove the following files:
/lib/modules/<uname>/extra/bbqX0kbd.ko*
/lib/modules/<uname>/extra/sharp.ko*
/boot/overlays/i2c-bbqX0kbd.dtbo
/boot/overlays/sharp.dtbo
  1. Rebuild the module list:
depmod -a
  1. Remove the following lines from /boot/config.txt:
dtoverlay=bbqX0kbd,irq_pin=4
dtoverlay=sharp
  1. Remove the following lines from /etc/modules:
bbqX0kbd
sharp

Now you can either compile the firmware yourself or download from this repository

Steps to compile new firmware from git:

(via SSH to beepy or another Raspberry Pi)
sudo apt-get install binutils-arm-none-eabi cmake gcc-arm-none-eabi
sudo apt-get install git
git clone https://github.com/ardangelo/beepberry-rp2040
cd beepberry-rp2040
git submodule update --init
cd 3rdparty/pico-sdk
git submodule update --init
cd ../../
mkdir build
cd build
cmake -DPICO_BOARD=beepberry -DCMAKE_BUILD_TYPE=Debug ..
make

Resulting firmware file will be located: ~/beepberry-rp2040/build/app/i2c_puppet.uf2

(or you can download my ic2_puppet.uf2 file from this repository)


Firmware Update

To update the Beepy's firmware:

Slide the power switch off (left if facing up) Connect the Beepy to your computer via USB-C While holding the "End Call" key (top right on the keypad), slide the power switch on The Beepy will present itself as a USB mass storage device, drag'n'drop the new firmware (*.uf2) into the drive and it will reboot with the new firmware.


Driver Install, preferred method

(From https://ardangelo.github.io/beepy-ppa/)

After reboot, SSH into the Pi again and run these commands to add the Ardangelo repository to APT and install the drivers:

curl -s --compressed "https://ardangelo.github.io/beepy-ppa/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/beepy.gpg >/dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/beepy.list "https://ardangelo.github.io/beepy-ppa/beepy.list"
sudo apt update
sudo apt-get -y install beepy-kbd sharp-drm

You should now see beepberry-keyboard-driver and sharp-drm-driver when you type ls

The keyboard and firmware driver package will run a preinstall check to ensure that the Beepy firmware is compatible with the driver.

If the installed firmware is detected as incompatible, the installation will be canceled.

A link to a compatible firmware release will be output as part of the error message.


Driver Install, backup method

Alternatively, you can try the following process which is a custom version of the official setup script from SQFMI.

After reboot, SSH into the Pi again and run this customized setup script that loads keyboard and display drivers from Ardangelo

curl -s https://raw.githubusercontent.com/wildoracle/beepy/main/setup.sh | bash

You should now see beepberry-keyboard-driver and sharp-drm-driver when you type ls


These remaining steps are to troubleshoot and fix common problems

Steps to copy keymap to shared location:

sudo -i
cd /home/<USERNAME>/beepberry-keyboard-driver

Copy keymap to shared location

mkdir -p /usr/share/keymaps/
cp ./beepy-kbd.map /usr/share/keymaps/
chmod 644 /usr/share/keymaps/beepy-kbd.map

Copy init.d file

cp ./init/S01beepykbd /etc/init.d/S01beepykbd
chmod 755 /etc/init.d/S01beepykbd

Update init.d file with header info so we can load it on boot

sed -i '2 i\### BEGIN INIT INFO\
# Provides:          S01beepykbd\
# Required-Start:    $all\
# Required-Stop:\
# Default-Start:     2 3 4 5\
# Default-Stop:\
# Short-Description: Loads Beepy Keymap...\
### END INIT INFO' /etc/init.d/S01beepykbd

Loads the new service file

systemctl daemon-reload

Start it - you can test it working now

systemctl start S01beepykbd

Enable so it loads on boot

systemctl enable S01beepykbd

Reload keymap

To reload the keymap: I'll assume you've followed the guide and installed it to

/usr/share/keymaps/beepy-kbd.map

if that is the case try this

sudo loadkeys /usr/share/keymaps/beepy-kbd.map

this will manually load the keymap, fixing your alt and sym keys

After you update keyboard map, make sure you run

rm -f /etc/console-setup/cached_setup_keyboard.sh
dpkg-reconfigure keyboard-configuration

before rebooting so that it’s loaded by default


But wait... there's more!

Is your keyboard still not working right? These commands might help...

Reinstall linux headers?

sudo apt-get install linux-headers

Need to see what the keycode is for any key?

Type showkeys then press a key


Previous driver layout reference

 *	               BBQ20KBD PMOD KEYBOARD LAYOUT
 *
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|      |          |BR     ↑TPY-       |           |       |
 *	| Ctrl |   PgDn   |←TPX- BL(HOME)TPX+→|   PgUp    | MENU  |
 *	|      |          |       ↓TPY+       |           |       |
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|                                                         |
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|#     |1    |2   |3   |(   |   )|_   |    -|    +|      @|
 *	|  Q   |  W  | E  | R  | T  |  Y |  U |  I  |  O  |   P   |
 *	|      |     |PgDn|PgUp|   \|UP  |^   |=    |{    |}      |
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|*     |4    |5   |6   |/   |   :|;   |    '|    "|    ESC|
 *	|  A   |  S  | D  | F  | G  |  H |  J |  K  |  L  |  BKSP |
 *	|     ?|     |   [|   ]|LEFT|HOME|RGHT|V+   |V-   |DLT    |
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|      |7    |8   |9   |?   |   !|,   |    .|    `|       |
 *	|LFTALT|  Z  | X  | C  | V  |  B |  N |  M  |  $  | ENTER |
 *	|      |   K+|  K-|   °|   <|DOWN|>   |MENU |Vx   |       |
 *	+------+-----+----+----+----+----+----+-----+-----+-------+
 *	|            |0   |TAB                |     |             |
 *	| LEFT_SHIFT | ~  |       SPACE       |RTALT| RIGHT_SHIFT |
 *	|            |  Kx|                  &|     |             |
 *	+------------+----+-------------------+-----+-------------+
 *

Apps and Tools

Turn the keyboard backlight on while typing!

Install fbterm for a terminal with better font options - but currently working out issues with the way it functions with keyboard and display

Install cmatrix for an appropriate "screensaver"!

Install googler

GOOGLER_VERSION=$(curl -s "https://api.github.com/repos/jarun/googler/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
sudo curl -o /usr/local/bin/googler "https://raw.githubusercontent.com/jarun/googler/v${GOOGLER_VERSION}/googler"
sudo chmod a+x /usr/local/bin/googler

Check the installed version

googler --version

Testing Googler Execute the googler command without any arguments. Googler will prompt you for a search term. Type something and press Enter key. It will print search results. Press CTRL+C to quit Googler.

About

Personal build files and docs for https://beepy.sqfmi.com/docs/getting-started

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%