vial-kb / vial-qmk

QMK fork with Vial-specific features.
https://get.vial.today/
GNU General Public License v2.0
822 stars 2.37k forks source link

KeyError 'layouts' #726

Closed coshmeo closed 5 months ago

coshmeo commented 5 months ago

I am on macOS 14.4.1 with a boardsource equals 48, i've got my firmware compiled and loaded onto the board, which works fine, but i am not able to interact with it using Vial. When i connect they keyboard to vial, i get the following error message:

File "main_window.py", line 279, in on_devices_updated
  File "main_window.py", line 283, in on_device_selected
  File "autorefresh/autorefresh.py", line 79, in select_device
  File "vial_device.py", line 51, in open
  File "protocol/keyboard_comm.py", line 79, in reload
  File "protocol/keyboard_comm.py", line 153, in reload_layout

KeyError: 'layouts'

My end goal is to be able to program the LEDs with Vial in hopes that i don't have to code it all by hand. Any help is appreciated, thank you!

coshmeo commented 5 months ago

my vial.json looks like this:

{
  "version": 1,
  "notes": "",
  "documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
  "keyboard": "boardsource/equals/48",
  "keymap": "coshmeoside",
  "layout": "LAYOUT_ortho_4x12",
  "layers": **removed keymap to make this comment shorter**
  "author": ""
}
coshmeo commented 5 months ago

nvm, figured it out.

GibbyWoyto commented 4 months ago

Hi, I got the same issue and cant figure it out. yan you tell me what you did to solve it?

Thank You

coshmeo commented 4 months ago

@GibbyWoyto i followed vial's instructions here: https://get.vial.today/docs/porting-to-via.html but basically the error message just means that layouts in vial.json is malformed.

vial.json should look something like this (for an equals48):

{
    "lighting": "vialrgb",
    "matrix": {
        "rows": 4,
        "cols": 12
    },
    "layouts": {
        "keymap":[["0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11"],
        ["1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11"],
        ["2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11"],
        ["3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11"]]
    }
}

here is the vial folder i'm currently using - i still haven't figured out how to get per-key rgb working, but you can at least change the default patterns. feels like i'm pretty close to getting it, but haven't had time/motivation to work on it the last couple weeks. will probably get around to it eventually. vial.zip