adamws / kicad-kbplacer

KiCad plugin for automatic keyboard's key placement and routing
GNU General Public License v3.0
333 stars 23 forks source link

Stuck with commandline use #32

Closed tbaumann closed 3 months ago

tbaumann commented 3 months ago

Describe the bug

The KiCad plugin crashes and leaves me without a lot of usable information about what happened. So I thought I try the CLI version.

I didn't want to build my Matrix by hand so I annotated my KLE with the column and row positions and used tools/layout2schematic.py to generate the schematic.

[nix-shell:~/git/kicad-kbplacer]$ python3 -m kbplacer --board ~/Documents/KiCad/typematrix\ monolyth/typematrix\ monolyth.kicad_pcb -l ~/Downloads/typematrix-2020-lookalike-with-small-enters\(2\).json --build-board-outline --key-distance "17 18" --log-level DEBUG 
15:25:32: Set key 1U distance: 17000000/18000000
15:25:32: Switches by nets: defaultdict(<class 'list'>, {frozenset({'ROW4', 'COL8'}): ['SW69'], frozenset({'ROW6', 'COL11'}): ['SW89'], frozenset({'ROW6', 'COL14'}): ['SW92'], frozenset({'ROW6', 'COL2'}): ['SW88'], frozenset({'ROW0', 'COL5'}): ['SW6'], frozenset({'COL14', 'ROW3'}): ['SW60'], frozenset({'COL12', 'ROW4'}): ['SW73'], frozenset({'COL5', 'ROW2'}): ['SW36'], frozenset({'COL2', 'ROW2'}): ['SW33'], frozenset({'COL14', 'ROW5'}): ['SW85'], frozenset({'COL13', 'ROW2'}): ['SW44'], frozenset({'COL11', 'ROW4'}): ['SW72'], frozenset({'COL7', 'ROW0'}): ['SW8'], frozenset({'COL9', 'ROW3'}): ['SW55'], frozenset({'COL12', 'ROW5'}): ['SW83'], frozenset({'COL14', 'ROW4'}): ['SW75'], frozenset({'ROW0', 'COL1'}): ['SW2'], frozenset({'COL11', 'ROW0'}): ['SW12'], frozenset({'COL12', 'ROW2'}): ['SW43'], frozenset({'COL4', 'ROW3'}): ['SW50'], frozenset({'COL1', 'ROW3'}): ['SW47'], frozenset({'COL1', 'ROW2'}): ['SW32'], frozenset({'ROW0', 'COL6'}): ['SW7'], frozenset({'COL12', 'ROW1'}): ['SW28'], frozenset({'COL3', 'ROW2'}): ['SW34'], frozenset({'COL4', 'ROW0'}): ['SW5'], frozenset({'COL9', 'ROW5'}): ['SW80'], frozenset({'ROW6', 'COL1'}): ['SW87'], frozenset({'COL10', 'ROW1'}): ['SW26'], frozenset({'COL2', 'ROW4'}): ['SW63'], frozenset({'COL0', 'ROW3'}): ['SW46'], frozenset({'ROW6', 'COL13'}): ['SW91'], frozenset({'ROW4', 'COL13'}): ['SW74'], frozenset({'COL13', 'ROW3'}): ['SW59'], frozenset({'ROW0', 'COL8'}): ['SW9'], frozenset({'COL1', 'ROW1'}): ['SW17'], frozenset({'COL11', 'ROW3'}): ['SW57'], frozenset({'COL9', 'ROW0'}): ['SW10'], frozenset({'COL7', 'ROW1'}): ['SW23'], frozenset({'COL14', 'ROW1'}): ['SW30'], frozenset({'COL11', 'ROW1'}): ['SW27'], frozenset({'COL0', 'ROW4'}): ['SW61'], frozenset({'COL0', 'ROW0'}): ['SW1'], frozenset({'COL4', 'ROW2'}): ['SW35'], frozenset({'COL0', 'ROW1'}): ['SW16'], frozenset({'ROW1', 'COL6'}): ['SW22'], frozenset({'ROW1', 'COL5'}): ['SW21'], frozenset({'COL7', 'ROW2'}): ['SW38'], frozenset({'COL9', 'ROW4'}): ['SW70'], frozenset({'COL10', 'ROW0'}): ['SW11'], frozenset({'COL11', 'ROW2'}): ['SW42'], frozenset({'ROW2', 'COL6'}): ['SW37'], frozenset({'COL3', 'ROW3'}): ['SW49'], frozenset({'COL9', 'ROW2'}): ['SW40'], frozenset({'COL13', 'ROW5'}): ['SW84'], frozenset({'COL14', 'ROW0'}): ['SW15'], frozenset({'COL12', 'ROW0'}): ['SW13'], frozenset({'COL0', 'ROW2'}): ['SW31'], frozenset({'ROW3', 'COL8'}): ['SW54'], frozenset({'ROW1', 'COL8'}): ['SW24'], frozenset({'COL11', 'ROW5'}): ['SW82'], frozenset({'COL2', 'ROW5'}): ['SW78'], frozenset({'ROW3', 'COL5'}): ['SW51'], frozenset({'COL2', 'ROW0'}): ['SW3'], frozenset({'COL10', 'ROW3'}): ['SW56'], frozenset({'COL3', 'ROW4'}): ['SW64'], frozenset({'COL10', 'ROW4'}): ['SW71'], frozenset({'ROW0', 'COL13'}): ['SW14'], frozenset({'COL7', 'ROW4'}): ['SW68'], frozenset({'COL4', 'ROW1'}): ['SW20'], frozenset({'COL0', 'ROW6'}): ['SW86'], frozenset({'COL3', 'ROW1'}): ['SW19'], frozenset({'ROW6', 'COL12'}): ['SW90'], frozenset({'COL2', 'ROW1'}): ['SW18'], frozenset({'COL2', 'ROW3'}): ['SW48'], frozenset({'ROW4', 'COL6'}): ['SW67'], frozenset({'COL12', 'ROW3'}): ['SW58'], frozenset({'COL0', 'ROW5'}): ['SW76'], frozenset({'COL4', 'ROW4'}): ['SW65'], frozenset({'COL3', 'ROW5'}): ['SW79'], frozenset({'ROW4', 'COL1'}): ['SW62'], frozenset({'COL1', 'ROW5'}): ['SW77'], frozenset({'ROW4', 'COL5'}): ['SW66'], frozenset({'COL14', 'ROW2'}): ['SW45'], frozenset({'ROW1', 'COL13'}): ['SW29'], frozenset({'COL10', 'ROW5'}): ['SW81'], frozenset({'COL7', 'ROW3'}): ['SW53'], frozenset({'COL10', 'ROW2'}): ['SW41'], frozenset({'ROW3', 'COL6'}): ['SW52'], frozenset({'COL8', 'ROW2'}): ['SW39'], frozenset({'COL3', 'ROW0'}): ['SW4'], frozenset({'COL9', 'ROW1'}): ['SW25']})
15:25:32: Diodes by switch: {'SW79': ['D79'], 'SW55': ['D55'], 'SW62': ['D62'], 'SW87': ['D87'], 'SW71': ['D71'], 'SW18': ['D18'], 'SW45': ['D45'], 'SW67': ['D67'], 'SW78': ['D78'], 'SW6': ['D6'], 'SW43': ['D43'], 'SW73': ['D73'], 'SW9': ['D9'], 'SW2': ['D2'], 'SW33': ['D33'], 'SW49': ['D49'], 'SW80': ['D80'], 'SW26': ['D26'], 'SW88': ['D88'], 'SW12': ['D12'], 'SW38': ['D38'], 'SW23': ['D23'], 'SW28': ['D28'], 'SW72': ['D72'], 'SW85': ['D85'], 'SW13': ['D13'], 'SW56': ['D56'], 'SW52': ['D52'], 'SW22': ['D22'], 'SW81': ['D81'], 'SW58': ['D58'], 'SW91': ['D91'], 'SW61': ['D61'], 'SW69': ['D69'], 'SW30': ['D30'], 'SW40': ['D40'], 'SW63': ['D63'], 'SW75': ['D75'], 'SW19': ['D19'], 'SW34': ['D34'], 'SW53': ['D53'], 'SW39': ['D39'], 'SW50': ['D50'], 'SW5': ['D5'], 'SW57': ['D57'], 'SW86': ['D86'], 'SW92': ['D92'], 'SW42': ['D42'], 'SW83': ['D83'], 'SW24': ['D24'], 'SW68': ['D68'], 'SW21': ['D21'], 'SW60': ['D60'], 'SW64': ['D64'], 'SW54': ['D54'], 'SW17': ['D17'], 'SW70': ['D70'], 'SW16': ['D16'], 'SW77': ['D77'], 'SW20': ['D20'], 'SW90': ['D90'], 'SW44': ['D44'], 'SW76': ['D76'], 'SW65': ['D65'], 'SW15': ['D15'], 'SW27': ['D27'], 'SW36': ['D36'], 'SW1': ['D1'], 'SW37': ['D37'], 'SW66': ['D66'], 'SW59': ['D59'], 'SW35': ['D35'], 'SW84': ['D84'], 'SW31': ['D31'], 'SW89': ['D89'], 'SW4': ['D4'], 'SW46': ['D46'], 'SW3': ['D3'], 'SW74': ['D74'], 'SW29': ['D29'], 'SW10': ['D10'], 'SW25': ['D25'], 'SW48': ['D48'], 'SW51': ['D51'], 'SW8': ['D8'], 'SW82': ['D82'], 'SW14': ['D14'], 'SW47': ['D47'], 'SW32': ['D32'], 'SW11': ['D11'], 'SW41': ['D41'], 'SW7': ['D7']}
15:25:32: User layout: [{'name': 'TypeMatrix 2020 lookalike with small enters', 'author': 'Tilman Baumann', 'background': {'name': 'PBT Black', 'style': "background-image: url('/bg/plastic/pbt-black.png');"}, 'plate': True, 'pcb': True}, [{'w': 1.5}, 'R0,C0', 'R0,C1', 'R0,C2', 'R0,C3', 'R0,C4', 'R0,C5', {'w': 1.5}, 'R0,C6', {'x': 2, 'w': 1.5}, 'R0,C7', 'R0,C8', 'R0,C9', 'R0,C10', 'R0,C11', 'R0,C12', 'R0,C13', {'w': 1.5}, 'R0,C14'], [{'w': 1.5}, 'R1,C0', 'R1,C1', 'R1,C2', 'R1,C3', 'R1,C4', 'R1,C5', {'w': 1.5}, 'R1,C6', {'x': 2, 'w': 1.5}, 'R1,C7', 'R1,C8', 'R1,C9', 'R1,C10', 'R1,C11', 'R1,C12', 'R1,C13', {'w': 1.5}, 'R1,C14'], [{'w': 1.5}, 'R2,C0', 'R2,C1', 'R2,C2', 'R2,C3', 'R2,C4', 'R2,C5', {'w': 1.5}, 'R2,C6', {'x': 2, 'w': 1.5}, 'R2,C7', 'R2,C8', 'R2,C9', 'R2,C10', 'R2,C11', 'R2,C12', 'R2,C13', {'w': 1.5}, 'R2,C14'], [{'w': 1.5}, 'R3,C0', 'R3,C1', 'R3,C2', 'R3,C3', 'R3,C4', 'R3,C5', {'w': 1.5}, 'R3,C6', {'x': 2, 'w': 1.5}, 'R3,C7', 'R3,C8', 'R3,C9', 'R3,C10', 'R3,C11', 'R3,C12', 'R3,C13', {'w': 1.5}, 'R3,C14'], [{'w': 1.5}, 'R4,C0', 'R4,C1', 'R4,C2', 'R4,C3', 'R4,C4', 'R4,C5', {'w': 1.5}, 'R4,C6', {'x': 2, 'w': 1.5}, 'R4,C7', 'R4,C8', 'R4,C9', 'R4,C10', 'R4,C11', 'R4,C12', 'R4,C13', {'w': 1.5}, 'R4,C14'], [{'w': 1.5}, 'R5,C0', {'w': 1.5}, 'R5,C1', {'w': 1.5}, 'R5,C2', {'w': 3.5}, 'R5,C3', {'x': 2, 'w': 3.5}, 'R5,C9', 'R5,C10', 'R5,C11', 'R5,C12', 'R5,C13', {'w': 1.5}, 'R5,C14'], [{'w': 1.5}, 'R6,C0', {'w': 1.5}, 'R6,C1', {'w': 1.5}, 'R6,C2', {'x': 10}, 'R6,C11', 'R6,C12', 'R6,C13', {'w': 1.5}, 'R6,C14']]
15:25:32: Detected layout convertible to matrix annotated keyboard
15:25:32: Got [] for ('R0', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C4') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C5') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C6') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C7') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C8') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R0', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C4') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C5') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C6') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C7') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C8') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R1', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C4') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C5') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C6') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C7') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C8') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R2', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C4') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C5') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C6') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C7') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C8') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R3', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C4') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C5') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C6') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C7') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C8') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R4', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C3') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C9') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C10') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R5', 'C14') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C0') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C1') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C2') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C11') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C12') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C13') position
15:25:32: Could not find alternative layout footprint
15:25:32: Got [] for ('R6', 'C14') position
15:25:32: Could not find alternative layout footprint
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/tilli/git/kicad-kbplacer/kbplacer/__main__.py", line 354, in <module>
    app()
  File "/home/tilli/git/kicad-kbplacer/kbplacer/__main__.py", line 345, in app
    board = run(settings)
            ^^^^^^^^^^^^^
  File "/home/tilli/git/kicad-kbplacer/kbplacer/kbplacer_plugin.py", line 46, in run
    placer.run(
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 905, in run
    self.place_switches(keyboard, key_matrix, key_info.position)
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 594, in place_switches
    offset = self._calculate_reference_coordinate(keyboard, key_matrix)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 582, in _calculate_reference_coordinate
    first_key, _ = next(key_iterator)
                   ^^^^^^^^^^^^^^^^^^
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 271, in __next__
    return self.__next__()
           ^^^^^^^^^^^^^^^
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 271, in __next__
    return self.__next__()
           ^^^^^^^^^^^^^^^
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 271, in __next__
    return self.__next__()
           ^^^^^^^^^^^^^^^
  [Previous line repeated 89 more times]
  File "/home/tilli/git/kicad-kbplacer/kbplacer/key_placer.py", line 266, in __next__
    key = next(self._keys)
          ^^^^^^^^^^^^^^^^
StopIteration

Additional context Annotated KLE file typematrix-2020-lookalike-with-small-enters(2).json

KiCad Project typematrix monolyth.tar.gz

I did see that the plugin created a kbplacer.log log file which contains the same error. So that's good to know.

KiCad version info

[nix-shell:~/git/kicad-kbplacer]$ python3
Python 3.11.9 (main, Apr  2 2024, 08:25:04) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pcbnew
>>> pcbnew.GetBuildVersion()
'8.0.2'
>>> pcbnew.GetBaseVersion()
'8.0.2'
tbaumann commented 3 months ago

For anyone curious about the nix shell

shell.nix

let
  pkgs = import <nixpkgs> {};
in pkgs.mkShell {
  packages = [
    (pkgs.python3.withPackages (python-pkgs: [
      python-pkgs.kicad
      python-pkgs.wxPython_4_2
    ]))
  ];
}
adamws commented 3 months ago

use this: typematrix-2020-lookalike-with-small-enters.2.json

when using full net names as key annotations, those names must match the names in kicad_pcb file - you used R0,C0 names in json but layout2schematic uses ROW0,COL0. you can use number only annotations (that's what I did) so the prefix is ignored.

tbaumann commented 3 months ago

Thanks. Did I use it wrong or does layout2schematic just use a different annotation format?

If so it's thankfully reasonably easy to convert with search and replace :D

adamws commented 3 months ago

You used it right, layout2schematic could be improved. For similar workflow (layout2schematic + kbplacer all in commandline & docker) see this: https://github.com/adamws/kicad-kbplacer/blob/ea819bd15446864aa57544bc830d6244865cceae/examples/absolem-ergogen/Dockerfile#L72

tbaumann commented 3 months ago

Thanks, I will use something like that.

tbaumann commented 3 months ago

PS: If I may ask, there seems to be an annotation format that includes a whole range of things like footprints if I understand the option --create-from-annotated-layout how do I use that one right?

adamws commented 3 months ago

for example:

python3 -m kbplacer -b keyboard.kicad_pcb -l kle-annotated.json --route-switches-with-diodes --route-rows-and-columns \
--diode D{} CUSTOM 0 4.5 0 BACK --create-from-annotated-layout \
--switch-footprint /home/aws/git/kicad-kbplacer/tests/data/footprints/tests.pretty:SW_Cherry_MX_PCB_1.00u \
--diode-footprint /home/aws/git/kicad-kbplacer/tests/data/footprints/tests.pretty:D_SOD-323F

this will create new kicad_pcb file.

tbaumann commented 3 months ago

Ah thanks for the syntax of --*-footprint I was wondering about that actually.

Perhaps I misunderstood --create-from-annotated-layout I thought it derives the footprint info out of KLE annotations.