benblazak / ergodox-firmware

firmware for the ergoDOX keyboard
Other
595 stars 296 forks source link

Ergodox is not registered as keyboard (on Linux) after loading firmware. Halfkay does work however. #52

Closed rzetterberg closed 10 years ago

rzetterberg commented 10 years ago

Hello!

I have followed the steps in the docs to load the firmware to my Ergodox. The problem is that the keyboard does not show up as a registered usb device, which also means that nothing happens when I press any buttons.

I expect to see something like this in /var/log/kern.log:

Oct  3 19:47:45 shinji kernel: [10114.648568] usb 8-2: new full-speed USB device number 42 using uhci_hcd
Oct  3 19:47:45 shinji kernel: [10114.833354] usb 8-2: New USB device found, idVendor=046d, idProduct=c52b
Oct  3 19:47:45 shinji kernel: [10114.833361] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct  3 19:47:45 shinji kernel: [10114.833364] usb 8-2: Product: USB Receiver
Oct  3 19:47:45 shinji kernel: [10114.833368] usb 8-2: Manufacturer: Logitech
Oct  3 19:47:45 shinji kernel: [10114.849787] logitech-djreceiver 0003:046D:C52B.0034: hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.2-2/input2

But nothing shows up.

However, when I press the reset button the Teensy to activate Halfkay the device shows up as expected:

Oct  3 19:58:10 shinji kernel: [10740.252579] usb 8-2: new full-speed USB device number 55 using uhci_hcd
Oct  3 19:58:11 shinji kernel: [10740.403434] usb 8-2: New USB device found, idVendor=16c0, idProduct=0478
Oct  3 19:58:11 shinji kernel: [10740.403440] usb 8-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Oct  3 19:58:11 shinji kernel: [10740.407815] hid-generic 0003:16C0:0478.0048: hidraw4: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:00:1d.2-2/input0

Any advice on what my next steps would be to solve this problem? I figured this would be software related to the Teensy since the keyboard doesn't even show up as a registered device.

Many thanks in advance!

Edit:

I forgot to mention that a simple blink demo works as expected and non of the problems in the PJRC Troubleshooting guide applies to this problem.

I have tried the firmware from the v1 release, I have tried firmware downloaded from Massdrops confiugrator and I have tried the firmware built from master.

benblazak commented 10 years ago

Thanks for the details :) . Unfortunately, it's probably something to do with you system, as I've heard of my firmware working on Ubuntu, at least, as well as Windows and OS X; and if the blink demo works, and you're able to flash it over USB, the Teensy probably isn't to blame. The only thing I can really suggest is that you try a firmware built from the partial-rewrite branch as well (which should be stable, but I don't promise not to change things in the future). If that doesn't work, you might try cub-uanic's port of hasu's tmk firmware here (announced on geekhack here; never personally tried it, but I've heard it works quite well). I think Hasu's can also be configured to use a different USB stack (my firmware still uses very lightly modified PJRC code for that), which might be worth trying. Hope you get it working!

rzetterberg commented 10 years ago

Thanks for the advice!

I did some more troubleshooting yesterday. To try to narrow down the problem I loaded this simple program with Teensyduino to check that serial communication worked:

void setup()   {                
  Serial.begin(38400);
}

void loop()                     
{
  Serial.println("Hello World");
  delay(1000);
}

It turns out that this prints random data to the serial monitor on my computer ONCE. Here is an example of that data:

�#9<
HZ

So I guess the problem lies with the Teensy itself or my soldering and not the firmware at all.

I posted a forum thread at PJRC to see whether they can help me (http://forum.pjrc.com/threads/26755-Teensy-2-outputs-random-data-to-Teensyduino-Serial-Monitor-when-quot-Hello-World-quot-is-sent).

I'll guess I have to recheck my solders and if I don't find anything I'll just order a new Teensy and try with that.

Thanks again

benblazak commented 10 years ago

Hmm, interesting. Thanks for posting back. Good luck!

rzetterberg commented 9 years ago

I have an update on my issue. The reason I was getting random data was because I had misconfigured the Teensyduino.

Now serial communication works as expected!

I moved on to check if just usb communication works without the Ergodox functionality. I used a precompiled hex from PJRC (https://www.pjrc.com/teensy/hid_listen.html) that uses usb_debug_putchar to send test data to the computer and a program that listens for hid data.

The device shows up in /var/log/kern.info when using this test program:

Oct 11 12:45:58 shinji kernel: [10902.457876] usb 6-2: new full-speed USB device number 23 using uhci_hcd
Oct 11 12:45:58 shinji kernel: [10902.631908] usb 6-2: New USB device found, idVendor=16c0, idProduct=0479
Oct 11 12:45:58 shinji kernel: [10902.631914] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 11 12:45:58 shinji kernel: [10902.631918] usb 6-2: Product: Your USB Device
Oct 11 12:45:58 shinji kernel: [10902.631922] usb 6-2: Manufacturer: Your Name
Oct 11 12:45:58 shinji kernel: [10902.637125] hid-generic 0003:16C0:0479.0018: hidraw4: USB HID v1.11 Device [Your Name Your USB Device] on usb-0000:00:1d.2-2/input0

And I recieve data from the device:

zed@shinji:~/build/hid_listen$ ./hid_listen 
Waiting for device:
Listening:
 dah dahChar S: dit dit dit
Char O: dah dah dah
Char S: dit dit dit

Char S: dit dit dit
Char O: dah dah dah
Char S: dit dit dit

I must have missed something when soldering, but I can't seem to figure out what. Are there any steps that are performed before registering the usb device that can fail due to hardware?

rzetterberg commented 9 years ago

IT'S WORKING!

I reflowed all solders and now it works! :D

Thanks for the help and the firmware!

benblazak commented 9 years ago

Glad you got it working!

spamik commented 9 years ago

It's quite interesting that I see this behaviour on my ergodox too. Twice or even more key press and after resoldering switch (not replacing them) it starts working. Interesting is that I have two ergodox keyboards and I can see this only on one with MX Clear switches (some switches I resoldered even more than once) - other with blue is working still fine. And both was soldered with same equipment :) Maybe harder switches push more force on PCB or something like that...

grahamc commented 9 years ago

The switches are plate-mounted. Soldering can be tricky, and it requires practice to get it right. Key matrices are more complicated than your average circuitry, too. Little mistakes can have further reaching consequences. I wouldn't be ready to blame the hardness of the key :)

spamik commented 9 years ago

Yeah, I haven't much experiencis with soldering but on the other hand I completed both keyboards and this problem has only one :) Just thought that bigger physical power on switch can probably badly soldered switch break sooner. For whatever reason this is happening, true is that resoldering switch mostly resolve issue with multiple presses :)