Author Topic: TMK USB to USB keyboard converter  (Read 521916 times)

0 Members and 2 Guests are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #750 on: Mon, 04 October 2021, 18:20:29 »
Not stupid. You will have to wirte some codes and build firmware yourself. Keymap Editor can't do that at least.
In general changing keyboard language in the converter is very difficult, especially with AZERTY.
Change language on OS is good option if possible, of course.

Maybe stupid question, but can I use this Converter to switch from French AZERTI Lay-out to German ISO?

Many thanks t


Offline Horsebadorties

  • Posts: 6
  • Location: Eastern Seaboard
Re: USB to USB keyboard converter
« Reply #751 on: Mon, 04 October 2021, 19:27:03 »
Hi Hasu,

This is firmware with debug feature and it will cause the problem, I guess.
(Attachment Link)

This firmware with  media key and mouse key will work without the problem.
(Attachment Link)

You are correct! The first .hex file indeed replicated the problem. The second file works fine.

Thanks so much. Now I can actually start using the converter!

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #752 on: Tue, 05 October 2021, 06:16:51 »
Hi Hasu,
    I have a Corsair K70 MK 2 LP and have visited [https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb][/https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb] from there I made no changes but simply downloaded the unimap.hex file. I then flashed the converter using FLIP and none of the mappings appear to work.

Attached is a log from hid_listen (just copy and paste from console) that shows the keyboard attaching. I hit a key to switch off the flashing LEDs and then try typing a Q and a W.

Hope that helps.

Thanks,
Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #753 on: Tue, 05 October 2021, 07:18:09 »
mcaple,
The converter recognizes the keyboard somewhat but seems to fail to make it into Boot(6KRO) mode.

Please check 'Troubleshoot' section in the first post(just updated).
Can you flash debug firmware and check its log with hid_listen again?
Also try 'USB Descriptor Dumper' to get the keyboard's descriptor.

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #754 on: Tue, 05 October 2021, 16:26:39 »
OK Hasu I hope this is what you need,

  • debug_log.txt contains the log from hid_listen
  • tmk_usb_desciptor.txt contains the text from the right hand panel of the USB Device Tree Viewer
  • Capture.PNG shows which branch of the tree I clicked on

Thanks,
Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #755 on: Tue, 05 October 2021, 21:24:59 »
As for debug_log.txt, the converter seems to work well without explicit issue at startup. We will have to check keyboard's USB Descriptor colsely to further investigation now.

Sorry for confusion of  the instruction. Use hid_listen with TMK USB Descriptor Dumper firmware and just share all of its output like your debug_log.txt.


Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #756 on: Tue, 05 October 2021, 23:15:20 »
Aha,
   easy when you know this stuff so well to expect certain knowledge so no worries on your last request. I have now flashed the tmk dumper file and attached the log from hid_listen

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #757 on: Wed, 06 October 2021, 00:25:49 »
Attached file(tmk_dumper.txt) is output of debug firmware as previous, not of dumper firmware.


Output of dumper is exepected like below.
Code: [Select]
usb_state: 12                                                                                                                                                 
usb_state: 20                                                                                                                                                 
usb_state: 40                                                                                                                                                 
usb_state: 50                                                                                                                                                 
usb_state: 51                                                                                                                                                 
usb_state: 90                                                                                                                                                 
                                                                                                                                                             
//////////////////////////////////////////////////////////////////////                                                                                       
// USB_desc_dump                                                                                                                                             
// Address: 01                                                                                                                                               
// Lowspeed: 01                                                                                                                                               
                                                                                                                                                             
// Devicer dump:                                                                                                                                             
12 01 00 02 00 00 00 08 6A 04 11 00 00 01 00 00                                                                                                               
00 01                                                                                                                                                         
                                                                                                                                                             
// Device:                                                                                                                                                   
bLength:                12                                                                                                                                   
bDescriptorType:        01                                                                                                                                   
bcdUSB:                 0200                                                                                                                                 
bDeviceClass:           00                                                                                                                                   
bDeviceSubClass:        00                                                                                                                                   
bDeviceProtocol:        00                                                                                                                                   
bMaxPacketSize0:        08                                                                                                                                   
idVendor:               046A                                                                                                                                 
idProduct:              0011
bcdDevice:              0100
iManufacturer:          00
iProduct:               00
iSerialNumber:          00
bNumConfigurations:     01

