Compare many KiCad projects by UUIDs?

I don’t think hiding trivial, and it is trivial, information is the solution. If that’s what a system hinges on, it is misguided at best. You may detect the unlucky few that copied files wholesale, but it is blind to those who figure out or luck into the “trick” of changing UUIDs. sed is just one option: g/awk, grep, Python, Bash, Perl, PowerShell, etc., not to mention good old copy-paste, will all work.

The solution is not to misuse technical implementation details to produce a fundamentally unsound detection system because it seems like a nifty trick at first glance. That is simply not good engineering and worse pedagogy. Specifically, it’s most unfair on the good students being lumped in with plagiarists who by luck or insight go undetected.

Even without formal version control (which I maintain is a core concept that should be being taught early on by any institution that claims to educate competent engineers in 2025), the traditional solution hasn’t ever stopped being highly effective and useful for far more than plagiarism detection: notes, diagrams and screenshots on the development of the project in a log book. Faking a log book retrospectively is an incredible amount of effort, and basically impossible to do for practical benefit if you stamp the pages or otherwise checkpoint the document (i.e. it’s another kind of version control)

Unfortunately, even official KiCad tutorials are as bad as the project you’ve linked - trivial boards that unnecessarily use 2 or more copper layers and super-thin traces. Cringey stuff

KiCad documentation is open for merge requests for the track width. Remember that the example is designed to show how to flip component side, so it naturally has things on both sides. It’s a tutorial on KiCad usage basics, not a tutorial on designing a good board for an specific application with specific constraints like “single-sided placement for once-through placement and reflow”.

As for the reusability, KiCad libraries already contain hundreds of identical footprints just with different names, so that footprint filters can work.

KiCad specifically does not require duplicating footprints by decoupling symbols and footprints. the libraries sometimes get a few duplicates because a manufacturer called a TQFP a VQFP and we didn’t notice we already had a compatible part. And sometimes we have footprints that differ only in 3D model and description (something I’d like to eventually change). We also have some variants of footprints to allow users to select better alternatives for their applications (long pads, handsoldering, without thermal vias, etc). But we don’t generally keep straight duplicates for filter convenience.

That is a weak point in KiCad in my opinnion too. If I place a transistor in schematics, I don’t care if it is BCE/GDS or whatever. I’ll decide that later when assigning a specific type. KiCad forces you to make that assignment in an (too) early stage. OTOH, I had my problems with the pin assignment in EAGLE when I started with it.
The reason why I used EAGLE was initially just because there was a free version. Later on, I used EAGLE at work (paid version), but I never liked the UI. For me, it was as odd as LTSpice still is to me. For me, it is “the wrong way round”. While using EAGLE at work, I watched KiCad and then, when I saw a video how shuffling works, I tried KiCad for a simple private project and was convinced. Used KiCad at work for a small 4 layer board and after that quit using EAGLE. I think that was KiCad version 5.
You don’t spend most of the time assigning footprints. You spend most of the time drawing a schematic and for making the layout. All my fault. You just have to be aware of the possible pitfalls.
And yes, I tripple check my double checks for footprints. And it went wrong in KiCad and EAGLE.

Anyhow, what is your criteria for detecting a plagiat? In schematics? In layout?
In schematics, it might be the netlist and values (resistors, caps, type of transistors). In layout placement and how the routing maze was solved.
Netlists should be easy to compare.

Placement gets more fuzzy as components might have been moved a bit. Criteria might be the geographical relation (X/Y distance) between parts with some allowance in distance (like +/- 10%).

If I place a transistor in schematics, I don’t care if it is BCE/GDS or whatever.

FYI, you can use Device:Q_NPN (say) for this. There are many “generic” devices in the Device library that don’t have pin assignments. In fact, we have recently started moving many devices with pin assignments out of the Device library into Transistor_FET/BJT etc.

Sure, it is trivial, and it won’t help against the nefarious. But student plagiarism is usually done by the lazy students. Those probably don’t even know KiCad has UUID’s in their files without (accidentally) reading a thread like this.

