andywarduk / BBCKeyboard

Arduino code to drive an Acorn BBC micro keyboard
1 stars 1 forks source link

Impossible to use! At least for me! #1

Open kattan1969 opened 8 years ago

kattan1969 commented 8 years ago

Well, may be I'm no Linux expert but I've been working with computers since 1986! I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I wanted to turn into a USB keyboard. I was thrilled to find that someone has finally offered a reasonable solution by using Arduino. So I prepared everything and purchased all the required parts. Original Arduino Micro, the board was soldered and double checked and Arduino IDE is up & running. Unfortunately, I was NEVER able to make it work! I'm using MS Windows 7 ( and YES, I did try Linux too!)

Here is what I did:

  1. I tried to upload the .hex using various methods, avrdude and other tools. I ended up with unrecognizable USB device. Did I mention that I spent days on this!
  2. I tried to figure out HOW to compile the source myself. Apparently, there are some libraries to be patched (the .diff file). I was never able to figure out which version to patch (which Arduino release). The patches indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm using Arduino 1.6.7).

I spent hours and hours on this but it seems that I failed. OK, may be I'm a lame person!

I would be grateful if Andy (the original author of this code) could help me in this.

Regards, A. Kattan

andywarduk commented 8 years ago

Hi

It's been a while since I touched this project but I'll give it a go...

As far as I remember the only thing you really have to do for an arduino micro is upload the sketch (BBCKeyboard.ino) using the arduino gui. The .hex files are bootloaders for the arduino uno and are used to flip the uno usb port between serial and usb modes. There are 2 scripts (LoadUnoKdb.sh and LoadUnoSerial.sh) which do this. The patch file patches hardware/arduino/avr/cores/arduino/HID.cpp which on mac OS is bundled with the gui under /Applications/Arduino.app/Contents/Java.

HTH

Andy Ward

On 6 March 2016 at 20:47, kattan1969 notifications@github.com wrote:

Well, may be I'm no Linux expert but I've been working with computers since 1986! I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I wanted to turn into a USB keyboard. I was thrilled to find that someone has finally offered a reasonable solution by using Arduino. So I prepared everything and purchased all the required parts. Original Arduino Micro, the board was soldered and double checked and Arduino IDE is up & running. Unfortunately, I was NEVER able to make it work! Here is what I did:

  1. I tried to upload the .hex using various methods, avrdude and other tools. I ended up with unrecognizable USB device. Did I mention that I spent days on this!
  2. I tried to figure out HOW to compile the source myself. Apparently, there are some libraries to be patched (the .diff file). I was never able to figure out which version to patch (which Arduino release). The patches indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm using Arduino 1.6.7).

I spent hours and hours on this but it seems that I failed. OK, may be I'm a lame person!

I would be grateful if Andy (the original author of this code) could help me in this.

Regards, A. Kattan

— Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1.

kattan1969 commented 8 years ago

Dear Andy,

I’m very much grateful for your kind and quick response. I have a Mac and I will try to follow up with your suggestions and let you know. I hope you don’t mind if I get back to you again.

Thanks A. Kattan

On 8Mar, 2016, at 1:13 AM, andywarduk notifications@github.com wrote:

Hi

It's been a while since I touched this project but I'll give it a go...

As far as I remember the only thing you really have to do for an arduino micro is upload the sketch (BBCKeyboard.ino) using the arduino gui. The .hex files are bootloaders for the arduino uno and are used to flip the uno usb port between serial and usb modes. There are 2 scripts (LoadUnoKdb.sh and LoadUnoSerial.sh) which do this. The patch file patches hardware/arduino/avr/cores/arduino/HID.cpp which on mac OS is bundled with the gui under /Applications/Arduino.app/Contents/Java.

HTH

Andy Ward

On 6 March 2016 at 20:47, kattan1969 notifications@github.com wrote:

