yaqwsx / KiKit

Automation tools for KiCAD
https://yaqwsx.github.io/KiKit
MIT License
1.49k stars 200 forks source link

Error: "Unknown file type" #666

Closed bradanlane closed 5 months ago

bradanlane commented 5 months ago

Prerequisites

KiKit version

1.5.1

KiCAD version

8.0.1

Operating system

MacOS 14.4

Description

Run Kikit to make panel from project.

Onu output is:

An error occurred: Unknown file type
No output files produced

When I look in the output folder, I see the following files:

     13 Mar 18 11:56 panel.kicad_dru
1969916 Mar 18 11:56 panel.kicad_pcb?
   1271 Mar 18 11:56 panel.kicad_prl
  20393 Mar 18 11:56 panel.kicad_pro

If I remove the ? from panel.kicad_pcb? then I can open it and it looks OK.

Steps to Reproduce

Here is the kaki JSON:

{
    "layout": {
        "type": "grid",
        "rows": 1,
        "cols": 1,
        "hspace": "2mm",
        "vspace": "2mm"
    },
    "source": {
        "type": "auto",
        "tolerance": "1mm"
    },
    "tabs": {
        "type": "corner",
        "width": "4mm",
        "source": "none"
    },
    "cuts": {
        "type": "mousebites",
        "drill": "0.5mm",
        "spacing": "0.75mm",
        "offset": "-0.35mm",
        "prolong": "-0.4mm"
    },
    "framing": {
        "type": "tightframe",
        "hspace": "5mm",
        "vspace": "5mm",
        "slotwidth": "2.5mm",
        "width": "2.5mm"
    },
    "tooling": {
        "type": "4hole",
        "hoffset": "3.5mm",
        "voffset": "3.5mm",
        "size": "1.8mm"
    },
    "fiducials": {
        "type": "4fid",
        "paste": true,
        "hoffset": "13.5mm",
        "voffset": "3.5mm",
        "coppersize": "1mm",
        "opening": "1.5mm"
    },
    "post": {
        "type": "auto",
        "millradius": "1mm",
        "origin": "bl",
        "copperFill": false
    }
}

I will need to redact the pubnew file before I can share it.

yaqwsx commented 5 months ago

Please rerun it at least with --debug 'trace: true' (as requested in the issue template). If you want, you can share the files confidentially via e-mail.

bradanlane commented 5 months ago

I was getting an error that --debug was not a command option. I just realized that it doesn't work when using a json file for the configuration. adding the following gave me the output:

"debug": {
    "trace": true
}'

The results are:

An error occurred: Unknown file type
No output files produced
Traceback (most recent call last):
  File "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kikit/panelize_ui.py", line 217, in panelize
    doPanelization(input, output, preset, plugin)
  File "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kikit/panelize_ui.py", line 301, in doPanelization
    panel.save(reconstructArcs=preset["post"]["reconstructarcs"],
  File "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kikit/panelize.py", line 537, in save
    fillBoard = pcbnew.LoadBoard(self.filename)
  File "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pcbnew.py", line 9305, in LoadBoard
    return _pcbnew.LoadBoard(*args)
OSError: Unknown file type
bradanlane commented 5 months ago

I am also seeing a couple other errors but I think they are "downstream" to this one and may go away one I have this issue sorted.

edit

On second, thought, the "other errors" may be relevant.

The board is circular (with a circular cutout in the middle). Where the mouse bits are placed, the "tight frame" is not closing the way it used to. There is also a rogue vertical line on the user drawings layer (the lower end of which is visible in the screen image). Here is an image: Screenshot 2024-03-22 at 13 38 27

bradanlane commented 5 months ago

DOH!

The issue was the bash file I was using was originally written from a windows machine and had a hidden LF at the end. I was running the bash file from a Mac. This is what the file name was displaying as panel.kicad_pcb?. The ? was an unprintable character in MacOS Finder.

Once I found that, the panelization completed without error. Additionally, the edge cut was done correctly and the rogue vertical line went away.