Thanks for the heads up! Next time, I’ll look better.
Just checked …
The problem (by design) of KiCad is, that there are no symbolic pin names. IIRC, in EAGLE, you had the symbolic names B C E and later in the design process, when you selected a specific transistor, you made the assignment to pin numbers (automagically with the translation table).
OTOH, if you look at µCs, pins do have multiple functions like GPIO, USART, ADC for a single pin. Now what name do you choose? You’d have to make a translation table that maps ADC to pin 1, USART to pin 1, … etc. But that only works until the µC offers pin remapping. So for example TX1 could be assigned to a set of pins (pick only one) but just once.

Oh well! Maybe the way KiCad does it is better in the long run. And only annoying at a first glance.

This is supported by KiCad, although the necessary information is not present for all microcontrollers. All STM32 seem to be good in this regard (I guess the symbols are generated from a script). To change the pin name:

  1. Place an STM32 IC on a schematic.
  2. Edit it’s properties by hovering over it and press e.
  3. Go to the Pin Functions tab page.
  4. Choose one of the available names from the Alternate Assignment column. I changed PA6 to an ADC input, and PB1 apparently has 4 alternative assignments available.

I don’t know of any plans to do this, but maybe someday someone will write a script to read these alternative pins directly from external sources such as STM32Cube.


In my first trial with eagle, I wanted to draw a simple schematic, without even having the intention of making a PCB. I happened to have a 0.2 Ohm shunt resistor, and I could not put such a resistor on the schematic in eagle. You could not type in a value for a resistor!
When I’m brainstorming an Idea, I don’t want to be bothered with details that are probably not ever relevant. It distracts and destroys the flow of the creative process. And sure, having to verify pin mapping between symbols and footprints is also not ideal, but you only do it when it’s needed, and after some time any sensible person would build up a personal library of verified parts. In bigger companies it’s even common to have people dedicated to maintaining libraries and verifying their integrity. (That’s also where KiCad’s database connection is invaluable to a lot of people. I don’t know if eagle has anything comparable to that.)

Dammit. I have the feeling I need some update by reading the manuals.
Thanks for the education!

But student plagiarism is usually done by the lazy students

In my experience, the dishonest ones were quite often very motivated and organised: the promise of a lucrative job involving nice offices in skyscrapers plus not having to pay back the student loan if you get a first is a powerful motivator for some to leave nothing to chance. Assuming your cheats are also always stupid and/or lazy is naive and results in an institutional addiction to designing (and/or buying) “clever” technological solutions to social problems that net a few egregious cases with minimal effort, while the more organised cheaters skate off with first class degrees to live out their days in finance. Of course catching them all would have been brutal on the departmental budgets: actually looking at our log books more often than once in a blue moon would probably have dispelled too much plausible deniability to have been a good idea. Plus someone would need to get to know the undergrads (ew).

(Seems I might be carrying some baggage here about the ol’ degree, hey?)

1 Like

Back to the original topic. Since @johnbeard already let the cat out of the bag with the UUIDs, I might as well go all the way. I cobbled together a script that can detect similar KiCad projects based on UUIDs. It also sorts the results, with most hits at the top. I know I’ll probably get flak for this, but it’s in… Windows PowerShell. To my surprise, WPS can process regular expressions, so the script doesn’t need Grep or other external programs anymore. You can get it here:

It’s not very polished, but like I said earlier, I need it only once per year.
I also added the link to OP.

More like “let a stray cat out of section of pavement”. It was never meaningfully contained in the first place, and could have left at any time.

The tool is also misleadingly named: it is a “project similarity detector” only in very specific circumstances. It is at most “template usage or file-level copy-paste and subsequent non-modification detector”.

If it ever comes down to detect a copy in an academic context with a UUID, this is like hitting an RTOS stack overflow hook in production code: it stochastically indicates that something is horribly wrong and all other system design and checks have failed on you. The questions you should really be asking if this ever pops up and you didn’t already have student solidly in your crosshairs: “how did I miss that?!” and “if i missed that what else am I missing?” and “are my honest students being done over by the
competent cheats?”. In the case of my degree, respectively: “apathy and I suspect active disinclination to look too hard”, “multiple extensive cartels of work-sharing” and “more than a little”. The one place where the cheating was far less impactful was the labs where log books and in-person Q&A sessions were highly effective, and, in retrospect, also very useful to me as a student. Probably is was no coincidence that the lab-based lecturers took a far greater interest in their students and their work as it was done.

There are conceptually quite easy ways to make cheating almost impossible. They usually require more and ongoing effort to implement, of course. IMO a lot of modern problems can be explained by technologists succumbing to the siren song of attempting to automate management of human issues.

Huh, those are some early adulthood traumas right there…

But really, what do you expect me to say? Cheaters do prosper, be it in academia, sports (doping) or bussiness (insider trading). In fact, insider trading is just an extension of your “cartels of work-sharing”. Some people simply know how to game the system, it has always been like that. Except today, nobody cares despite mountains of publicly available evidence, because people in the so-called regulatory bodies are part of the cartel now. And the rest are trapped in their little bubbles of anti-social platforms etc.

As for the “disinclination to look too hard”, that has became the official policy here in Europe. In 2010, the Europen Council decided that 40% of EU citizens should have college or similar education. To quote them exactly:

improving education levels, in particular by aiming to reduce school drop-out rates to less than 10% and by increasing the share of 30-34 years old having completed tertiary or equivalent education to at least 40%

Obviously, 40% of the population doesn’t have mental capacity to finish college, but that doesn’t concern the Euro-soviets. The Brussels Politburo has set a quota and we have to fulfill it, consequences be damned. Needless to say, the end result has been the exact opposite and the quality of students dropped significantly. In fact, I personally knew 4 colleagues who gradually become so disillusioned they left because of it. And I’m sure there were many, many more from other faculties and departments.

Simply put, we’re no MIT or ETH Zurich here. About half the students had never heard of “TO-220 package” or “plated hole” before. In fact, most of them never held a bare PCB in their hand before, yet are suddenly expected to design one.

In any case, at least I still try to catch the most obvious cheaters. In the past, I used to give unique PCB project to each student, but their difficulty varied and that was unfair, too. I also tried little test projects in the classroom, but it was impractical due to limited time.

3 Likes

Definitely it was good training for the real world. They certainly knew how to game the system, but it didn’t twig that the system was receptive to quite a bit of plausibly-deniable gaming until quite a bit later.

In any case, at least I still try to catch the most obvious cheaters

IMO the obvious ones are not the problem, it’s the sneaky, clever ones who really cause damage, because they get good marks away from the students who are doing their best. The truly lazy aren’t fooling anyone and are competing with each other for scraping a minimal pass at most.

A contemporaneous worklog (e.g. VCS is the technical solution, paper log book with numbered pages the low-tech-but-effective way, and regularly emailing project .zips to a mailbox a middle ground*) produces such an unreasonable amount of very frustrating work for a cheat, lazy or not, to fake their work and remain undetected that they might as well just do the work. For good students, it’s easy to produce and even an active benefit to do so.

I have to say, the technique left a lasting impression on me, and I got to console myself that the KPMG hopefuls had no option but to suffer through personally using Eagle and building that radio without being able to crowdsource it like usual. Which only made them double down on the collaboration on the other courses that only required a final hand-ins where they could more easily hide the provenance, I suppose! But the lab supervisor could safely say he only helped anyone pass the year based the work they actually did do (and he was more than happy to help those that cared, a fantastic guy - if you weren’t a chancer).

(*) In fact, if you gave them a project template with an jobset for zipping up, that could be a one-click process and include a schematic and board PDFs.

This circumvention doesn’t work directly. Deleting a symbol uuid breaks the connection between the schematic symbols and PCB footprint for that symbol/footprint. This requires at least one update round where reference designator is used. But detecting the broken link needs to be checked by having “Delete footprints with no symbols” option on in the Update PCB dialog.

Hi,

Maybe that will help. Python - sexpdata

In the issues, an entry is searched for. If it does not yet exist, it is added. You can certainly search according to this principle.