Author Topic: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor  (Read 51278 times)

0 Members and 1 Guest are viewing this topic.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« on: Mon, 03 August 2015, 13:30:12 »
Lately I've found myself doing a lot with PCB design and needing to get everything lined up just right. Finding that endless tweaks and adjustments with the mouse were driving me up the wall I decided to build a tool that figures out exactly where the switches should go and generates EAGLE commands for putting those components into place.

After a ton of polishing and refactoring, I'm finally ready to release it to the world in a very untested alpha form. You can access it here:

http://kalerator.clueboard.co

WARNING! This is very primitive still! Please report any bugs you find!

Features:

  • Generate fully connected schematic
  • Generate fully laid out board with partial wiring (Columns are left unwired for now)
  • Include header pins so rows and columns can be connected easily
  • Share your script with others by sending them the view URL
  • UTF-8 is fully supported, but EAGLE may not like the resulting script.

Known Limitation:

  • Only the top-left label is used to determine the key name
  • Non-ASCII characters are not (yet) supported
  • RAW permalink URLs are not (yet) supported

Known Bugs:

  • Offset keys are not properly shifted
  • ISO Enter key behavior is not correct
  • Downloading scripts broken (noticed just as I was posting this, doh!)

TODO:
  • Pretty up the interface
  • Fully support UTF-8
  • Selectable controller support: Handwire (pins to handwire a teensy), Teensy (Pins for a teensy the user would have to connect manually in EAGLE), SMD (Pre-populated atmega32u4 controller the user would have to connect manually)

Changelog:
  • 2015 Aug 3: Fix the download links.
  • 2015 Aug 5: Improved caching. UTF-8 Support. Key translation table.
  • 2015 Aug 6: Support the free versions of EAGLE, Use keyboard name in download link, add pins for all rows/columns
Examples:

Prerequisites:

Quickstart:

« Last Edit: Thu, 06 August 2015, 14:29:59 by skullydazed »

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #1 on: Mon, 03 August 2015, 13:32:35 »
reserved

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #2 on: Mon, 03 August 2015, 14:07:40 »
This is exciting.  Thanks skully. 

Just wanted to let you know that I get a "500 - Internal Server Error" when I try to use my layout: http://www.keyboard-layout-editor.com/#/layouts/c2a2a76df8848ae2bdba84d606fa1635

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #3 on: Mon, 03 August 2015, 14:13:55 »
Seems like a very cool tool!


Why can't I save layouts in KLE now??

« Last Edit: Mon, 03 August 2015, 14:17:28 by jdcarpe »
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline rpeterclark

  • Posts: 355
  • Location: Florida
  • RPTR ❌
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #4 on: Mon, 03 August 2015, 14:37:10 »
Seems like a very cool tool!


Why can't I save layouts in KLE now??

Show Image


Apparently that's a new thing on KLE, wants you to sign in with GitHub and saves your layouts as Gists, not sure I like that...

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #5 on: Mon, 03 August 2015, 14:50:24 »
Seems like a very cool tool!


Why can't I save layouts in KLE now??

Show Image


Apparently that's a new thing on KLE, wants you to sign in with GitHub and saves your layouts as Gists, not sure I like that...

Yeah, it's strange. I signed into Github, and gave the application permission, but still the "Save" button was "greyed" out for me. Just tried it again, and it worked. I logged in first this time, before editing the layout.
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline rpeterclark

  • Posts: 355
  • Location: Florida
  • RPTR ❌
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #6 on: Mon, 03 August 2015, 15:05:32 »
Seems like a very cool tool!


Why can't I save layouts in KLE now??

Show Image


Apparently that's a new thing on KLE, wants you to sign in with GitHub and saves your layouts as Gists, not sure I like that...

Yeah, it's strange. I signed into Github, and gave the application permission, but still the "Save" button was "greyed" out for me. Just tried it again, and it worked. I logged in first this time, before editing the layout.

I had to *touch* the layout before it would let me save, change a label, or a color, then change it back, then it enabled the button. Weird.

