Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ancient frozen customized fork of your firmware (didn't set it up, kinda inherited it, don't really understand it). If I get a new ergodox, could I just flash my current firmware on to it? (Paranoid the old microcontroller in my current one *might* be starting to fail...) #96

Open
dwawlyn opened this issue Jul 20, 2023 · 11 comments

Comments

@dwawlyn
Copy link

dwawlyn commented Jul 20, 2023

So I've got an old ergodox (from https://falba.tech/)
and I'm getting kinda paranoid that the old microcontroller in it might be starting to fail.
(
according to the output of lsusb, it's a:
#=>
ID 1d50:6028 OpenMoko, Inc. Teensy 2.0 Development Board [ErgoDox Keyboard]
)

I have a very custom layout, and I'm heavily dependent on it,
so I'm trying to prepare an emergency replacement plan ahead of time
(while I can still type normally).

The apparently quickest and easiest thing to do would be to just get an https://ergodox-ez.com/

But my question here is like...

Well, I'm using an ancient frozen customized fork of your firmware.
(I just kinda... inherited it from... my dead partner...)

I didn't set it up
(I wouldn't've been able to set it up)
and I don't really understand it all.
(
There's like, a ruby script added in that actually generates the layout from an custom DSL
which is basically an ASCII-art rendition of the layout in a heredoc...
... and I don't even know what other little tweaks there might be.
)

So my question here is:

If I got a new ergodox-ez,
would I be able to just flash the firmware I'm currently using with my old ergodox onto the new?

Like, just flash it with the firmware.hex file?

Or would I have to load something else onto the new ergodox first,
and then I'd be able to do that?
(
And if I would have to load "something else" onto the new ergodox first
(before I could flash it with my current firmware.hex file),
would that "something else" just be something I already have in the directory I have here
(for this ancient frozen customized fork of the firmware)?
)

Thank you...

@benblazak
Copy link
Owner

Best to check with them, but I believe the ErgoDox EZ (at least the original, with no extra LEDs) is firmware compatible with the original ErgoDox boards. Not familiar with falba.tech, or any changes they might have made. If I recall, lsusb output shows a string from the firmware, rather than anything about the microcontroler (or of course the way the switches and such are wired) which is what determines firmware compatibility, especially if you can't change settings (e.g. for diode direction) and recompile.

I'd be surprised if the controller is going bad, but less so if some of the solder joints or switches were. In any case a backup plan is always a good idea :) -- (sorry to hear about your partner).

If indeed the boards are firmware compatible, the I believe flashing the .hex is all you'll have to do.

Have you looked at the ErgoDox EZ online configurator? If it's possible to duplicate your layout there, and you don't want to fuss with code, I recommend it. I recently moved to using it myself actually, since my switches are getting old, and I didn't want to go back and implement a proper debounce in my firmware right now.

@dwawlyn
Copy link
Author

dwawlyn commented Jul 23, 2023

Thank you!

Yeah, falbatech really aren't relevant to me anymore
-- I think they're probably great to have for people in Europe
(especially now they seem to be bigger and more settled in, so I imagine they've probably gotten their quality-control way up since the earlier days I dealt with them)
but I'm not in Europe anymore, so yeah.

But I could easily email them to ask if they can tell me about any relevant details that might differ between my keyboard and an ergodox-EZ,
if I knew what specific questions would actually be the relevant details to ask about...?

Like, I guess I should email them something like this?:

Hi, I got an ergodox from you back at the end of 2015 (around October I think).

I'm not in Europe anymore,
and to prepare for any emergency failure of my old falbatech ergodox,
I need to figure out how to transfer my firmware/layout cleanly between it and an ergodox-EZ or something.

So could you tell me any relevant details you think you can remember about the details of my 2015 falbatech ergodox?

Like, anything about the microcontroller,
the way switches are wired etc,
diode directions...?
Any way in which it might differ from the standard starting-point ergodox design...?
(Any diagrams?)

I don't really understand the kind of technical hardware details I'm asking about here myself,
but I figure I should be able to use them to confirm with someone who does.

Anything I should add/change/clarify?


Other than lsusb, I only know about lshw and xinput. Do you happen to know of any other maybe-relevant tools I should keep in mind?


In any case a backup plan is always a good idea :)