Well, may be I'm no Linux expert but I've been working with computers since 1986! I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I wanted to turn into a USB keyboard. I was thrilled to find that someone has finally offered a reasonable solution by using Arduino. So I prepared everything and purchased all the required parts. Original Arduino Micro, the board was soldered and double checked and Arduino IDE is up & running. Unfortunately, I was NEVER able to make it work! Here is what I did:

  1. I tried to upload the .hex using various methods, avrdude and other tools. I ended up with unrecognizable USB device. Did I mention that I spent days on this!
  2. I tried to figure out HOW to compile the source myself. Apparently, there are some libraries to be patched (the .diff file). I was never able to figure out which version to patch (which Arduino release). The patches indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm using Arduino 1.6.7).

I spent hours and hours on this but it seems that I failed. OK, may be I'm a lame person!

I would be grateful if Andy (the original author of this code) could help me in this.

Regards, A. Kattan

— Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1.

— Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193479377.

kattan1969 commented 8 years ago

Dear Andy,

I really appreciate your kind efforts.

Basically, the problem is that I have to apply the patches before compiling the BBCKeyboard.ino file. Trying to compile without patching will cause the compiling error below, which I understand.

BBCKeyboard.ino: In function 'void loop()': BBCKeyboard:261: error: 'class Keyboard' has no member named 'getLedStatus' 'class Keyboard' has no member named 'getLedStatus'

I had issues applying the patch file (.diff) directly. So I extracted the two HID.cpp and the USBAPI.h files from the Arduino package (on my Mac) and I separated your “usb_key_leds.diff” file into two patches; one for HID.cpp (patch1.diff) and the other for USBAPI.h (patch2.diff).

This is what I get in my terminal:

$ patch HID.cpp patch1.diff patching file HID.cpp Hunk #1 succeeded at 91 (offset -2 lines). Hunk #2 succeeded at 202 (offset -2 lines). Hunk #3 FAILED at 536. 1 out of 3 hunks FAILED — saving rejects to file HID.cpp.rej

$ patch USBAPI.h patch2.diff patching file USBAPI.h Hunk #1 succeeded at 164 (offset 52 lines). Hunk #2 succeeded at 184 (offset 52 lines). Hunk #3 succeeded at 193 (offset 52 lines).

I have included the HID.cpp.rej file along with this email. I would be grateful for some help to diagnose the issue:

Regards,

AK

On 8Mar, 2016, at 1:13 AM, andywarduk notifications@github.com wrote:

Hi

It's been a while since I touched this project but I'll give it a go...

As far as I remember the only thing you really have to do for an arduino micro is upload the sketch (BBCKeyboard.ino) using the arduino gui. The .hex files are bootloaders for the arduino uno and are used to flip the uno usb port between serial and usb modes. There are 2 scripts (LoadUnoKdb.sh and LoadUnoSerial.sh) which do this. The patch file patches hardware/arduino/avr/cores/arduino/HID.cpp which on mac OS is bundled with the gui under /Applications/Arduino.app/Contents/Java.

HTH

Andy Ward

On 6 March 2016 at 20:47, kattan1969 notifications@github.com wrote:

Well, may be I'm no Linux expert but I've been working with computers since 1986! I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I wanted to turn into a USB keyboard. I was thrilled to find that someone has finally offered a reasonable solution by using Arduino. So I prepared everything and purchased all the required parts. Original Arduino Micro, the board was soldered and double checked and Arduino IDE is up & running. Unfortunately, I was NEVER able to make it work! Here is what I did:

  1. I tried to upload the .hex using various methods, avrdude and other tools. I ended up with unrecognizable USB device. Did I mention that I spent days on this!
  2. I tried to figure out HOW to compile the source myself. Apparently, there are some libraries to be patched (the .diff file). I was never able to figure out which version to patch (which Arduino release). The patches indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm using Arduino 1.6.7).

I spent hours and hours on this but it seems that I failed. OK, may be I'm a lame person!

I would be grateful if Andy (the original author of this code) could help me in this.

Regards, A. Kattan

— Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1.

— Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193479377.

andywarduk commented 8 years ago

I had chance to have a proper look today...

The patch doesn't work on the latest version of the gui (1.6.7) or the one previously (1.6.6). 1.6.5 was a bit of a pain but I did manage to create a patch for it fairly easily from the original. I have committed it to the github repository (and also cleaned it up a bit).