// Config0 dump:        len: 0022
09 02 22 00 01 01 00 A0 32 09 04 00 00 01 03 01
01 00 09 21 11 01 00 01 22 40 00 07 05 81 03 08
00 0A


Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #758 on: Wed, 06 October 2021, 06:02:05 »
Sorry about that had a problem with the extension under windows  :(

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #759 on: Wed, 06 October 2021, 09:12:59 »
Thanks.
But dumper output is broken somewhat unfortunately.

Did you use QMK Toolbox for this, perhaps?  It is known to miss some output.

If so, use hid_listen directly in cmd or power shell.
If not, this is a bug of dumper firmware.

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #760 on: Wed, 06 October 2021, 17:12:02 »
Morning Hasu,
     I didn't use TMK Toolbox for this and have found that you cannot use it and hid_hidden at the same time as one expects the converter to be in program mode and the other not.
     I did the whole process again and I think I have found that the first time you connect after reflash the output appears broken but if you disconnect and reconnect another time the output looks OK. I have attached 3 outputs for you. As you will see the 1st looks broken and the other 2 have the Corsair keyboard name and look complete. Let me know what you think.

Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #761 on: Thu, 07 October 2021, 00:58:37 »
try3.txt has complete descriptors. Thanks.
Dumper firmware seems to have a bug on reading decriptors from K70.

Accodring to descriptors of the keyboard  it should support Boot mode(6KRO) as well as NKRO. But it seems to refuse Boot mode request of the converter for some reason.

I dont' know how to update Corsair keyboard firmware but the latest firmware may solve somewhat. iCUE software?

Try this to turn keyboard into 6KRO mode manually. This won't be a solution but may kind of work.
https://help.corsair.com/hc/en-us/articles/360053198052-How-to-Use-a-CORSAIR-keyboard-to-enter-BIOS-mode

Also try "Reset" to return to default setting.
https://help.corsair.com/hc/en-us/articles/360025465031-How-to-Reset-your-keyboard

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #762 on: Thu, 07 October 2021, 02:56:55 »
Hi Hasu,
     I am writing this message using my Corsair K70 RGB with the USB-USB converter plugged in!!!! At the moment I have done nothing but this is a big step forward. I updated the firmware from 3.19 to 3.24 but that made no difference. What I did have to do was manually enter bios mode using https://help.corsair.com/hc/en-us/articles/360053198052-How-to-Use-a-CORSAIR-keyboard-to-enter-BIOS-mode

It suggests two options but my option was a mixture of the two. The options are

Code: [Select]
Entering BIOS mode
If your keyboard has a Windows lock key:

Hold down the Windows lock key and the F1 key at the same time.
Wait 5 seconds.
Release the Windows lock key and the F1 key.
 
If your keyboard does not have a Windows lock key:

Unplug your keyboard.
Hold down the S key and the B key at the same time.
Plug in your keyboard while still holding the S and B keys.
Release the S and B keys.

Well my keyboard has a windows lock and after plugging the keyboard in and hitting Windows lock key and F1 key nothing happened. What I had to do was unplug hold these two keys and replug the keyboard. I guess otherwise I am not quick enough before your little device is trying to enter BIOS mode.

I am a bit reluctant to try the reset option in fear of losing what I have.

As you say not perfect but just another key combination I need to commit to memory.

Could I ask one final question. Is their a location where people have shared how they have programmed their keyboard? Always easier to get ideas rather than reinvent the wheel. I know you were attempting the spacebar layer selector at one point, is that available anywhere? I did look at another topic that mentioned this work but the site that was linked does not exist anymore and I cannot remember where I was on geekhack  :-[.

Many thanks for your speedy responses thus far and I will try not to bother you anymore,
Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #763 on: Thu, 07 October 2021, 07:33:28 »
Quote
Could I ask one final question. Is their a location where people have shared how they have programmed their keyboard? Always easier to get ideas rather than reinvent the wheel. I know you were attempting the spacebar layer selector at one point, is that available anywhere? I did look at another topic that mentioned this work but the site that was linked does not exist anymore and I cannot remember where I was on geekhack  :-[.

I tried to collect ideas and examples of keymap here but almost abandoned. I think people can github the wiki page for the purpose.
https://github.com/tmk/tmk_keyboard/wiki/Keymap-examples

As for layer swtich by spacebar search with word 'SpaceFn' in the first post.


Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #764 on: Thu, 07 October 2021, 17:13:59 »
Thanks Hasu,
     I want to try something a bit unusual out but I am having trouble working out how to get the shifted characters using

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb

For instance !, @, #, $, % etc

When I look at the Code Edit tab for A I see that the Hex code is 0004 which is not what I expected from

https://unicode-table.com/en/

or

https://unicode-table.com/jp/#0041

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #765 on: Thu, 07 October 2021, 18:45:04 »
You can use this to input the charactors.
https://github.com/tmk/tmk_keyboard/wiki/Keymap#212-modified-key

As for Unicode see this, you have to use keymap MACRO. Unicode input depends on your OS and is not suit for keyboard protocol. TMK doesn't support Unicode in efficient way at least.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#2-unicode-input


Traverse these wiki pages for keymap.
https://github.com/tmk/tmk_keyboard/wiki#keymap

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #766 on: Sat, 09 October 2021, 00:08:04 »
Hi Hasu,
    the SpaceFn https://geekhack.org/index.php?topic=51069.0 talks about the idea and then there are a few discussions about the implementation through a number of OS specific scripts and also your more generic implementation. Am I correct in thinking that you have implemented this in https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60 as I can see your keymap_hasu.c ? After installing all the necessary software I have now successfully built this project using

Code: [Select]
make all
and I can see a gh60_lufa.hex

I was going to flash this to my keyboard to try this out. Is this how you would have done it? I feel this is probably a long winded way of getting to this point.

Mark



Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #767 on: Sat, 09 October 2021, 00:13:44 »
Sorry Hasu I missed this crucial piece of information (lots of moving parts to this stuff)

Code: [Select]
$ make KEYMAP=[poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>]

I should have done

Code: [Select]
$ make KEYMAP=[hasu]
I guess my question was more of is gh60 the only place that you have implemented this logic or is there a better project for me to start with?

Mark

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #768 on: Sat, 09 October 2021, 00:35:35 »
Unfortunately after doing a

Code: [Select]
make clean

and then

Code: [Select]
make KEYMAP=hasu
the gh60_lufa.hex is created but when I flash it none of the keys do anything. I think a little knowledge is a dangerous thing and I have attempted something silly.

Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #769 on: Sat, 09 October 2021, 01:16:22 »
GH60 is product name of keyboard PCB, GH60 firmware is not suit for this converter.


You can define SpaceFn layout in Keymap Editor
See this exampel of SpaceFN layout: https://goo.gl/aFmnbY

This link displays Keymap Editor for HHKB Alt Controller by default, but you can
just select "USB-USB Converter" at "Base Firmware File:" to edit for this converter.
277129-0



Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #770 on: Sat, 09 October 2021, 17:11:29 »
Thanks Hasu,
     it's only after you reply that I notice the answer is right in front of my eyes, sorry and thanks for your patience. That layout is a great starter for me. When I asked about shifted characters you suggested I use MACROS. My understanding is they are key recordings defined in code.

An example of defining MACROS in keymap.c is given at https://github.com/tmk/tmk_keyboard/wiki/Keymap#232-examples

Once defined you simply index them from the TMK Keymap Editor Code Editor Tab using ACTION_MACRO and enter the index in Code(hex).

If the MACROS cannot be defined in the editor then is there code for the SpaceFn layout as https://github.com/tmk/tmk_keyboard/wiki/Keymap-examples says TBD.

Maybe they can be defined in the editor, as this hex firmware file is the output of the code? Sorry Hasu I know you are not the sole maintainer of TMK and I have asked too many questions but this is probably my last piece in the puzzle to start me on my keyboard journey and I will address other questions to the broader community.

Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #771 on: Sat, 09 October 2021, 20:09:06 »
I meant that 'modified key' is enough for your need(shifted characters) and you don't have to use MACRO and Unicode probably.
https://github.com/tmk/tmk_keyboard/wiki/Keymap#212-modified-key

MACRO is not supported currently in Keymap Editor and you have to write C code. MACRO is not well documented and not maintained actively, you will have to traverse source codes and wiki pages in github. I don't recommend that unless you are a programmer who have enough time and patience.

Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #772 on: Sun, 10 October 2021, 18:47:44 »
Thanks Hasu,
    I have finally got around to defining my Atreus-like keyboard settings and have been trying it out. It does take a little unlearning but I am reasonably happy so far. I have what looks like a small issue when I toggle back to layer 0 from layer 2 the key action codes from layer 2 appear to be retained and not the action codes from layer 0.

It is described in the PROBLEMS section of https://github.com/mcaple/tmk_keyboard/wiki/Keymap-examples#atreus-like-layout

Any ideas?

As usual many thanks,
Mark

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #773 on: Sun, 10 October 2021, 21:08:25 »
Great. In TMK keymap layer switching means enabling or disabling a layer, not moving one to another layer exactly.
"Toggle" action changes state(on/off) of a layer, you can turn a layer on if its current state is off, and vice versa.

I think what you want there is disabling Layer 2, not enabling Layer 0. (Layer 0 should be always enabled in most cases.)
You will have to T2 on Layer 2,  intead of T0.


I just found that we discussed about keymap topic here for a while, which is not specfic to USB-USB converter :D
Feel free to post in this thread if you have any generic problem or question to TMK firmware.
https://geekhack.org/index.php?topic=41989.0





Offline mcaple

  • Posts: 13
Re: USB to USB keyboard converter
« Reply #774 on: Mon, 11 October 2021, 01:19:28 »
Brilliant Hasu,
      the 'Toggle on Layer 2' tooltip confused me a bit. Maybe 'Toggle Layer2' or 'Toggle on/off Layer2' would have been better.

No more questions to you in this thread unless I find a USB-USB converter problems. Scouts honour.   :thumb:

Mark 

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #775 on: Sat, 23 October 2021, 10:56:24 »
[FIRMWARE UPDATE]
Updated prebuilt firmware on Keymap Editor and github repo.

- Fix for ConnectPro UD-12+ KVM #707
- UHS2: 500ms delay for bus reset for Matrix Vita
  https://geekhack.org/index.php?topic=69169.msg3073431
- UHS2: Improve plugin detection in busprobe()



Horsebadorties,
You can download new firmware from Keymap Editor now.

ConnectPro UD-12+ KVM doesn't support upto 3 endpoints. USB-USB converter had 4-5 endpoints so far but uses only 3 now.
https://github.com/tmk/tmk_keyboard/issues/707

You are correct! The first .hex file indeed replicated the problem. The second file works fine.

Thanks so much. Now I can actually start using the converter!



nug,
Sorry for the late firmware update.
The fix is included in new firmware now.

I've attached 2 logs, one where the converter was already plugged in after flashing, and then the keyboard was connected, and the other where the keyboard was plugged into the converter before plugging the converter into the computer.

I also tested changing the delay, it seems to work with 400ms, but it failed on 100/200/300ms.

Offline apastuszak

  • Posts: 44
Re: TMK USB to USB keyboard converter
« Reply #776 on: Fri, 05 November 2021, 11:05:58 »
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?

Offline haydoselefantes

  • Posts: 65
  • Location: Los Angeles
Re: TMK USB to USB keyboard converter
« Reply #777 on: Fri, 05 November 2021, 16:00:02 »
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?

Works fine with my Ugreen USB 3.0 switcher between my PC and Mac.

Offline apastuszak

  • Posts: 44
Re: TMK USB to USB keyboard converter
« Reply #778 on: Fri, 05 November 2021, 16:01:25 »
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?

Works fine with my Ugreen USB 3.0 switcher between my PC and Mac.

That's the exact switch I have.  I guess it's time to place an order.

Offline apastuszak

  • Posts: 44
Re: TMK USB to USB keyboard converter
« Reply #779 on: Thu, 11 November 2021, 20:32:14 »
And another question. Can we remap modifier keys?

I have a Matias Tactile Pro and I'd like to remap this little fn key to an insert key.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #780 on: Thu, 11 November 2021, 21:56:11 »
Usual modifier keys can be remapped.
But you can't remap Fn key, becase Fn key doesn't send any code to computer or converter in most cases.


And another question. Can we remap modifier keys?

I have a Matias Tactile Pro and I'd like to remap this little fn key to an insert key.


Offline dxlr8r

  • Posts: 14
Re: TMK USB to USB keyboard converter
« Reply #781 on: Sun, 14 November 2021, 15:50:55 »
Are there any plans to implement more dual role functions? For example, I would love double tap and press and hold for turning a key into some other key. For example double tap, within a short amount of time, A-Å for example. Now it only to work with modifier and layers, not regular characters.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #782 on: Tue, 16 November 2021, 21:21:59 »
I don't have plan for adding exact action like that because the action cannot be supported in Keymap Editor probably.

but I want the firmware to allow you to implement the custom action.
It would be better to have good documentation about how to write custom action. Poeple have various needs and you can't expect all of them.

I started documenting here again today :D and will update when I have time.
https://github.com/tmk/tmk_keyboard/wiki/Keymap:-Custom-Key-Action#function-action

You can post in general TMK firmware thread if you need help.
https://geekhack.org/index.php?topic=41989.0


Are there any plans to implement more dual role functions? For example, I would love double tap and press and hold for turning a key into some other key. For example double tap, within a short amount of time, A-Å for example. Now it only to work with modifier and layers, not regular characters.


Offline daniel123

  • Posts: 9
F23 with Modifiers no replug issue
« Reply #783 on: Wed, 08 December 2021, 16:19:45 »
Hi Hasu,

I use two of your converters since last year and my life has literally changed  :thumb: Thanks a lot!

Anyways, I'm having an issue ever since I started using my second keyboard and I hope you can change my life a little further now :D

I followed the conversation between you and Zucca (somewhere here:  https://geekhack.org/index.php?topic=69169.450) and downloaded the hex files Zucca provided for the F24, F23, and F22 (here: https://geekhack.org/index.php?topic=69169.msg2781175#msg2781175).

The hex-keymap works fine and comes without this nasty re-plug issue.

BUT... it doesn't allow for the use of modifiers. And that has only recently become a real issue to me as I have more and more automated workflows I'd like to use.

Taran, made me aware of your USB-2-USB-converter in his YouTube video here:


He also has a Github page (https://github.com/TaranVH/2nd-keyboard/tree/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers) on which he provides the code of Zucca WITH the modifiers enabled.

He writes, however, that it is untested and he also does not provide a hex file but only the raw code. If I use this and try creating a hex file myself, I run into the error attached to this message.

Can you guide me on how to bring together both, no-replug issue plus modifiers? That would be super awesome <3

Thanks a lot
Daniel
« Last Edit: Wed, 08 December 2021, 16:22:59 by daniel123 »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #784 on: Thu, 09 December 2021, 01:56:19 »
 daniel123,
I don't know about how to build QMK and hope someone can help.


But confirmed the keymap can be built with TMK firmware like below.

1. Download this keymap file and save it as 'unimap_TaranVH.c' under converter/usb_usb/ directory.
https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers/keymap.c

2. Run make command.
Quote
$ make -f Makefile.unimap KEYMAP=TaranVH clean
$ make -f Makefile.unimap KEYMAP=TaranVH

Attached its hex file.
* usb_usb_unimap_TaranVH.hex (74.21 kB - downloaded 76 times.)

Offline daniel123

  • Posts: 9
Re: TMK USB to USB keyboard converter
« Reply #785 on: Thu, 09 December 2021, 16:05:07 »
Hi Hasu,

Thanks a lot for your quick reply but unfortunately I'm just pretty stupid and have no idea :D

When I use your hex-file, there are some issues with my keyboard e.g., CAPSLOCK, WIN, PRINT, etc.

I also tried downloading TMK after all and was trying to make a hex file myself. But I struggle a lot and give up for now. It looks very similar to QMK but somehow I can't get it to run. I also looked for some proper instructions on how to do this but couldn't really find a step-by-step instruction (which I need with my skills). Do you know any page or YouTube video that is describing how to do this?

Thanks man


Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #786 on: Thu, 09 December 2021, 18:04:58 »
When I use your hex-file, there are some issues with my keyboard e.g., CAPSLOCK, WIN, PRINT, etc.
Note that those keys are remapped to unusual keys(F20, LANG1, ???), they won't be useful without TaranVH's AHK scripts.


Quote
I also tried downloading TMK after all and was trying to make a hex file myself. But I struggle a lot and give up for now. It looks very similar to QMK but somehow I can't get it to run. I also looked for some proper instructions on how to do this but couldn't really find a step-by-step instruction (which I need with my skills). Do you know any page or YouTube video that is describing how to do this?

There is firmware build instruction on github wiki, check it first.
https://github.com/tmk/tmk_keyboard/wiki#build-firmware

Offline daniel123

  • Posts: 9
Re: TMK USB to USB keyboard converter
« Reply #787 on: Sat, 11 December 2021, 05:22:17 »
Hi Hasu,

I am actually using Taran's AHK script but still the modifiers were not working as expected. But ok, I'm going the tough way then, I guess/hope :P :D

One question before I jump into the rabbit hole. Are you aware of any way that would allow me to read a hex file that I have flashed onto an USB-2-USB-converter of yours? Because I have a fully functioning hex-file on my main keyboard with all modifiers enabled and no replug issue or any other issues but I can't seem to find the hex file and/or the original keymaps somewhere on my hard drive. I don't want to screw up anything so I'd like to backup my current setting. Any chance I can dump that already flashed hex-file onto a file on my hard drive?

Thanks for your time and guidance, really appreciate it man :)
Daniel

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: TMK USB to USB keyboard converter
« Reply #788 on: Sat, 11 December 2021, 06:53:20 »
What are you using to flash the chip daniel?  Looking at the documentation it suggests you use dfu-programmer, if you do take whatever command you use to flash a hex change 'flash' to 'read' and it should output to the filename rather than flashing it.  Be sure not to overwrite anything!

Or not (see below)
« Last Edit: Sun, 12 December 2021, 02:29:29 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #789 on: Sat, 11 December 2021, 20:45:15 »
One question before I jump into the rabbit hole. Are you aware of any way that would allow me to read a hex file that I have flashed onto an USB-2-USB-converter of yours?

Unfotunately you can't.



What are you using to flash the chip daniel?  Looking at the documentation it suggests you use dfu-programmer, if you do take whatever command you use to flash a hex change 'flash' to 'read' and it should output to the filename rather than flashing it.  Be sure not to overwrite anything!

Default factory setting of ATMega32U4 doesn't support "read" as far as I know.
And my converter uses the default setting and stock bootloader as it is, it doesn't support "read" feature unfortunately.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: TMK USB to USB keyboard converter
« Reply #790 on: Sun, 12 December 2021, 02:29:06 »
Default factory setting of ATMega32U4 doesn't support "read" as far as I know.
And my converter uses the default setting and stock bootloader as it is, it doesn't support "read" feature unfortunately.
Sorry for spreading misinformation - I'll have to remember this :(
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline daniel123

  • Posts: 9
Re: TMK USB to USB keyboard converter
« Reply #791 on: Sun, 12 December 2021, 14:43:26 »
Thanks guys, then no backup it is :P :D

If I succeed I'll come back here and share what I've found... most probably I get back even earlier with stupid questions :D

Offline daniel123

  • Posts: 9
Re: TMK USB to USB keyboard converter
« Reply #792 on: Sun, 19 December 2021, 15:22:43 »
Ok, in the past days I did a few things and documented what I did. I'm happy to let you know that I've found the source of my keyboard issue. Super long story very short: it was an USB extension cable  :D

For everyone experiencing similar issues or interest in what I did, here is what I did ;)

I installed TMK via my Ubuntu which is running on Win10
I took the code from Taran's Git and adjusted it for my F23 keymap (from here: https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers/keymap.c)
-> I attached my F22, F23 and F24 hex files in case anyone is interested in the modifier hex files that run with Taran's AHK script. I didn't test the F22 and F24 hex though, but they follow the same principle, see the *.c files.
I built my own hex files thanks to the documentation that Hasu was referring me to via TMK on Ubuntu - thanks for the tip, Hasu :)  (see: https://github.com/tmk/tmk_keyboard/wiki#build-firmware)
I flashed my USB-converter using QMK Toolbox

Result: All keys, including the modifiers, could be used.

So I started testing. I re-started my PC, put it to sleep, woke it up, turned it off and turned it back on a few times to figure out two things:
1) The keyboard stays "online" as long as I don't turn off the PC. So I can re-start and put it to sleep without any issues. Once I turn it off, however, I have to replug the keyboard after turning it back on (see attachment with test results).
2) I do not have any of those nasty replug issues Zucca was describing i.e., I do not have to replug my keyboard multiple times until it works or anything like this described here: https://geekhack.org/index.php?topic=69169.msg2738586#msg2738586. I only had to replug the keyboard once and then it worked again - always.

I then ran the same tests using Zucca's hex files (see https://geekhack.org/index.php?topic=69169.msg2781175#msg2781175).

Result 1: All keys could be used, EXcluding the modifiers.
Resutl 2: The replug issue was exactly as described above i.e., only after turning off the PC the keyboard would go "offline" and only after repluging it once it would come "online" again.

I decided to read the entire communication between Hasu and Zucca to figure out whether I'm missing something.
There I found that you guys were talking about the energy savings options and that this was the root cause for the replug issues (see https://geekhack.org/index.php?topic=69169.msg2740179#msg2740179).

I went to the Windows device manager and switched off all USB energy savings options I could find for the HID devices and also enabled that all USB devices could wake the PC from sleeping.

Result: No effect at all i.e., the keyboard would still need to be replugged after turning the PC off and on again.

Around that time I started questioning each single detail and recognised that the keyboard was plugged into the USB converter, and the USB converter was plugged into a 5m USB extension cable (a USB-female to USB-male cable, because my PC is "around the corner"), and my 5m USB extension cable was plugged into the PC.
So I ran a few tests without that 5m long USB extension cable by plugging in my keyboard directly to the PC. I switched it off and on and everything and then - it just worked - each time! :)

Then I recognized how stupid I was.
I remembered that my second keyboard never had the replug issue at all, however, the modifiers didn't work. When I decided to do something about the modifier issue, I changed the setup of my 2nd keyboard.

The whole time it was plugged into a USB hub. This USB hub was connected to the PC via a 5m long USB cable (no extension cable but rather a regular USB-male to USB-male 5m long cable)
My first keyboard, by the way, is using the same USB hub and experiences no replug issues ever, I recognized... but yeah, quite late... so yeah, quite stupid :D

However, my USB hub is in a very unhandy location for some (h)experiments so I decided using my 5m USB extension cable. And that was causing my replug problems when actually everything was performing correctly.

Once I bypassed the 5m USB extension cable but plugged the USB converter directly into the USB hub, I had no replug problems or whatsoever anymore. Plus, all modifiers are working now as desired <3

I'm happy now, thanks for your support Hasu :)

PS. I messaged Taran via Twitter, maybe he includes the correct hex files in his Git repository.



Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #793 on: Mon, 20 December 2021, 01:54:51 »
Around that time I started questioning each single detail and recognised that the keyboard was plugged into the USB converter, and the USB converter was plugged into a 5m USB extension cable (a USB-female to USB-male cable, because my PC is "around the corner"), and my 5m USB extension cable was plugged into the PC.
So I ran a few tests without that 5m long USB extension cable by plugging in my keyboard directly to the PC. I switched it off and on and everything and then - it just worked - each time! :)

