Oh darn… I’ve had the keyboard for only a few hours and it appears to be “bricked” now. I was changing some key mappings and obviously messed something up while it was flashing.
No response when plugged in normally. Not in lsusb.
When holding prog key and plugging in, the prog key lights up. (good). Still not in lsusb.
In either case I cannot get the firmware restored from the Arduino IDE and the result is the same.
Pasting image because copying the text from Arduino IDE doesn’t seem to work properly (missing lines):
The good news is, bricking your keyboard is hard. Even if you mess something up in your firmware, and the keyboard crashes as soon as it boots, it is still not bricked. (Although lsusb not showing anything is a bit worrying, but lets not despair just yet!)
If all else fails, there’s a hardware reset button under the enclosure of the left half. You can try taking the enclosure off, and pressing that button (if I remember correctly, it should be around the extension headers; it’s hard to miss, but it is a small little button), and try flashing then. You do not need to hold the PROG key in this case.
I would suggest re-flashing the factory firmware to hopefully restore the keyboard to a working state, and go from there.
I believe the difference from what you’re trying would be
load the factory firmware into the IDE
open up the left-half enclosure to get at the reset button
instead of holding the Prog button when you click upload in the IDE, push the reset button
You probably want to email help@keyboard.io, though. I’m admittedly not an expert. Also, Jesse mentioned in the IRC channel that email was the best way to reach him this weekend.
% avrdude -patmega32u4 -cavr109 -D -P /dev/ttyS0 -b57600 -Uflash:w:atmega32u4_firmware.hex:i
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "F"; type = �
Software Version = {.; Hardware Version = H.V
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude done. Thank you.
I tried plugging it into a Windows machine. I couldn’t get Arduino to see any port. When I plugged it in with no Prog press, nothing happened. No detection by the OS. When I plugged it in holding Prog, it detected it (notification said something about Model 01) but then after 2-3 seconds it made the “device unplugged” sound. I couldn’t see any COM port in Arduino IDE (greyed out).
Windows 10, so that shouldn’t be the problem.
Nothing working so far, but thank you all for the suggestions. The keyboard was working great before I started messing around with the layout / flashing, so I’m pretty confident there’s an “easy” fix…
Perhaps your having just flashed it is a red herring (in that the “real” problem just surfaced right after you did such). In the vein of an “easy fix” try:
A different USB cable. There have been reports of one or two bad cables. But when doing so be aware of the issue that some third party cables don’t quite fit right due to the recessing of the USB connection port. A cable with a large “head” may not push all the way in. See this thread for some detail.
BOARD_HARDWARE_PATH="/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0" /home/z/.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-60-g8f58) ...
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c: In function '__vector_36':
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c:446:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
twi_masterBuffer[twi_masterBufferIndex++] = TWDR;
^
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c:447:3: note: here
case TW_MR_SLA_ACK: // address sent, ack received
^~~~
Press ENTER when ready...
stty: 1200: No such file or directory
make: *** [/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/build-tools/makefiles//rules.mk:75: flash] Error 1
sh make.sh 9.54s user 1.30s system 38% cpu 28.147 total
Jesse suggested that even the few seconds I was getting the keyboard recognized over USB would be enough to flash the firmware again with avrdude. It was! I just had to get the correct port.
I have Arduino IDE open while I plug in the keyboard (holding prog key).
Check the ports drop down in Arduino repeatedly to find the port, which only shows for a second.
The port is /dev/ttyACM0
Get this command ready to go in the console: avrdude -patmega32u4 -cavr109 -D -P /dev/ttyACM0 -b57600 -Uflash:w:atmega32u4_firmware.hex:i
Plug in keyboard again (holding prog key) and run command immediately.
Found programmer. Writing flash. Reading flash. Success!