If you download and install version 1.6.5 it should work fine. These are the steps I took:

<install gui version 1.6.5>

$ cd /Applications/Arduino/Contents/Java/ $ patch -p 1 < ~/Downloads/usb_key_leds_1.6.5.diff patching file hardware/arduino/avr/cores/arduino/HID.cpp patching file hardware/arduino/avr/cores/arduino/USBAPI.h $ I'll see if I can get a patch together for >= 1.6.6 at some point if I get time. good luck :) Andy On 8 March 2016 at 06:07, kattan1969 notifications@github.com wrote: > Dear Andy, > > I’m very much grateful for your kind and quick response. I have a Mac and > I will try to follow up with your suggestions and let you know. > I hope you don’t mind if I get back to you again. > > Thanks > A. Kattan > > > On 8Mar, 2016, at 1:13 AM, andywarduk notifications@github.com wrote: > > > > Hi > > > > It's been a while since I touched this project but I'll give it a go... > > > > As far as I remember the only thing you really have to do for an arduino > > micro is upload the sketch (BBCKeyboard.ino) using the arduino gui. > > The .hex files are bootloaders for the arduino uno and are used to flip > > the > > uno usb port between serial and usb modes. There are 2 scripts > > (LoadUnoKdb.sh and LoadUnoSerial.sh) which do this. > > The patch file patches hardware/arduino/avr/cores/arduino/HID.cpp which > > on > > mac OS is bundled with the gui under > > /Applications/Arduino.app/Contents/Java. > > > > HTH > > > > Andy Ward > > > > On 6 March 2016 at 20:47, kattan1969 notifications@github.com wrote: > > > > > Well, may be I'm no Linux expert but I've been working with computers > > > since 1986! > > > I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I > > > wanted > > > to turn into a USB keyboard. I was thrilled to find that someone has > > > finally offered a reasonable solution by using Arduino. So I prepared > > > everything and purchased all the required parts. Original Arduino > > > Micro, > > > the board was soldered and double checked and Arduino IDE is up & > > > running. > > > Unfortunately, I was NEVER able to make it work! Here is what I did: > > > 1. I tried to upload the .hex using various methods, avrdude and other > > > tools. I ended up with unrecognizable USB device. Did I mention that I > > > spent days on this! > > > 2. I tried to figure out HOW to compile the source myself. Apparently, > > > there are some libraries to be patched (the .diff file). I was never > > > able > > > to figure out which version to patch (which Arduino release). The > > > patches > > > indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm > > > using > > > Arduino 1.6.7). > > > > > > I spent hours and hours on this but it seems that I failed. OK, may be > > > I'm > > > a lame person! > > > > > > I would be grateful if Andy (the original author of this code) could > > > help > > > me in this. > > > > > > Regards, > > > A. Kattan > > > > > > — > > > Reply to this email directly or view it on GitHub > > > https://github.com/andywarduk/BBCKeyboard/issues/1. > > > > > > — > > > Reply to this email directly or view it on GitHub < > > > https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193479377 > > > . > > — > Reply to this email directly or view it on GitHub > https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193621189 > .
kattan1969 commented 8 years ago

Dear Andy,

It works! Thanks.

However, the LEDs and the CAPS LOCK are not working! I double checked the LEDs and made sure that they work on the original BBC board. For the CAPS LOCK or SHIFT LOCK the Micro on-board LEDS flashes when I press any of these keys indicating they are responding.

If you have the time, please do check the above or may be recommend something I should do or try?

Regards,

AK

On 8Mar, 2016, at 8:20 PM, andywarduk notifications@github.com wrote:

I had chance to have a proper look today...

The patch doesn't work on the latest version of the gui (1.6.7) or the one previously (1.6.6). 1.6.5 was a bit of a pain but I did manage to create a patch for it fairly easily from the original. I have committed it to the github repository (and also cleaned it up a bit).

If you download and install version 1.6.5 it should work fine. These are the steps I took:

<install gui version 1.6.5>