Yeah, I know, and I should really have gotten started on it like a year or two ago by now,
but... well, it was really difficult to focus on when I kept feeling like...
there's one really simple solution that would mean I'd never have to worry about backup plans again,
and maybe the only reason I have left not to use that instead is just... irrational animal fear...
So, it was easier to keep myself distracted with less difficult things instead...


Yeah, I did already check with the ergodox-EZ people,
but they only have a customer-service type of email,
and the person I got was understandably not really equipped to deal with such a weird, practically unique complicated technical question...

There was that subreddit
https://reddit.com/r/ergodox
which functioned as their defacto community
(I think there were a lot of people there who weren't even aware that the ergodox design itself and the ergodox-EZ/ZSA-the-company were different things!)
but with the reddit API-calypse
[(... heh, I just came up with that literally two seconds ago and I'm stupidly lowkey proud of that pun now... someone must've independently invented it already...)]
I'm not sure what there is left...

I asked the customer-service person if they had any other community places left,
and they just said basically like
- "OLKB subreddit?"
- "QMK Discord?"
and both of those seemed less like the best-next-thing-to-try than asking here.



Have you looked at the ErgoDox EZ online configurator? If it's possible to duplicate your layout there, and you don't want to fuss with code, I recommend it.

Yeah, that "oryx" thing?
(They also recommended I give a look at that.)

I did try using it ages ago,
but there were a few features I need that I couldn't figure out how to duplicate,
and when I tried asking customer-service about it, the answer seemed to be something like:
"... that's not possible with our tools? But if you dig into the internals of the underlying QMK firmware, you should be able to do it with [some function names or something]."

Like, for instance...


(thing-I-need 1)
I have a key for:

  • my "punctuation" layer
  • my "function" layer (ie, the F1 / F2 / [...] / F11 / F12 keys, but also the F13 / F14 / [...] / F23 / F24 keys)

and when I press both of them simultaneously, I get:

  • my "numerical" layer

(thing-I-need 2)
Also, I have two shift keys
(one to the immediate side of each pinky-finger on the homerow)
and when I press them simultaneously,
that toggles capslock.


(thing-I-need ??)
And since I kinda got blocked right-off-the-bat there,
I didn't get any further,
and it's quite possible there's another one or two key features I need that I don't know if I could manage to figure out...



Like, does oryx let you set a single key to do multiple modifier keys simultaneously? (eg ctrl+alt)

I think I was told there was "a built-in function (LM())" for that,
but I'm not sure if that means you can just do it in oryx,
or you still need to figure out some code...

And I'm not sure if it's the same for combos of mod+layer?
("layer" meaning like navigation/punctuation/etc, eg ctrl+[navigation layer])

And I think I was told both the "punctuation + function layers = numerical layer" thing
and the "left and right shift together = toggle caps lock" thing
would require "custom keycodes",
and yeah,
I'm really not sure at all how hard any of these things would be for me to figure out.

And I'm not sure if you can use oryx to mostly set up your layout,
and then only need to figure out the code for the specific custom bits you need to add in,
or if doing anything custom means you have to figure out the code for everything and can't use oryx at all?


I'd be surprised if the controller is going bad, but less so if some of the solder joints or switches were.

Yeah, I was honestly just using that as a shorthand for like...

there is maybe something mysteriously wrong with the electronics,
which I don't have the tools or expertise to diagnose or fix,
and I'm not even sure it would be practically possible to find like a repair shop or something around here who could help me...

The thing is, I've had a couple different mysterious problems with it in the past,
so even though I suspect there's at least like a 50%(?) chance there's nothing actually wrong with the hardware anymore,
I would have to experiment with it a lot more to determine that,
but if there is something wrong, then messing around with it is exactly what I want to avoid...

But I basically only ever had two separate hardware problems I know about:

  • (1) the little T-bend jumper connector thing between the mini-USB plug on the microcontroller and the external plug failed years ago,
    but I just took it out and plugged the cable in directly
    (
    this:
    20230722_035911
    )

  • (2) about a year or so later, and like a year or so ago, it started crashing more and more,
    and I think it was shorting out
    (I remember one of the diodes on the microcontroller would actually softly glow when I touched a particular pair of contacts while trying to clean it??).
    Then it finally failed completely,
    and, having nothing else to lose,
    I just doused the microcontroller in rubbing alcohol and cleaned it that way.
    -- Miraculously, it started working again, and I didn't have any problems with it after that.

It's only now, after my other old laptop unrelatedly exploded a few days ago,
and I had to plug it in to this old laptop instead,
that I started getting problems again with the ergodox not automatically coming back when I wake the laptop from sleep/suspend/whatever-it's-called.

However, I'm suspecting that it might be a purely software issue with this system
(it is plugged in through an old usb hub/splitter/dongle thing...)
and this system (opensuse tumbleweed) does have other driver issues with the interactions between old hardware
(
eg I just could not get the old integrated radeon graphics and VGA external monitor support to work together,
and I know that's a software thing cuz the VGA external monitor worked fine in a MX-linux live usb on the same laptop
),
sooo... yeah.

Like I said, I don't want to risk plugging and unplugging it a bunch just to find out...
(
And I haven't even wanted to sleep the laptop in the past few days anyway,
since I've been running so many big backup/copy jobs with my old slow external harddrives...
)

@benblazak
Copy link
Owner

Hmm -- I would ask about diode direction, and any changes vs the original ErgoDox (which is the same as the original ErgoDox EZ).

For figuring stuff out yourself, rather than any command line tools, you'll likely have to open up the board (just the case). Might be worth taking pictures, so you don't have to open it again later. Might also be worth figuring out how to compile the firmware yourself, in case you need to -- which isn't the easiest thing if you haven't done it before, but with some time and patience it should be possible.

Might wanna check out those subreddits / forums though :) as I'm starting a new job tomorrow and won't have time to help after that.