Then I recognized how stupid I was.
I remembered that my second keyboard never had the replug issue at all, however, the modifiers didn't work. When I decided to do something about the modifier issue, I changed the setup of my 2nd keyboard.

The whole time it was plugged into a USB hub. This USB hub was connected to the PC via a 5m long USB cable (no extension cable but rather a regular USB-male to USB-male 5m long cable)
My first keyboard, by the way, is using the same USB hub and experiences no replug issues ever, I recognized... but yeah, quite late... so yeah, quite stupid :D

However, my USB hub is in a very unhandy location for some (h)experiments so I decided using my 5m USB extension cable. And that was causing my replug problems when actually everything was performing correctly.

Once I bypassed the 5m USB extension cable but plugged the USB converter directly into the USB hub, I had no replug problems or whatsoever anymore. Plus, all modifiers are working now as desired <3

Nice find and thank you for the detailed tests. Interesting.

Was the USB hub is "externally powered", or "bus powered"?

Voltage of power line drops depending on length and quality of USB cable, I guess serious voltage drop causes the problem especially when computer is turned on, or pulg-in. The hub mitigates voltage drop probably.

Offline daniel123

  • Posts: 9
Re: TMK USB to USB keyboard converter
« Reply #794 on: Mon, 20 December 2021, 15:49:47 »
I just checked, it's using an external power supply ;)