Back OT, on the layouts that do work, I can't get the schematic or board download links to work.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #7 on: Mon, 03 August 2015, 15:21:34 »
This is exciting.  Thanks skully. 

Just wanted to let you know that I get a "500 - Internal Server Error" when I try to use my layout: http://www.keyboard-layout-editor.com/#/layouts/c2a2a76df8848ae2bdba84d606fa1635

Thanks!

The arrows are what's causing the internal server error. I don't properly handle unicode yet and that causes an exception. Making the app more robust in the face of errors is coming up.


Seems like a very cool tool!


Why can't I save layouts in KLE now??

Thanks!

As you found out, looks like a new thing KLE rolled out today. I had to add support for the new format really quick when I went to test, and I ended up breaking the download links in the process. Wish he had rolled it out differently, but from a developer perspective it actually enables some cool things (like letting other tools modify, not just look, at layouts.)


Back OT, on the layouts that do work, I can't get the schematic or board download links to work.

Yup, I accidentally broke that when I quickly added support for the new gist storage. I'll fix it up tonight when I'm not busy with more productive work.

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #8 on: Mon, 03 August 2015, 15:34:32 »
Can't wait to try it once you get the download links fixed. I have so many questions waiting to be answered, haha.
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #9 on: Mon, 03 August 2015, 15:45:55 »
This is exciting.  Thanks skully. 

Just wanted to let you know that I get a "500 - Internal Server Error" when I try to use my layout: http://www.keyboard-layout-editor.com/#/layouts/c2a2a76df8848ae2bdba84d606fa1635

Thanks!

The arrows are what's causing the internal server error. I don't properly handle unicode yet and that causes an exception. Making the app more robust in the face of errors is coming up.

Ahh, gothca...  Yes, I had to solve that problem too.  I will get you that code.  I have been trying to get the old builder tool (written in python) open sourced and available.  I handled that stuff in it and I am sure some of what I have done will be useful for you.  I have spent like 3 days trying to get the FreeCAD lib working correctly on my Mac which is why I have not made it public yet.  I think I am going to just give Ubuntu install instructions and if someone wants to make it work natively they can contribute how they did it.  :P  At least that way people will be able to checkout the code.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #10 on: Mon, 03 August 2015, 16:17:40 »
Adding support for UTF-8 may be as simple as adding the following line at the start of your file.  That appears to be all I had to do.

Code: [Select]
# -*- coding: utf-8 -*-

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #11 on: Mon, 03 August 2015, 17:15:59 »
Adding support for UTF-8 may be as simple as adding the following line at the start of your file.  That appears to be all I had to do.

Code: [Select]
# -*- coding: utf-8 -*-
I'll give it a shot, thanks!


Ahh, gothca...  Yes, I had to solve that problem too.  I will get you that code.  I have been trying to get the old builder tool (written in python) open sourced and available.  I handled that stuff in it and I am sure some of what I have done will be useful for you.  I have spent like 3 days trying to get the FreeCAD lib working correctly on my Mac which is why I have not made it public yet.  I think I am going to just give Ubuntu install instructions and if someone wants to make it work natively they can contribute how they did it.  :P  At least that way people will be able to checkout the code.

I'd love to take a look at it once you've done that. I don't have Ubuntu around so maybe I can take a stab at those mac directions.  :p

I've actually published the code to github, but not under an open source license for now. Eventually I want to let anyone fork it but for now I'm going to follow iprest's example.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #12 on: Mon, 03 August 2015, 17:31:43 »
Can't wait to try it once you get the download links fixed. I have so many questions waiting to be answered, haha.

I just fixed the download links. Try it out and hit me up!

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #13 on: Mon, 03 August 2015, 22:56:04 »
Adding support for UTF-8 may be as simple as adding the following line at the start of your file.  That appears to be all I had to do.

Code: [Select]
# -*- coding: utf-8 -*-
I'll give it a shot, thanks!