$ cd /Applications/Arduino/Contents/Java/ $ patch -p 1 < ~/Downloads/usb_key_leds_1.6.5.diff patching file hardware/arduino/avr/cores/arduino/HID.cpp patching file hardware/arduino/avr/cores/arduino/USBAPI.h $ I'll see if I can get a patch together for >= 1.6.6 at some point if I get time. good luck :) Andy On 8 March 2016 at 06:07, kattan1969 notifications@github.com wrote: > Dear Andy, > > I’m very much grateful for your kind and quick response. I have a Mac and > I will try to follow up with your suggestions and let you know. > I hope you don’t mind if I get back to you again. > > Thanks > A. Kattan > > > On 8Mar, 2016, at 1:13 AM, andywarduk notifications@github.com wrote: > > > > Hi > > > > It's been a while since I touched this project but I'll give it a go... > > > > As far as I remember the only thing you really have to do for an arduino > > micro is upload the sketch (BBCKeyboard.ino) using the arduino gui. > > The .hex files are bootloaders for the arduino uno and are used to flip > > the > > uno usb port between serial and usb modes. There are 2 scripts > > (LoadUnoKdb.sh and LoadUnoSerial.sh) which do this. > > The patch file patches hardware/arduino/avr/cores/arduino/HID.cpp which > > on > > mac OS is bundled with the gui under > > /Applications/Arduino.app/Contents/Java. > > > > HTH > > > > Andy Ward > > > > On 6 March 2016 at 20:47, kattan1969 notifications@github.com wrote: > > > > > Well, may be I'm no Linux expert but I've been working with computers > > > since 1986! > > > I'm a retrocomputing enthusiast. I have my beloved BBC Micro that I > > > wanted > > > to turn into a USB keyboard. I was thrilled to find that someone has > > > finally offered a reasonable solution by using Arduino. So I prepared > > > everything and purchased all the required parts. Original Arduino > > > Micro, > > > the board was soldered and double checked and Arduino IDE is up & > > > running. > > > Unfortunately, I was NEVER able to make it work! Here is what I did: > > > 1. I tried to upload the .hex using various methods, avrdude and other > > > tools. I ended up with unrecognizable USB device. Did I mention that I > > > spent days on this! > > > 2. I tried to figure out HOW to compile the source myself. Apparently, > > > there are some libraries to be patched (the .diff file). I was never > > > able > > > to figure out which version to patch (which Arduino release). The > > > patches > > > indicates it's the HID.cpp but actually it's the Keyboard.cpp (I'm > > > using > > > Arduino 1.6.7). > > > > > > I spent hours and hours on this but it seems that I failed. OK, may be > > > I'm > > > a lame person! > > > > > > I would be grateful if Andy (the original author of this code) could > > > help > > > me in this. > > > > > > Regards, > > > A. Kattan > > > > > > — > > > Reply to this email directly or view it on GitHub > > > https://github.com/andywarduk/BBCKeyboard/issues/1. > > > > > > — > > > Reply to this email directly or view it on GitHub < > > > https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193479377 > > > . > > — > Reply to this email directly or view it on GitHub > https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193621189 > . > > — > Reply to this email directly or view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-193876287.
JerwuQu commented 8 years ago

Hey! Sorry to be a grave digger but did you ever get a patch working for >= 1.6.6?

EDIT: Spoke too soon, managed to do it myself. Posting a link in a few hours when I get home.

kattan1969 commented 8 years ago

Hi,

The code worked great with 1.6.6 as recommended. However, I didn’t try to use another version.

By the way, I think there is a small bug whereby two keys are giving the same keycodes. No mater what I try the give the same key sequence. I tried to redefine the keys using linux xmap but it seems that the problem with the Arduino code itself. If you have the time I will send you the details.

Thank you for a great piece of code.

See the photos ..

Regards, A.K.

On 5Oct, 2016, at 8:15 AM, JerwuQu notifications@github.com wrote:

Hey! Sorry to be a grave digger but did you ever get a patch working for >= 1.6.6?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/andywarduk/BBCKeyboard/issues/1#issuecomment-251583845, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ3ycP4mB01-0oYArOMGzOyrlyDIw8EHks5qwzJYgaJpZM4HqWq9.