Interactive Html Bom Plugin for KiCad

@quick, some tip if you don’t worry:

In past you help me to add a personal logo to your generated iBOM from the userheader.html

image

But with the update of the topheader CSS class I could not keep the “single line format”.

image

Could you give me some help about what I need to include into the userheader.html file? I am using a single <div style="float:left;margin:6px;background-color:white;"> to added a embedded image.

You have to inject the logo into #top div. Add this to user.js

oldOnload = window.onload;

const logoSVG = '<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="64" height="64" viewBox="0 0 172 172" style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="#ecf0f1"></path><g fill="#000000"><path d="M45.6875,10.75c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-13.4375c-7.41162,0 -13.4375,6.02588 -13.4375,13.4375v8.0625h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v10.75h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v10.75h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v10.75h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v10.75h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v10.75h-8.0625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h8.0625v8.0625c0,7.41162 6.02588,13.4375 13.4375,13.4375h13.4375v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h10.75v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h10.75v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h10.75v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h10.75v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h10.75v8.0625c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-8.0625h13.4375c7.41162,0 13.4375,-6.02588 13.4375,-13.4375v-8.0625h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-10.75h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-10.75h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-10.75h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-10.75h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-10.75h8.0625c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875h-8.0625v-8.0625c0,-7.41162 -6.02588,-13.4375 -13.4375,-13.4375h-13.4375v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-10.75v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-10.75v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-10.75v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-10.75v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v8.0625h-10.75v-8.0625c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM29.5625,26.875h112.875c4.44067,0 8.0625,3.62183 8.0625,8.0625v102.125c0,4.44067 -3.62183,8.0625 -8.0625,8.0625h-112.875c-4.44067,0 -8.0625,-3.62183 -8.0625,-8.0625v-102.125c0,-4.44067 3.62183,-8.0625 8.0625,-8.0625zM37.625,37.625c-2.96045,0 -5.375,2.41455 -5.375,5.375v86c0,2.96045 2.41455,5.375 5.375,5.375h96.75c2.96045,0 5.375,-2.41455 5.375,-5.375v-86c0,-2.96045 -2.41455,-5.375 -5.375,-5.375zM37.625,43h96.75v86h-96.75zM56.4375,53.75c-2.06811,0 -4.12573,0.78735 -5.70044,2.36206c-3.14941,3.14941 -3.14941,8.25147 0,11.40088c1.57471,1.57471 3.63233,2.36206 5.70044,2.36206c2.06811,0 4.12573,-0.78735 5.70044,-2.36206c3.14941,-3.14941 3.14941,-8.25147 0,-11.40088c-1.57471,-1.57471 -3.63233,-2.36206 -5.70044,-2.36206zM56.4375,59.125c0.69287,0 1.37524,0.26245 1.90015,0.78735c1.0498,1.0498 1.0498,2.75049 0,3.80029c-1.0498,1.0498 -2.75049,1.0498 -3.80029,0c-1.0498,-1.0498 -1.0498,-2.75049 0,-3.80029c0.5249,-0.5249 1.20728,-0.78735 1.90015,-0.78735zM67.1875,80.625c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h43c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM67.1875,91.375c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h13.4375c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM91.375,91.375c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875c0,1.49072 1.19678,2.6875 2.6875,2.6875h5.375c1.49072,0 2.6875,-1.19678 2.6875,-2.6875c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM45.6875,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM59.125,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM72.5625,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM86,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM99.4375,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM112.875,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875zM126.3125,112.875c-1.49072,0 -2.6875,1.19678 -2.6875,2.6875v5.375c0,1.49072 1.19678,2.6875 2.6875,2.6875c1.49072,0 2.6875,-1.19678 2.6875,-2.6875v-5.375c0,-1.49072 -1.19678,-2.6875 -2.6875,-2.6875z"></path></g></g></svg>';

window.onload = function() {
    oldOnload();
    var div = document.getElementById("top");
    var logo = document.createElement("div");
    logo.innerHTML = logoSVG;
    div.insertBefore(logo, div.firstChild);
}

If your logo is a png then create a img element instead and set it’s src using base64 data like this:

    ...
    var logo = document.createElement("img");
    logo.src = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
div.insertBefore(logo, div.firstChild);

Oh, and get rid of old user headers/css.

Also, User Header Misalignment · Issue #430 · openscopeproject/InteractiveHtmlBom · GitHub

1 Like

Just a dummy (or maybe advanced) question: it it possible to use a the java script to change the line color of the SVG image by use of the dark mode control of your iBOM?

If you don’t specify any colors in the svg the browser will render lines with the default text color so if you are fine with black/white it will just work.
If you want specific colors then you need to manipulate the svg element’s data. Best to declare a palette and change the color in single place.

1 Like

Version 2.9.0 is released and available in the kicad’s plugin manager, in pypi repository as a standalone package and on github.

This release has no new kicad specific features, only fixed compatibility with the imminent v8 release.

It also contains a few Eagle/fusion360 fixes and extra field support for EasyEDA designs.

3 Likes

Interactive html plugin seems to have support for filtering away DNP components by using the “field name”, but I could not find how to filter those away by using the “Do not populate” attribute which is available as a checkbox at least in Kicad 8 on symbol and footprint editor. Would it be possible to add support for this?

1 Like

It is supported. In the fields tab go to “DNP field name” and choose “kicad_dnp”.

1 Like

Thanks, I missed that from the field name list. Works now just like I hoped. And in the html settings the “dnp outlined” option is very good to have.

Only thing I could wish more, would be the possibility of having seeing also the DNP components in the list but separated from the other components.

Check “group” for “kicad_dnp” field (and don’t use it as dnp) and those parts will be grouped separately.

Hi @qu1ck! Kudos on building InteractiveHtmlBom.
I’m trying to get it to run inside docker on a headless environment in order to have a CI pipeline (using Gitlab’s free runners) spit my output files.
I know there are some hints of this on the GitHub documentation, but it seems to not be able to run in a headless environment. I’m using the official Kicad 8 docker image (Container / Docker Images | KiCad EDA) but I can run this job on other images if needed.
Any pointers?
Thanks!

I may be able to give pointers but this

is not nearly enough to go on. What errors do you see? What specific commands/scripts are you running?

Yeah, that was a crappy ask for help.

So: I have this on my Dockerfile to address InteractiveHtmlBom:

RUN apt install -y wget
RUN apt install -y software-properties-common xvfb
RUN wget https://github.com/openscopeproject/InteractiveHtmlBom/releases/download/v2.9.0/InteractiveHtmlBom.zip && unzip InteractiveHtmlBom.zip
RUN export INTERACTIVE_HTML_BOM_NO_DISPLAY=""
RUN export DISPLAY=10.0

Then I run:
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 /InteractiveHtmlBom/generate_interactive_bom.py --dest-dir self.bom_dir --highlight-pin1 --no-browser --extra-fields Description,INFO,LCSC,DIGIKEY --name-format navtrack-rev-2-interactive_bom.html /source/navtrack-rev2/navtrack-rev2.kicad_pcb
and I get: Unable to access the X Display, is $DISPLAY set properly?

I’m calling the command above from python. The thing is, I’ve tried a bunch of things and can’t get rid of this error. Any pointers?

If you use INTERACTIVE_HTML_BOM_NO_DISPLAY then there is no need to run xvfb. The reason you get the error is most likely because the $DISLPAY is 10.0 and you ask xvfb to pick auto server number which is unlikely to be 10.0.

Here’s a few things to get you on the right track:

  1. You can install ibom with pip install InteractiveHtmlBom, that will generate an executable generate_interactive_bom most likely in ~/.local/bin or wherever pip places package binaries on your distro.
  2. Use INTERACTIVE_HTML_BOM_NO_DISPLAY=1, don’t leave it empty. TRUE or YES or anything else will work too. You don’t need xvfb if you set this variable.
  3. (Optional) If you are calling from python and install from pip you can avoid spawning a process and directly call into ibom main

It will allow you more direct control of the config, custom logging and you won’t even need the env variable since you will be bypassing the dialog stuff.

Awesome, that did it!
Thanks!

1 Like

Hi,
while this pluging wonderfully worked for KiCAD versions up to 8. In the latest version (I am currently running 8.0.2 on Linux), we encountered cases of parts that are treated as excluded from BOM while they are not excluded at all - they are drawn correctly but they are missing on the BOM list. I was not able to exactly reproduce this yet - the parts that are missing on one board are OK on another and vice versa. Did the rules for the part exclusion changed?

Nothing changed except for support of new in kicad 8 DNP attribute.
I would suggest checking attributes of symbols/footprints that you find are missing in the bom and checking the settings that you generate the bom with.

I finally had some time and analyzed the parts what are excluded - the culprit is really the DNP field (the one selected as a DNP name in the config) - in the excluded part, this field was not really empty but it contained a single space (" "), so the code that checked them for presence found them present. I fixed it by removing the offending space (replacing " " for “” in board file). I am not sure how the space got there, maybe its some relic from older versions of our libraries. But I think that checking the DNP field not just for presence but also for non-whitespace contents would be nice.

Hi,

@qu1ck and the other developers, your plugin is really great! Easy to configure and results are really nice and practical.

I’m trying to automate my process using CLI.
That is handy but I didn’t find how to use the ibom.config.ini file as input. I found a workaround by using the --show-dialog option and press “generate” but it is not ideal.
Is there a better way?

Thanks.

AdriZ

1 Like

There is a related feature request Using local config file with CLI mode · Issue #368 · openscopeproject/InteractiveHtmlBom · GitHub

Current workaround is to write a shell script that captures the configs you want as flags for the CLI (every option has corresponding cli flag).

1 Like

A post was split to a new topic: How to install HTML Interactive BOM plugin?