Ahh, gothca...  Yes, I had to solve that problem too.  I will get you that code.  I have been trying to get the old builder tool (written in python) open sourced and available.  I handled that stuff in it and I am sure some of what I have done will be useful for you.  I have spent like 3 days trying to get the FreeCAD lib working correctly on my Mac which is why I have not made it public yet.  I think I am going to just give Ubuntu install instructions and if someone wants to make it work natively they can contribute how they did it.  :P  At least that way people will be able to checkout the code.

I'd love to take a look at it once you've done that. I don't have Ubuntu around so maybe I can take a stab at those mac directions.  :p

I've actually published the code to github, but not under an open source license for now. Eventually I want to let anyone fork it but for now I'm going to follow iprest's example.

The original source for my builder (written in Python and FreeCAD) is now open source: https://github.com/swill/kb_builder

Let me know if you have any questions or if you want some help getting started hacking away on it. 

The code is pretty hard to run on a Mac.  I would HIGHLY recommend just using VirtualBox and spinning up a Ubuntu VM and running it from there.  You can just use Ubuntu Server and access the UI natively on your Mac.  If you have problems just let me know.  Enjoy...

Offline trauring

  • Posts: 94
    • off on a tangent
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #14 on: Tue, 04 August 2015, 03:18:35 »
Very cool. Excited about this tool. Looking forward to it support UTF-8.

Offline VinnyCordeiro

  • Posts: 432
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #15 on: Tue, 04 August 2015, 08:35:43 »
Feature suggestion: the script do not like when you load a layout with blank keys, keep saying that another component already have the same name and you need to click a button on a dialog to advance. So, I suggest using any type of automatic naming scheme for blank keys.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #16 on: Tue, 04 August 2015, 11:55:56 »
Feature suggestion: the script do not like when you load a layout with blank keys, keep saying that another component already have the same name and you need to click a button on a dialog to advance. So, I suggest using any type of automatic naming scheme for blank keys.

Already done, actually.  :D It assumes that a blank key is named SPACE, and if it encounters a duplicate key is appends _DUPE to the name. If you have 3 or more copies of the same key you could end up with _DUPE_DUPE, _DUPE_DUPE_DUPE, ad infinitum, but I figure that makes it easy to spot and gives the user a chance to fix it.

Thanks for the suggestion, keep them coming!

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #17 on: Tue, 04 August 2015, 12:11:28 »
I wasn't able to get it to work with the freeware version of Eagle, as the board size is too large for the freeware restriction. :(

But it looked like it was going to work, after downloading the Kalerator script files!

One thing I'm not fond of is that your generator seems to cache the layouts. When I updated a layout and saved it with the same gist name, it still had the old version in the output from your site. I'm not sure how to force KLE to save it with a new gist name, beyond starting fresh.

So this outputs a PCB with holes for the switches, and a wire matrix. Any chance of adding a controller section by default? An ATmega32U4 and its associated components would be a great choice. Routing that on the PCB might pose a bit of a problem, though, huh?
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline VinnyCordeiro

  • Posts: 432
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #18 on: Tue, 04 August 2015, 12:45:58 »
I wasn't able to get it to work with the freeware version of Eagle, as the board size is too large for the freeware restriction. :(

But it looked like it was going to work, after downloading the Kalerator script files!

One thing I'm not fond of is that your generator seems to cache the layouts. When I updated a layout and saved it with the same gist name, it still had the old version in the output from your site. I'm not sure how to force KLE to save it with a new gist name, beyond starting fresh.

So this outputs a PCB with holes for the switches, and a wire matrix. Any chance of adding a controller section by default? An ATmega32U4 and its associated components would be a great choice. Routing that on the PCB might pose a bit of a problem, though, huh?
Good PCB autorouting algorithms is what makes that kind of software so expensive. It requires extremely well-defined parameters to work properly. Eagle's algorithm works but isn't that good.

Offline trauring

  • Posts: 94
    • off on a tangent
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #19 on: Tue, 04 August 2015, 12:49:21 »

Already done, actually.  :D It assumes that a blank key is named SPACE, and if it encounters a duplicate key is appends _DUPE to the name. If you have 3 or more copies of the same key you could end up with _DUPE_DUPE, _DUPE_DUPE_DUPE, ad infinitum, but I figure that makes it easy to spot and gives the user a chance to fix it.

