Stale environment

I am trying to flash my keyboard with @andrewg’s branch, to get my danish characters working with a new approach, since the macro seems to be a dead end.

But it seems like my environment is stale somehow. I get this error:

luke:abg lasse$ make flash
BOARD_HARDWARE_PATH="/Users/lasse/Library/Arduino15/packages/keyboardio/hardware/avr/1.19.0" /Users/lasse/Library/Arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.13-154-g3bc3) …
/Users/lasse/Documents/Arduino/abg/Model01-Firmware.ino:29:33: fatal error: Kaleidoscope-NumPad.h: No such file or directory
#include “Kaleidoscope-NumPad.h”
^
compilation terminated.
exit status 1
make: *** [flash] Error 1

And I already updated my hardware/libs (and I also tried deleting them and recloning them from github:

luke:avr lasse$ make update-submodules
git pull
Already up-to-date.
git submodule update --init --recursive
All Kaleidoscope libraries have been updated from GitHub

luke:avr lasse$ ls libraries/Kaleidoscope-NumPad/
COPYING	Makefile	README.md	library.properties	src

Why is the build looking inside /Users/lasse/Library/Arduino15/packages/keyboardio/hardware/avr ? I would expect it to search ~/Documents/Arduino/keyboardio/hardware/avr

That bit’s easy - there’s a section in the Model01-Firmware/Makefile that checks first for $(PACKAGE_DIR)/packages/keyboardio/hardware/avr and only if it doesn’t contain what it needs does it fall back to $(SKETCHBOOK_DIR)/hardware

Ok, but according to the docs on github: https://github.com/keyboardio/Model01-Firmware

The path should be ~/Documents/Arduino/hardware/keyboardio/avr
and not /packages/keyboardio/hardware/avr

I am not good at parsing makefiles, but I am sure I havn’t changed anything.
But I may have an old copy of the libs in /Users/lasse/Library/Arduino15/packages/keyboardio/hardware/avr – I had trouble at first and may have done made hacks to work around those problems.

It works after making this change. But it just seems wrong that it doesn’t work for me out of the box?

lasse@luke ~/D/A/Model01-Firmware> git diff
diff --git a/Makefile b/Makefile
index 585ccba..3716495 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ UNAME_S := $(shell uname -s)

 ifeq ($(UNAME_S),Darwin)
 SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
-PACKAGE_DIR ?= $(HOME)/Library/Arduino15
+PACKAGE_DIR ?= $(HOME)/Documents/Arduino/hardware/libraries
 else
 SKETCHBOOK_DIR ?= $(HOME)/Arduino
 PACKAGE_DIR ?= $(HOME)/.arduino15

There are two different places you might have installed our support infrastructure. Either in Documents/Arduino/hardware/ if you used git or in Library/Arduino15/ if you used the Arduino boards manager.

If you have both installed, Arduino prefers the version installed through the boards manager. If you want to use the version you installed with git, you should uninstall the Keyboardio package through the Arduino Boards Manager.

I do have both installed, but I only use the prompt.

To me it looks like the Makefile controls where to look.
And the Makefile defaults to Library/Arduino15

Why else would changing the makefile fix the problem?

It doesn’t matter whether you use the gui or the command line. We still prefer the version installed by the boards manager.

(Whether this is the right choice is another matter)

1 Like

I don’t have an opinion on which one you use. But I tried to follow the documentation.
Would you say that is accurate?

After that, you’ll want to update the Kaleidoscope libraries.

MacOS

cd $HOME/Documents/Arduino/hardware/keyboardio/avr
make update-submodules

The problem is that two different sets of instructions stepped you through installing the Kaleidoscope libraries twice.

https://github.com/keyboardio/Kaleidoscope/wiki/Setting-up-a-development-environment#mac-os-x has some notes on removing the boards-manager version of the libraries.