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

UHK80 sometimes lagging and sending duplicate keypresses (or wrong order) #1077

Open
n0rbertg opened this issue Jan 7, 2025 · 61 comments
Open
Assignees

Comments

@n0rbertg
Copy link

n0rbertg commented Jan 7, 2025

Hi,

Strange issue and it's difficult to troubleshoot as I can't reproduce it reliably, but it happens quite often.

Setup:

  • UHK80 with fw 12.0.1 12.1.0
  • OS: Windows 11

I have two computers and use a USB switch to switch the keyboard between them. (I haven't tried the built-in feature yet, will do this eventually :))

Sometimes, when I change computers, it takes quite a while for the keyboard to wake up. It's not necessarily tied to the switch, but it happens more often after it.

The keyboard becomes very laggy for about a minute or two, and it sends various signals to the host:

  • When I press a single key, it just repeats it (like a single press sends 6-8 characters)
  • The order of some key presses is swapped; it sends the one I pressed later first
  • Sends the characters with a noticeable lag

As mentioned, this happens for a minute or two and after a while it settles down and gets back to normal.

If someone could explain how to debug this behaviour, I am happy catch it and attach logs when it happens. I haven't seen anything like this with my UHK60 (v1)

@kareltucek
Copy link
Collaborator

Please upgrade and retest with at least 12.1.0. We have upgraded to a newer SDK and Benedek has done a huge amount of work on USB since then.

@n0rbertg
Copy link
Author

n0rbertg commented Jan 7, 2025

My bad, this was a typo, I am using 12.1.0

I have just seen there is a 12.2.0, will upgrade and update when this happens again.

@kareltucek
Copy link
Collaborator

Alright, then that is of a concern.

Unfortunately in this case it is hard to rule out the switch as the source if the issue - we generally recommend using UHK without any intermediate devices in case of troubles :-(.

@kareltucek
Copy link
Collaborator

(As for the built in feature, we are still working on it...)

@n0rbertg
Copy link
Author

n0rbertg commented Jan 7, 2025

Is there a way to debug this when it's happening?

(As mentioned, I was using my UHK60 with the same switch without any issue)

@kareltucek
Copy link
Collaborator

None accessible.

You can try capturing wireshark logs, and while it is possible that you will be able to spot something suspicious, it is unlikely for a mere mortal to be able to seriously debug them.

You can also try to pull some data from uhk directly, but we don't have much support for that yet.

If you have a jlink probe then you should be able to acces zephyrs shell, but that is not enough as most debug-relevant features are disabled at compile time for performance reasons, and enabling them usually requires writing custom code.

Exposing zephyr shell over usb is high on my priority list, but debugging usb over usb is likely to run into a wide variety of problems.

@pcooke9
Copy link

pcooke9 commented Jan 7, 2025

This sounds a lot like what I was trying to explain here: #998 (comment)

And here:

3. FW Release v12.2.0
•After flashing, I had jumbled output with short bursts of repeating keys. (This doesn't happen every time I flash v12.2.0)
•Disconnecting the bridge cable and using the UHK80 with both halves connected wirelessly seemed normal, but jumbled output returned when reconnecting the bridge cable.

I don't use a switch or hub; both USB halves directly into the PC.

I also suspect the repeating mouse keys reported by @Zetaphor might be the same.

@kareltucek
Copy link
Collaborator

kareltucek commented Jan 7, 2025

Maybe try to see whether there is anything abnormal about the way uhk registers in the system, but again, I am not fluent enough with usb to help much

@pcooke9 yes, sorry about that, I am quite overwhelmed these days.

@pcooke9
Copy link

pcooke9 commented Jan 7, 2025

@kareltucek No worries, I can see you've got a lot going on. 🫣 It probably doesn't help that my comments are so long winded either. 🤣

@kareltucek
Copy link
Collaborator

No worries 😉.

@jwr
Copy link

jwr commented Jan 8, 2025

FWIW< hti sis likely th esam eproblme that I reported in another issue. i mypin hi on hte latest firmware 912.2.00 and thi si swhat comes out. i iwll be downgradin gagain, i guess.

mY uhk I socnnecte div auSB, wih hte coiled iwre between th ehalves.

Also, each half resets itsel feveyr once in ahwile, boin gdark an docming up again afer several seconds. THe resets seme to happen only if i"M ytping osmehting, leaving ht ekeyboard yb itself doens' tseem to tirgger resets.

EDIT after downgrading to 12.0.1: #1065 is where I initially reported this problem. Firmware 12.0.1 is the last version that I can use.

@mhantsch
Copy link
Contributor

mhantsch commented Jan 8, 2025

Same here. Wanted to use my UHK80 with firmware 12.2.0 today and got only garbled output, missing keypresses, and repeated characters, as well as the keyboard (at least right half) rebooting every 30-60 seconds. Completely unusable. Went back to 12.0.1 and it works again.

@lightningRalf
Copy link

So i am still on 12.1.0 na dhav the sam eissues. fo r aaaaaaaafew days. i tis hpapnein gmost often avvvffter i ne dth eeeepc ot lseep and hten wak ei tup iwht akeystroke.
Whne it waks up. ht eleft hlaf gets activated first. an dhtne comes hte seocnd. After that sometimes i towkrs iright, other itmes i tjumbles up htese htings.

as you can read in this message.
After some itme i tttdisconnects agian na dhtan reconnects, bu thte errors are still htere, but alittle bit less.

After some time again, the keyboard disconnects again, and then reconnects and then all the issues are gone.
Just like now. (Started typing this message as soon as I COULD enter my password correctly and got to type it out) So it was about a timespan of around 5 minutes I imagine. 2.5 min for each 'restart' of the keyboard.

I connect the UHK80 directly to the PC.

@mondalaci
Copy link
Member

There are too many variables, so going forward, please every one of you let us know whether the keyboard halves are connected via the bridge cable, and whether you're using your UHK via USB, BLE or the dongle.

@Zetaphor
Copy link
Member

Zetaphor commented Jan 9, 2025

Every time I've encountered this issue I have had the bridge cable connected, and USB connected to the right half

@n0rbertg
Copy link
Author

n0rbertg commented Jan 9, 2025

Same, mine is connected via USB with the right half and using bridge cable

@jwr
Copy link

jwr commented Jan 9, 2025

Bridge cable connected, USB connected to the right half.

@pcooke9
Copy link

pcooke9 commented Jan 10, 2025

Bridge cable and both halves connected with USB.

@mhantsch
Copy link
Contributor

Bridge cable and USB connection on the right half.

@lightningRalf
Copy link

lightningRalf commented Jan 10, 2025

Bridge cable and USB connection on the right half.

(after updating to 12.2.0) I did not stumble upon that issue anymore.
Update: just started to see it again. Same bevavior: after wake up from sleep. This time it is not that drastic any more. And after 2.5 min the keyboard started to reboot. And after that first reboot it works properly now!

@tunney
Copy link

tunney commented Jan 10, 2025

Bridge cable, usb to right side. 12.2 on a Mac

I occasionally see the gargles input. As if the left side lagged the right.

@blach
Copy link

blach commented Jan 13, 2025

I also have missing key presses, but only if not using the bridge cable:

UHK 80, USB-C on right half, no bridge cable, 12.3.0, connected to Mac. The issue was also when using firmware 12.2.0.
It also happened with BLE instead of USB-C.

I don't seem to have missing key presses when connecting the two halves using the bridge cable.

@vpal
Copy link

vpal commented Jan 13, 2025

One strange thing. I received my UHK80 with the 12.2.0 firmware (this is what it came with from the factory).
I was using it for a week without seeing these issues, I did not flash the firmware during this time.
Now I upgraded to 12.3.0 and I started seeing similar issues after the keyboard wake up, right after the FW upgrade.
It was just typing the letter 'e' endlessly and things like that.
Right half connected via USB and two halves connected via the bridge cable.

I will keep testing and report my findings, will let you know if the issue persists.

@n0rbertg
Copy link
Author

One more symptom, when the keyboard acts messed up, the left shift doesn't work properly but the right one does. (left just randomly changes characters or not at all, acting erratic) - using bridge cable

@mhantsch
Copy link
Contributor

mhantsch commented Jan 14, 2025

Further info: after upgrading my UHK 80 to firmware 12.3.0 (from 12.0.1), the symptoms initially reappeared.

Lagged keystrokes, keys getting stuck and autorepeating, keys swapped between left and right halves, layers (including Shift!) only activating 1-2 seconds after the keydown event (so subsequent characters would not be shifted, e.g. holding left shift and then tapping /? repeatedly would output /////???????????) and weird side effects with my hrm macros. Basically, the UHK 80 was unusable.

Then the keyboard rebooted itself (at least the right half) a few times, and suddenly all the problems went away and everything functions normally now. I didn't change anything in between, I just kept trying to use the keyboard and figure out how I create a reproducible sequence of keystrokes that shows the issues.

Not sure if that helps at all. Just trying to describe what I experienced. Now I am using 12.3.0 and it seems to work now.

Bridge cable connected, right half connected via USB, left half also still connected via USB (from the firmware upgrade).

@mhantsch
Copy link
Contributor

The symptoms came back after saving a configuration :-(

I have one more observation: when the symptoms appear, as soon as I disconnect the bridge cable, and the UHK switches over to wireless connection, the lag disappear, and for example the left shift and /? issue goes away.

When I reconnect the bridge cable, the issues reappear.

Or let me say, with the bridge cable disconnected, the issues are much beter. There is still the occasional misisn letter or swap, as you can see in this vey sentence.

With hte cable ocnnecetd, the tyipng is completely garblele ld ma

@mhantsch
Copy link
Contributor

I rebooted the lleft half a few times to see if the problem goes awya but it keeps reappearing.

is laso reboote dhte rihg thalf but htat doesn't hel peihte.r

@mhantsch
Copy link
Contributor

As far as I know, the halves reset separately. Rebooting the right half does NOT automatically restart the left half.

@pcooke9
Copy link

pcooke9 commented Jan 15, 2025

Ok, scared me for a minute.😅

@kareltucek
Copy link
Collaborator

I am wondering if elmag interference could be the culprit - messages over uart are not (yet) checked for consistency.

@mondalaci
Copy link
Member

Oh no, we really should use CRC and resend invalid packages, as the bridge cable is not shielded! :)

If you folks only experience this issue with the spiral cable but not without it, then we probably have the culprit.

@pcooke9
Copy link

pcooke9 commented Jan 15, 2025

Is there a easy way to test interference? If a super cheap EMF meter ($20-$30) would suffice, I wouldn't mind grabbing one. I'm sure it'd be fun to play with anyway.

I usually keep my phone at least a couple feet away from my board, so I doubt that's it for me. Although I do sit about a foot or so away from a 55" TV as my monitor...

@mondalaci
Copy link
Member

I put my phone as close to the bridge cable as possible while having a call, and I couldn't reproduce this issue. I don't have a better idea, and I expect EMI to vary wildly across environments/devices.

@mhantsch
Copy link
Contributor

If you folks only experience this issue with the spiral cable but not without it, then we probably have the culprit.

I experience LOTS of issues when the cable is connected. Without it, I experience the OCCASIONAL missing letter. There may be multiple issues involved, or delays introduced over the serial link cause a small race condition to trigger substantially more often.

@mhantsch
Copy link
Contributor

I also don't understand why the issue can completely go away at times after rebooting the right half with the cable disconnected (or connected). Also, I don't get such an amount of problems with firmware 12.0.1. There must be some software issue involved, too.

@mondalaci
Copy link
Member

By "serial link", I assume you mean the bridge cable. The wireless connection between the keyboard halves is also a (wireless) serial link. Just wanted to clarify to avoid miscommunication.

@mhantsch
Copy link
Contributor

Yes, the bridge cable.

@tunney
Copy link

tunney commented Jan 15, 2025

I am wondering if elmag interference could be the culprit - messages over uart are not (yet) checked for consistency.

I use my UHK80 in the same environment and situations as my UHK60s and have done for the last 3-4 years. I have never experienced elmag interference in this environment with the UHK60.

I have experiences elmag interference in other environments with the UHK60 but never in the home office. So the UHK80 would have to be significantly more sensitive than the UHK60.

@mondalaci
Copy link
Member

So the UHK80 would have to be significantly more sensitive than the UHK60.

The UART of the UHK 80 should be a lot less prone to interference than the I2C bus of the UHK 60. CRC backs the I2C on the firmware level, unlike UART. We have yet to see how UART performs with CRC.

@tunney
Copy link

tunney commented Jan 15, 2025

I cannot replicate elmag interference with phone usage near the UHK80, I could with the UHK60

@mhantsch
Copy link
Contributor

the bridge cable is not shielded

I really don't think it's elmag interference, or not only. We could try wrapping the bridge cable in aluminium foil and grounding it, just to see if it makes any difference.

@vpal
Copy link

vpal commented Jan 15, 2025

One thing that came in to my mind is if this is related to either battery or the modules.
I'm on 12.3.0 and I have only seen a similar issue once when I upgraded to 12.3.0, not after that.
There is a good test that was shown on the forum in a video with the LEDs changing when pressing one of the layer activators. I also tested it that way and for me it seems to be full in sync.
Connected via USB cable and the bridge cable also being connected.
Is there anyone who has this without battery or any module connected?

Hope this helps the investigation.

@n0rbertg
Copy link
Author

Is there anyone who has this without battery or any module connected?

I don't have battery nor any module and I still experience this.

@pcooke9
Copy link

pcooke9 commented Jan 16, 2025

the bridge cable is not shielded

I really don't think it's elmag interference, or not only. We could try wrapping the bridge cable in aluminium foil and grounding it, just to see if it makes any difference.

Are shielded RJ9 connectors even a thing? I don't think I've ever seen one.

@kareltucek
Copy link
Collaborator

Guys, could you please test uhk-firmware-12.3.0-uart-fixes.tar.gz?

(In case of invalid messages it may output an error - in that case the oled shows a warning triangle. You can retrieve the message from Agent. The content isn't important, but the presence and number of these messages is of interest.)

@tunney
Copy link

tunney commented Jan 16, 2025

as in the count of the lines here?

Image

@kareltucek
Copy link
Collaborator

Yes! Or more precisely how often they appear, and whether the problems persist, whether you notice any issue the moment before it appears 😊

@tunney
Copy link

tunney commented Jan 16, 2025

Yes! Or more precisely how often they appear, and whether the problems persist, whether you notice any issue the moment before it appears 😊

How does one clear the error messages so that one can tell when the message is a new one?

@kareltucek
Copy link
Collaborator

The clearStatus macro command

@tunney
Copy link

tunney commented Jan 16, 2025

Sorry, silly question I even have that one already assigned....

@tunney
Copy link

tunney commented Jan 16, 2025

I am seeing loads of lags and freezing from the left side but one one "Invalid UART message received!" message

Bridge cable, and USB connection.

@kareltucek
Copy link
Collaborator

Hmm, I will add some more logging...

@tunney
Copy link

tunney commented Jan 16, 2025

Really bad freezing this even. Really frequent and persistent. No more events though.

@tunney
Copy link

tunney commented Jan 17, 2025

No freezing or lagging in the last hour but two errors:

Image

@tunney
Copy link

tunney commented Jan 17, 2025

Wow i continue to be amazed at how bad the UHK80 can be. Just when I think that it cannot get worse......

Left side is basically unusable this afternoon. Lack of responsiveness is astounding.

Another "invalid UART message received and the left side takes tens of seconds to respond. The display on the keyboard cycled between the wifi icon, connected icon, and an X

Staying on a UHK60v2 for the foreseeable.

@kareltucek
Copy link
Collaborator

Can you please try uhk-firmware-12.3.0-uart-fixes-v2.tar.gz?

This time I explicitly log uart timeouts, this time on the oled.

I assume you will see lots of uart timeouts.

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