Elixir keyboard firmware.
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
andreplay X
keys); - Web dashboard (shows keys currently pressed + log messages).
- Macros have an identifier, passed to the dashboard through the
Representation
module;
- Macros have an identifier, passed to the dashboard through the
- Metrics for matrix scan read latency + GPIO matrix to USB latency;
- 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;
- Activate LEDs;
- Handles host going to sleep and waking up;
- Debug mode;
- Chording (e.g. pressing simultaneously
u
andi
sends a third key press, instead ofu
ori
);
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):
export MIX_ENV=prod
export MIX_TARGET=rpi0_configfs
export NERVES_NETWORK_PSK=<password>
export NERVES_NETWORK_SSID=<ssid>
4.1.export WEATHER_API_KEY=<weather-api-key>
mix firmware
./upload.sh <keeb IP> /home/andre/projs/personal/elixir_keeb/_build/rpi0_configfs_prod/nerves/images/elixir_keeb.fw
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:
export MIX_ENV=dev
export MIX_TARGET=rpi0_configfs
export NERVES_NETWORK_SSID=<ssid>
export NERVES_NETWORK_PSK=<password>
mix firmware.burn
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
To start your Nerves app:
export MIX_TARGET=my_target
or prefix every command withMIX_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
- Official docs: https://hexdocs.pm/nerves/getting-started.html
- Official website: https://nerves-project.org/
- Forum: https://elixirforum.com/c/nerves-forum
- Discussion Slack elixir-lang #nerves (Invite)
- Source: https://github.com/nerves-project/nerves