Can I suggest a different system? Or at least an option for a different system?

First, it would be great if there was a way to designate a key as the space.

Second, it would be nice if you allowed other non-labeled keys to be auto-numbered instead of adding DUPE to each one. Maybe something like A0, A1,A2...A9, B0, etc...

That might make it easier to navigate, and allow coding of keys that don't have set labels.

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #20 on: Tue, 04 August 2015, 13:08:17 »

Already done, actually.  :D It assumes that a blank key is named SPACE, and if it encounters a duplicate key is appends _DUPE to the name. If you have 3 or more copies of the same key you could end up with _DUPE_DUPE, _DUPE_DUPE_DUPE, ad infinitum, but I figure that makes it easy to spot and gives the user a chance to fix it.

Can I suggest a different system? Or at least an option for a different system?

First, it would be great if there was a way to designate a key as the space.

Second, it would be nice if you allowed other non-labeled keys to be auto-numbered instead of adding DUPE to each one. Maybe something like A0, A1,A2...A9, B0, etc...

That might make it easier to navigate, and allow coding of keys that don't have set labels.

Just make a fork of one of the published KLE gists, and save to your Github. They are already labeled correctly.

You can designate a label for the Space bar. I did...it's called "SPC" as in TMK.

Edit: Here's a link to my favorite 60% layout, with labels as in TMK. http://www.keyboard-layout-editor.com/#/gists/4498625502bba532a032
« Last Edit: Tue, 04 August 2015, 13:10:39 by jdcarpe »
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline Charger

  • Posts: 168
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #21 on: Tue, 04 August 2015, 13:47:05 »
I wasn't able to get it to work with the freeware version of Eagle, as the board size is too large for the freeware restriction. :(

But it looked like it was going to work, after downloading the Kalerator script files!

I ran into the same problem, even when making a 2 switch keyboard that should fit in the build area that I can use the script tries to build it outside of that area.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #22 on: Tue, 04 August 2015, 14:13:57 »
I wasn't able to get it to work with the freeware version of Eagle, as the board size is too large for the freeware restriction. :(

But it looked like it was going to work, after downloading the Kalerator script files!

I ran into the same problem, even when making a 2 switch keyboard that should fit in the build area that I can use the script tries to build it outside of that area.

I believe the script uses the (0, 0) point as the top left of the workspace.  Maybe the points have to all get shifted by (-width/2, -height/2) to fit on the workspace size.  I am guessing the workspace size is centered around (0, 0).
« Last Edit: Tue, 04 August 2015, 14:15:42 by swill »

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #23 on: Tue, 04 August 2015, 16:36:07 »
I wasn't able to get it to work with the freeware version of Eagle, as the board size is too large for the freeware restriction. :(

But it looked like it was going to work, after downloading the Kalerator script files!

I ran into the same problem, even when making a 2 switch keyboard that should fit in the build area that I can use the script tries to build it outside of that area.

I forgot that's how the freeware restrictions work. With the paid version you can place components anywhere, but the free version you can only place them in the rectangle starting at 0,0 and ending at 100,{80,150}. I'll have to add an option that translates Y by the right amount to move everything up into the freeware area. Sorry about the oversight!

One thing I'm not fond of is that your generator seems to cache the layouts. When I updated a layout and saved it with the same gist name, it still had the old version in the output from your site. I'm not sure how to force KLE to save it with a new gist name, beyond starting fresh.

Yeah, the cache was initially not a problem at all, as each save got a new hash. I need to revisit that now that that assumption has changed.

So this outputs a PCB with holes for the switches, and a wire matrix. Any chance of adding a controller section by default? An ATmega32U4 and its associated components would be a great choice. Routing that on the PCB might pose a bit of a problem, though, huh?

Putting those components and the right nets on the schematic is easy, but routing them on the PCB not so much. Options for doing this include leaving them in the default position on the board (so the user places and routes them), having a special 2U height key to represent the controller and having a pre-made layout (that would unfortunately also preclude placing any switches in that space,) and just leaving the footprint for a teensy on the board for the user to route to by hand. I don't know yet which way I want to go.