Yeah oryx sounds right. I understand about missing certain functions... especially double shift == caps lock. You can kind of work around some of them -- I currently have caps lock on the same key as shift, but on a different layer (layout here) -- which isn't as good, but not worth building a custom firmware to work around, for me. I believe the F13... keys are available now -- they seem to still be adding features from time to time. And of course layers are well supported. Don't remember about assigning multiple key codes to a single keys.

It is a little confusing asking for help with it, because it uses the QMK firmware under the hood, which runs on many boards and is quite capable, and you could in theory download the source, modify it, and compile it yourself -- many people do. If you do end up trying that, they have lots of documentation. I haven't taken the time to try it though, as the layout i linked above works well for me (and i don't want to maintain my own little fork right now).

Ahh, yes, sleep/wake, USB in general, and caps lock indicators, among other things, are magical, and I'm not sure any of them will work right on any given system. The QMK firmware is more likely to work right in these types of situations, as it's more widely used, and more actively maintained.

On that note, depending on how much time vs money you have, you probably could find someone to help, either with the physical board or the firmware, or both. I recall seeing lots of skilled electronics people on e.g. https://www.reddit.com/r/MechanicalKeyboards/ (or if not there, they could probably point you in the right direction).

Good luck!

@dwawlyn
Copy link
Author

dwawlyn commented Jul 24, 2023

Might wanna check out those subreddits / forums though

Oh yeah, that's definitely where I'm going next. I just figured I should check here first if there was anything specific to what I'm starting with.

Might also be worth figuring out how to compile the firmware yourself, in case you need to
-- which isn't the easiest thing if you haven't done it before, but with some time and patience it should be possible.

