I have built two Mysterium keyboards from kits by 42Keebs. Building the keyboards was fun and I use them in the office and at home nearly every day. The only thing that bugged me was that the firmware I downloaded from the 42Keebs website did not display anything on the (optional) OLED of the keyboard.
I assumed that either nobody bothered or got around to utilizing the display yet or that the firmware was compiled without OLED support being configured.
Since I used the Vial version of the firmware, I cloned https://github.com/vial-kb/vial-qmk.
git clone git@github.com:vial-kb/vial-qmk.git
I use Debian and I had problems with QMK installed via pip. Using the QMK version provided via the Debian software repository worked much better for me.
sudo apt install qmk
QMK needs to be initialized before it can be used:
cd vial-qmk
qmk setup
The changed to the directory which contains the code for the Mysterium keyboard is located in:
cd keyboards/42keebs/mysterium/
The directory contains sub-directories with names which hint at revision 1.5c and 1.5d. My keyboards are revision 1.5e, but since there was no directory for this revision, I changed checked the configuration in v15d:
cat v15d/rules.mk
To my surprise, OLED_ENABLE was set to "yes" already, but after I compiled and flashed the firmware, the OLED of my keyboard still did not display anything. Luckily I already had some experience in tinkering with QMK and I knew where to check.
cat v15d/v15d.c
I was surprised that the file contained code to turn the content of the OLED by 180 degree, but it did not contain the method which is required to display anything. I changed the file to:
/* Copyright 2019 coseyfannitutti
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "v15d.h"
#ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}
bool oled_task_user(void) {
oled_write_ln_P(PSTR(" Mysterium TKL "), true);
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(PSTR("Caps Lock: "), false);
oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false);
oled_write_P(PSTR("Scroll Lock: "), false);
oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false);
return false;
}
#endif
I tried to compile the firmware:
qmk compile -kb 42keebs/mysterium/v15d -km vial
Unfortunately, QMK informed me that the firmware image was too large and I did not find anything I could strip away. I guess this is the reason why the code for displaying anything in the OLED display is not contained in the repository.
Luckily this was not the end of the story. Vial is cool, but to be honest, I use a pretty standard configuration of my keyboard (ISO, German keys) and I can live without Vial support in the firmware.
That's why I tried compiling the firmware with:
qmk compile -kb 42keebs/mysterium/v15d -km default
The firmware image is located in the .build folder in the top directory of the cloned repository. After I flashed the firmware, the OLED is finally working and it even displays some useful information.
If you don't want to compile the firmware yourself, you can download my version (right-click and save as): 42keebs_mysterium_v15d_default.hex
update: If you have an ISO keyboard, please also read Creating a firmware for the Mysterium keyboard with OLED support (REVISITED)