And it works like a charm :)

Offline glennm

  • Posts: 1
Re: TMK USB to USB keyboard converter
« Reply #795 on: Thu, 30 December 2021, 08:09:04 »
Hi Hasu,

I bought 3 of the USB converters from you about a year ago and want to thank you again for the great service.

I'm finally getting around to working with these, and it looks like I should do a firmware update.

I've downloaded from Github before, but I'm really don't understand which zip I should download and how to update the firmware.   Any chance you could step me through the process or refer me to a link(s)?

A great New Year to you!

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: TMK USB to USB keyboard converter
« Reply #796 on: Thu, 30 December 2021, 08:53:23 »
I really don't understand which zip I should download and how to update the firmware.   Any chance you could step me through the process or refer me to a link(s)?
The info is in the first post, as long as you don't want to do complicated things with macros you can change your keymap using the online editor to make the hex file and flash it using these instructions :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline macintosh

  • Posts: 1
Re: TMK USB to USB keyboard converter
« Reply #797 on: Mon, 03 January 2022, 03:29:32 »
Not sure if I should post this issue here or not. Please let me know if this is not the right thread.
I tried building the converter using pro micro 3.3v and mini usb shield 2.0. Works great except that it doesn't work with my usb numpad.

Keyboard Model:
https://www.lazada.com.my/products/19-keys-multimedia-digital-keypad-numpad-ultra-slim-wired-keyboard-usb-wired-numeric-keyboard-i1843506352.html
Sorry, I've tried looking for the official product page but I couldn't  find it. There is also no model number on the numpad (I can take apart the unit to see the PCB if needed).

OS:
Windows

hid_listen output:
I've tried building the usb desc dumper and using hid listen but it couldn't even get to the stage where it could dump the description. I can only see the following:

Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
nak_limit:7FFF
crSU:0D
Configuring:0D
usb_state: A0



Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK USB to USB keyboard converter
« Reply #798 on: Mon, 03 January 2022, 04:08:44 »
It fails to get Device descriptor for some reason.

Check around these lines and try adding debug prints with TRACE* macro to narrow down the problem.
My wild guess is that this is timing issue, adding delay() somewhere may help.

https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L160
https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L745
https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L566
« Last Edit: Mon, 03 January 2022, 06:06:27 by hasu »

Offline salvanipour

  • Posts: 25
Re: TMK USB to USB keyboard converter
« Reply #799 on: Fri, 07 January 2022, 11:57:34 »
Hi All,

I recently got a USB-to-USB converter for my Realforce 87u, with the intention of remapping a few keys to better work with MacOS. Everything works great with one exception: swapping of capslock and left control.

My keyboard has jumpers that are already set to flip left control and capslock, which is great, however after programming the USB-to-USB converter it keeps interpreting capslock as capslock and left control as left control. I have tried both QMK and TMK with their respective online mappers, using QMK Toolbox to program the controller itself. I am not sure if there is an issue with using QMK Toolbox to deploy TMK firmware or if I need to clear the EEPROM of the QMK firmware prior to flashing the TMK firmware. Any help would be greatly appreciated.