Already done, actually.  :D It assumes that a blank key is named SPACE, and if it encounters a duplicate key is appends _DUPE to the name. If you have 3 or more copies of the same key you could end up with _DUPE_DUPE, _DUPE_DUPE_DUPE, ad infinitum, but I figure that makes it easy to spot and gives the user a chance to fix it.

Can I suggest a different system? Or at least an option for a different system?

First, it would be great if there was a way to designate a key as the space.

Second, it would be nice if you allowed other non-labeled keys to be auto-numbered instead of adding DUPE to each one. Maybe something like A0, A1,A2...A9, B0, etc...

That might make it easier to navigate, and allow coding of keys that don't have set labels.

You can designate space however you want, it's just a text label. :) If you leave a key blank it assumes that key is SPACE, but if you wanted something else (like SPC, or SPAAAAACE) you can just put it in yourself.

Before I talk about how we designate duplicates, I want to clarify something. The duplication logic applies to any key, not just unlabeled keys. If you have two Shift keys, for example, one will be called SHIFT and the other SHIFT_DUPE.

I definitely get where you're coming from on identifying duplicates, and how adding numbers might be nicer in some cases. I'll think about whether it's something I can support. The way I'm thinking about it right now is that KLE is the source of truth, and so the user should make that reflect their intentions as much as possible. Using _DUPE as my identifier makes it obvious that this key is different (since the line will be significantly longer than surrounding keys) and also makes it easy to Ctrl-F to find dupes.

If most people look at that differently I can change how that works.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #24 on: Tue, 04 August 2015, 23:22:50 »
One thing I'm not fond of is that your generator seems to cache the layouts. When I updated a layout and saved it with the same gist name, it still had the old version in the output from your site. I'm not sure how to force KLE to save it with a new gist name, beyond starting fresh.

Yeah, the cache was initially not a problem at all, as each save got a new hash. I need to revisit that now that that assumption has changed.

I also had to solve this problem.  You may want to check how I do it in my code.  My code will guarantee to have a new unique hash if ANY element of the build changes.  Basically, I take the JSON object including both the layout and any settings the user specifies and I hash it (it MUST be ordered before you hash or you won't get consistent results).

Here is the code I used:
Code: [Select]
data_hash = hashlib.sha1(json.dumps(data, sort_keys=True)).hexdigest()
Hope that helps...

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #25 on: Wed, 05 August 2015, 19:06:45 »
I've just released a new version which should make this better for everyone. Cache support has been improved, UTF-8 is fully supported, and I've added a translation function to turn common symbols into EAGLE friendly text labels so you don't have to relabel everything. It's a little ANSI-centric right now, but that will improve with time.

For caching I've implemented If-Modified-Since support. This way github sends me new data if there's new data there, and if not I simply reload from cache. During my testing it took as much as 30 seconds before github started reporting a change, but otherwise I've saved and reloaded a couple dozen times now and it seems to pick up the changes reliably.

For UTF-8 support what was breaking was actually caching support. Once I switched to codec.open(file, encoding='UTF-8') everything worked great. Keep in mind that EAGLE may not like UTF-8 identifiers, so be cautious when using them.

Finally, you no longer need to rename things like the number row. For ANSI layout it converts the number row, punctuation, etc into EAGLE friendly text names. ISO layouts and the keypad aren't particularly well supported yet, but you can edit those labels yourself if needed.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #26 on: Wed, 05 August 2015, 19:08:40 »
I also had to solve this problem.  You may want to check how I do it in my code.  My code will guarantee to have a new unique hash if ANY element of the build changes.  Basically, I take the JSON object including both the layout and any settings the user specifies and I hash it (it MUST be ordered before you hash or you won't get consistent results).

Here is the code I used:
Code: [Select]
data_hash = hashlib.sha1(json.dumps(data, sort_keys=True)).hexdigest()
Hope that helps...

Luckily I haven't had to solve that particular problem here. Hashing JSON has proven to be a huge PITA though. At work we had to replace JSON's default dictionary object with OrderedDict() because we needed to hash dictionaries inside dictionaries.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #27 on: Wed, 05 August 2015, 19:55:53 »
I also had to solve this problem.  You may want to check how I do it in my code.  My code will guarantee to have a new unique hash if ANY element of the build changes.  Basically, I take the JSON object including both the layout and any settings the user specifies and I hash it (it MUST be ordered before you hash or you won't get consistent results).

Here is the code I used:
Code: [Select]
data_hash = hashlib.sha1(json.dumps(data, sort_keys=True)).hexdigest()
Hope that helps...

Luckily I haven't had to solve that particular problem here. Hashing JSON has proven to be a huge PITA though. At work we had to replace JSON's default dictionary object with OrderedDict() because we needed to hash dictionaries inside dictionaries.
The JSON package has a sort keys option that does recursive sort. It is really simple and reliable in my experience.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #28 on: Wed, 05 August 2015, 20:19:13 »
I also had to solve this problem.  You may want to check how I do it in my code.  My code will guarantee to have a new unique hash if ANY element of the build changes.  Basically, I take the JSON object including both the layout and any settings the user specifies and I hash it (it MUST be ordered before you hash or you won't get consistent results).

Here is the code I used:
Code: [Select]
data_hash = hashlib.sha1(json.dumps(data, sort_keys=True)).hexdigest()
Hope that helps...

Luckily I haven't had to solve that particular problem here. Hashing JSON has proven to be a huge PITA though. At work we had to replace JSON's default dictionary object with OrderedDict() because we needed to hash dictionaries inside dictionaries.
The JSON package has a sort keys option that does recursive sort. It is really simple and reliable in my experience.

It does, and it works wonderfully until you need to preserve an order that isn't asciibetical. :) I argued for using RFC 7518 instead but at the time it was still a draft and I couldn't convince the right people.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #29 on: Wed, 05 August 2015, 20:21:26 »
I also had to solve this problem.  You may want to check how I do it in my code.  My code will guarantee to have a new unique hash if ANY element of the build changes.  Basically, I take the JSON object including both the layout and any settings the user specifies and I hash it (it MUST be ordered before you hash or you won't get consistent results).

Here is the code I used:
Code: [Select]
data_hash = hashlib.sha1(json.dumps(data, sort_keys=True)).hexdigest()
Hope that helps...

Luckily I haven't had to solve that particular problem here. Hashing JSON has proven to be a huge PITA though. At work we had to replace JSON's default dictionary object with OrderedDict() because we needed to hash dictionaries inside dictionaries.
The JSON package has a sort keys option that does recursive sort. It is really simple and reliable in my experience.

It does, and it works wonderfully until you need to preserve an order that isn't asciibetical. :) I argued for using RFC 7518 instead but at the time it was still a draft and I couldn't convince the right people.
Luckily everything in the KLE that is keys in a dict fits that requirement. :)

It is working well for me and its a one liner.

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #30 on: Thu, 06 August 2015, 14:40:27 »
New release today with support for EAGLE's free versions! If you're using a free version just hit the radio button and your board will be moved into the upper left corner of the routable area. I was able to fit 8 columns and 5 rows into the default 160x100 routable space. I do not have the free version installed to test with, so please let me know if it places anything above or to the left of the routable area.

In addition to that headlining feature there are two other changes I want to bring to everyone's attention:

  • Downloaded scripts are now named by the Keyboard Name, if set
  • I've added pins for each row/column to make hand-wiring easier

As always please tell me what is and isn't working for you. I'd like this to be a useful tool for anyone who wants to build a PCB.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #31 on: Thu, 06 August 2015, 14:49:52 »
New release today with support for EAGLE's free versions! If you're using a free version just hit the radio button and your board will be moved into the upper left corner of the routable area. I was able to fit 8 columns and 5 rows into the default 160x100 routable space. I do not have the free version installed to test with, so please let me know if it places anything above or to the left of the routable area.

In addition to that headlining feature there are two other changes I want to bring to everyone's attention:

  • Downloaded scripts are now named by the Keyboard Name, if set
  • I've added pins for each row/column to make hand-wiring easier

As always please tell me what is and isn't working for you. I'd like this to be a useful tool for anyone who wants to build a PCB.

Looks like I need to install the freeware now.  :)  Good work BTW.  This is awesome functionality...

Offline Zorox

  • Posts: 94
  • Location: ISO-DE
  • Tactile FTW <3
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #32 on: Sun, 28 February 2016, 11:58:36 »
Hi Skulldazed, thank you for the contribution of this tool. Im trying to build a new PCB in EAGLE with your tool but there is a strang issue now. After I use the schematic script to create the board and run the board script to rearrange the PCB, there are mirrors of labels like this:



Can you pls explain how can I fix it?

Many thanks in advance :D

Offline jdcarpe

  • * Curator
  • Posts: 8852
  • Location: Odessa, TX
  • Live long, and prosper.
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #33 on: Sun, 28 February 2016, 12:25:43 »
Those are the front and back silkscreen, shown together, right?
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline Zorox

  • Posts: 94
  • Location: ISO-DE
  • Tactile FTW <3
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #34 on: Sun, 28 February 2016, 13:09:19 »
Those are the front and back silkscreen, shown together, right?

I dont know, before I run the script there are only single front silkscreen, and the diodes's labels are not mirrored :(

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #35 on: Sun, 28 February 2016, 23:01:06 »
Those are the front and back silkscreen, shown together, right?

I dont know, before I run the script there are only single front silkscreen, and the diodes's labels are not mirrored :(

jdcarpe is correct. If you want to have silkscreen labels on only one side you can "Smash" the component and then move the labels around, or delete them, as you please.

Offline Zorox

  • Posts: 94
  • Location: ISO-DE
  • Tactile FTW <3
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #36 on: Mon, 29 February 2016, 07:01:54 »
Thank you guys for the help :D If I keep both silkscreen, will it be automatically detected by manufactor or should I remove one of them?

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #37 on: Mon, 29 February 2016, 08:13:18 »
Thank you guys for the help :D If I keep both silkscreen, will it be automatically detected by manufactor or should I remove one of them?

If you keep both you'll have a label on each side of the board. That can be handy for certain components. If you don't want that (for aesthetic reasons) you can remove one, but the manufacturer doesn't care much either way.

Offline Chankster

  • Posts: 4
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #38 on: Sun, 13 March 2016, 17:04:23 »
I noticed a few issues when using the ANSI 104 layout from the KLE templaces

  • Grave seems to be placed on an odd row 2.5
Code: [Select]
ADD ALPSMX-1U-LED@AlpsCherry GRAVE (0.75 -3.75);
ADD DIODE'1N4148'@Seeed-OPL-Diode DGRAVE R90 (0.65 -3.30);
ADD HEADER-1P-KEYBOARD@Headers PROW2.5 R90 (0.65 -3.15);
JUNCTION (0.65 -3.15);
NAME ROW2.5 (0.65 -3.15);
  • * on the numpad ends up dupe'ing against the already dupe'd numpad 8. It's an easy work around to relabel one of them but would be nice if fixed.
  • Column generation seems off and ends up with oddly chosen columns
  • On the board layout, not all rows seem to have traces laid out properly. Some are correct, some missing, some skipping past adjacent keys
  • Misalignment of taller keys such as + and Enter on the numpad. Additionally, I believe it should probably use the 2U part.
  • 2U parts seem to have a double LED footprint.
  • Would be nice to have an option for the orientation of the switches (having the LED at the top or bottom of the key)

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #39 on: Thu, 17 March 2016, 15:40:52 »
Thanks for the report. Most of it I can fix at some point (I'm pretty busy right now but I will be working on this again) but the missing traces are an EAGLE bug I think. The script works perfectly if I paste in a line at a time, but when run some of them end up missing. I haven't been able to figure out why.

Offline Chankster

  • Posts: 4
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #40 on: Mon, 21 March 2016, 09:35:23 »
I haven't dug into it completely but I noticed I get more traces in the correct places when I rearrange the scr to do all the moves/rotates first and the wire/route commands afterwards.

Offline dragonpower2000

  • Posts: 35
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #41 on: Mon, 25 April 2016, 10:33:08 »
Does the PCB support PCB mounted stabilisers and also how can i fix the iso enter key
« Last Edit: Mon, 25 April 2016, 11:53:50 by dragonpower2000 »

Offline Bonk_Donk

  • Posts: 2
  • Location: Toronto, Ontario
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #42 on: Sat, 14 May 2016, 15:11:13 »
I don't exactly know what I'm doing, so I keep getting errors when I run the script in the EAGLE Freeware for the keyboard I made. http://www.keyboard-layout-editor.com/#/gists/c7dce418c8d8dd65e18dcb238d1d297e

Offline Charger

  • Posts: 168
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #43 on: Sat, 14 May 2016, 15:26:23 »
I don't exactly know what I'm doing, so I keep getting errors when I run the script in the EAGLE Freeware for the keyboard I made. http://www.keyboard-layout-editor.com/#/gists/c7dce418c8d8dd65e18dcb238d1d297e
as I recall free eagle has a rather small PCB size way smaller that what you drew up and unless this was fixed this script doesn't build in the area for the free version with even a one switch build unless it was updated

Offline dragonpower2000

  • Posts: 35
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #44 on: Sat, 14 May 2016, 16:09:20 »
you really need to fix the iso enter problem, driving me nuts trying to fix it afterwards, the problem seems to be that when using a 2u high key it places the switch on the top and not on the bottom, trued to place a key where the switch should be but it became rows 2.5 and 3.5
« Last Edit: Sat, 14 May 2016, 17:42:58 by dragonpower2000 »

Offline What

  • Posts: 7
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #45 on: Mon, 16 May 2016, 16:06:40 »
Doesn't work for me
Layout http://www.keyboard-layout-editor.com/#/gists/44ce9376d84f191fb551365b70785748
This is what I get when I run scripts
137279-0
137281-1

Offline dragonpower2000

  • Posts: 35
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #46 on: Tue, 17 May 2016, 09:08:36 »
things with uneaven rows are (for some reason) always messed up

Offline skullydazed

  • * Vendor
  • Thread Starter
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #47 on: Tue, 17 May 2016, 19:54:52 »
Yes, my row detection is rather rudimentary right now. I need to work on that.

I'm pretty busy with Clueboard stuff right now, this is pretty far down my list of priorities right now. After I ship the Cluepad and the Clueboard 2.0 case, and after I ship Nantucket Selectric, I'll be looking at designing my next board. At that time I'll be able to fix this up and add some new features, like a routing engine that can handle staggered rows. Sorry I don't have better news here for you guys, I know it sucks to have a tool that should work but has show stopping limitations.

Offline dragonpower2000

  • Posts: 35
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #48 on: Wed, 18 May 2016, 01:35:30 »
Yes, my row detection is rather rudimentary right now. I need to work on that.

I'm pretty busy with Clueboard stuff right now, this is pretty far down my list of priorities right now. After I ship the Cluepad and the Clueboard 2.0 case, and after I ship Nantucket Selectric, I'll be looking at designing my next board. At that time I'll be able to fix this up and add some new features, like a routing engine that can handle staggered rows. Sorry I don't have better news here for you guys, I know it sucks to have a tool that should work but has show stopping limitations.

Ok, good can youf ix so you can wire the leds too?
« Last Edit: Wed, 18 May 2016, 04:56:13 by dragonpower2000 »

Offline tobsn

  • Posts: 216
Re: Kalerator - Generate EAGLE PCB's from Keyboard-Layout-Editor
« Reply #49 on: Thu, 25 August 2016, 12:45:55 »
I placed the required libraries into the lbr folder but it gives me tons of errors... it can't find the Seeed components on the schematic and the board keeps saying Unknown Element: Y... etc.