By "compile the firmware", do you just mean running make in the dir with the src subdir?
(Since that's already what I do when I want to update the firmware.hex file after modifying the layout.)
Or something more complex?

Actually,
one thing I'm still not sure about is:
is there only a single "layer" to firmware?
(ie, you flash the hex file onto the microcontroller and that's it.)

Or is there some sort of "double-layer" thing,
where there was something first loaded onto the microcontroller,
which controls/affects how it actually deals with the hex file when you load it on there?

@benblazak
Copy link
Owner

:)

Oh, nope, that's it, you're already recompiling the firmware. In that case, you could also change various options (depending on what version of the code you're using) if you need to e.g. reverse the expected diode direction, before compiling. So it's just bigger changes (different microprocessor, different IO expander, different switch wiring layout; which are less likely to have been done) that you have to worry about.

There is indeed a bootloader, preloaded, that interfaces with the teensy loader to load the firmware (the .hex file) -- https://www.pjrc.com/teensy/first_use.html

@dwawlyn
Copy link
Author

dwawlyn commented Jul 24, 2023

Ah. But that bootloader isn't one of the things that gets generated in the make.

I mean, I do remember flashing a hex for a layout I generated with oryx onto the same keyboard like a couple years ago,
and it worked fine (at least within the limitations I explored...),
so... I'm just working on the level of those hexfiles,
not tweaking anything more fundamental than that, right?

I'm just... trying to figure out what I should ask now so I can figure out the rest myself later
(but I'm feeling particularly tired and dumb right now).

Like, what parts to look up where...

I've got the old copy of this git repo,
with the code (and a bit of documentation, ie a few README's)
and that ruby script I mentioned,
which I know must generate the bits of C code that actually set the layout,
so I should be able to figure out a lot from that...

Other than that there's the documentation for the teensy itself...

... and I guess maybe the documentation for some of the dependencies I needed to build it?
(just like avr-libc and cross-avr-gcc12 I think.)
((Well, also libpng12-0 and libusb-0_1-4, but those were just dependencies for running the teensy flashing program I think.))

But I think I'm just working on the level of the code I have in the old copy of this repo, right?

... okay yeah, I am feeling way too tired and dumb right now.
I'll have to get back to this later, figuring out... what I even need to figure out.

@benblazak
Copy link
Owner

Ah. But that bootloader isn't one of the things that gets generated in the make.

correct

I mean, I do remember flashing a hex for a layout I generated with oryx onto the same keyboard like a couple years ago,

then your board is probably firmware compatible with the ergodox ez

I've got the old copy of this git repo,

yeah, i think you're wayyyy further along than you think. it sounds like you actually have everything you need.

@dwawlyn
Copy link
Author

dwawlyn commented Jul 25, 2023

yeah, I just looked in my copy of the repo at:
$

bat (find -iname '*readme*' -o -iname '*.md')

(fish, if that doesn't make sense in bash)
and...

((
Also, for context, looks like it was forked from a 2012 version?:
(
$

cat (find -iname '*readme*' -o -iname '*.md') | string match -rg '\b(20\d\d)\b' | sort -n | uniq | string join " "

#=>
2008 2010 2012
)
... although if I didn't get my ergodox until late 2015...
(
... sorry, I'm stupidly hesitant sometimes about doing anything that requires opening a new firefox tab,
cuz bloated modern web stuff is so hard for my crappy old computer that I'm often left patiently counting like
"1 mississippi, 2 mississippi, 3 mississippi"
while I wait for anything with tabs to complete...
)
... okay
https://github.com/benblazak/ergodox-firmware/commits/master/references.md
your most recent commit was 2018,
but that was just a minor update to references.md,
and before that was a 2012 commit,
so maybe my fork isn't "ancient frozen out of date"?
))


and yeah, you said (in those readme's):

It may not be necessary to load the '.eep' file (if the file is 0 bytes, and
the Teensy doesn't have anything loaded into its EEPROM already, it doesn't
make any difference), but it's good to do so anyway, just to be safe. It
won't hurt anything either way.

and I don't remember ever actually touching the eep file,
although it does say
$

cat src/firmware.eep

#=>
:00000001FF
(ie not 0 bytes...)


I also noticed you said:

Most of these instructions (or notes, rather) are meant for people [whose]
googling skills and patience are directly proportional to the amount of C
programming they don't already know :)

and like, "the amount of C programming I already know" is like practically zero,
so... yeah.


But yeah, I think I might actually be able to handle this.

I'm calming down from everything exploding...
and I think I'm finally getting over the "insomnia keeping me up for like 24-hour days and only letting me sleep like 5 or 6" thing,
and... yeah.

Thank you.

@dwawlyn
Copy link
Author

dwawlyn commented Jul 26, 2023

I did just email falbatech,
and man their selection has grown and gotten fancier since back when I got mine.
https://falba.tech/wired-keyboards/

Makes me wish I was still in Europe...

They even have wireless ergodoxes
(well, "Redox" and "ErgoDash", but yeah.)
https://falba.tech/wireless-keyboards/

I didn't know you could buy anything like a wireless ergodox anywhere?

@benblazak
Copy link
Owner

haven't seen all the versions of the board, but i'm not surprised :)

maybe worth noting that the wireless versions (like other redesigns) are probably not firmware compatible with the original.

@dwawlyn
Copy link
Author

dwawlyn commented Jul 27, 2023

Oh yeah, I'm definitely not gonna be trying to get one myself, but just like, huh, everything sure seems a lot less limited than back when I first got my first ergodox. I guess I'm still miscalibrated on how hard keyboard stuff is to deal with in general from all the trouble/limitations I ran into back then...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@benblazak @dwawlyn and others