Skip to content

amalbuquerque/elixir-keeb

Repository files navigation

ElixirKeeb

Elixir keyboard firmware.

Features

This firmware supports:

  • Working like a standard keyboard, ie., a layout with a single layer;
  • Multiple layers (toggled or locked by a key press);
  • Fully programmable macros (run arbitrary code, besides sending keypresses);
  • Record macros on the fly (e.g. record to X and replay X keys);
  • Web dashboard (shows keys currently pressed + log messages).
    • Macros have an identifier, passed to the dashboard through the Representation module;
  • Metrics for matrix scan read latency + GPIO matrix to USB latency;

TODO

  • Special recording macro that stores the keypresses in a stack, useful to obtain input from the user;
  • Redefine layout without having to burn firmware again;
  • Use Gitlab Actions for CI;
  • Tap to send a key press, keep pressed to activate a layer or send a modifier;

Wishlist

  • Activate LEDs;
  • Handles host going to sleep and waking up;
  • Debug mode;
  • Chording (e.g. pressing simultaneously u and i sends a third key press, instead of u or i);

Build steps

At the moment I'm using Erlang 25.0.2 and Elixir 1.13.4. Use them with asdf like this, just before compiling the firmware. Check the .tool-versions file.

This will upload the firmware via SSH (check your keyboard IP on your router):

  1. export MIX_ENV=prod
  2. export MIX_TARGET=rpi0_configfs
  3. export NERVES_NETWORK_PSK=<password>
  4. export NERVES_NETWORK_SSID=<ssid> 4.1. export WEATHER_API_KEY=<weather-api-key>
  5. mix firmware
  6. ./upload.sh <keeb IP> /home/andre/projs/personal/elixir_keeb/_build/rpi0_configfs_prod/nerves/images/elixir_keeb.fw

Debugging

Connect via SSH with ssh <keeb IP>.

You can check the web dashboard on <keeb IP>:4000

If it borked the SSH connection, insert the micro SD card on the PC and burn the firmware to it:

  1. export MIX_ENV=dev
  2. export MIX_TARGET=rpi0_configfs
  3. export NERVES_NETWORK_SSID=<ssid>
  4. export NERVES_NETWORK_PSK=<password>
  5. mix firmware.burn

Targets

Nerves applications produce images for hardware targets based on the MIX_TARGET environment variable. If MIX_TARGET is unset, mix builds an image that runs on the host (e.g., your laptop). This is useful for executing logic tests, running utilities, and debugging. Other targets are represented by a short name like rpi3 that maps to a Nerves system image for that platform. All of this logic is in the generated mix.exs and may be customized. For more information about targets see:

https://hexdocs.pm/nerves/targets.html#content

Getting Started

To start your Nerves app:

  • export MIX_TARGET=my_target or prefix every command with MIX_TARGET=my_target. For example, MIX_TARGET=rpi3
  • Install dependencies with mix deps.get
  • Create firmware with mix firmware
  • Burn to an SD card with mix firmware.burn

Learn more

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages