IRDA keyboard driver concept w/source

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

IRDA keyboard driver concept w/source

Post by tundrwd »

I've spent a bit of time this afternoon knocking together a concept IRDA keyboard driver for the PSP. I have compiled it for V1.5, and the binaries and source are included. It's my first PSP project.

Yes, it works. As it stands, it will only work with a PocketTop (Micro Innovations) IRDA PDA keyboard. If you use other IRDA keyboards, you may or may not get any characters to display without changing the source and recompiling.

Use it - but please CLEAN IT UP and OPTIMIZE it.

Please note - it's ugly (I only spent 3-4 hours, and that was also setting up the PSP development environment on my Linux box, and figuring out a thing or two along the way). Many thanks to Vanya Sergeev and his irdacapture program, along with the irk keyboard driver from the Zaurus project - this project is based on those works. I'm also going to check out the handheld.org PDA IRDA keyboard driver as another reference.

Download the zip here: http://www.underwoodfamily.org/kbdtest.zip As always - Use at your own risk! It works for me, but YMMV, batteries not included, etc.

There are still several things I don't get in the EBOOT.PBP creation (I still haven't figured out how to get the icon or background pic embedded in the EBOOT).
wulf
Posts: 81
Joined: Wed Apr 13, 2005 6:56 pm

Post by wulf »

I use the PBP unpacker tool to do that... google pdc pbp unpacker
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Re: IRDA keyboard driver concept w/source

Post by Agoln »

tundrwd wrote:There are still several things I don't get in the EBOOT.PBP creation (I still haven't figured out how to get the icon or background pic embedded in the EBOOT).
Since you have the SDK installed, when you do a "make kxploit", you can see that it just uses the pbp-packer and pbp-unpacker (or very similiar names in the SDK bin). The magic lies in those tools.

I will probably check this out, and if you are going to continue work on this project, to make it compatable with more keyboards, then I will definately incorperate it into my IRC project. Messing with the fast keyboard is alright, but clunky at best.

Great work, and keep it up!
Lego of my Ago!
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

If I may ask, what is the model number on the keyboard you wrote the code for. I am looking for one online and do not see one called "Pocket Top".

Also, how does this work exactly, does it load the keyboard driver into memory and reload the PSP GUI so one can use say during the WEP encryption typing or does it solely run in a test app that you made.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

F9zDark wrote:If I may ask, what is the model number on the keyboard you wrote the code for. I am looking for one online and do not see one called "Pocket Top".
http://www.pocketop.net/. I have one for the Compaq Ipaq 3800 series. Also see http://www.mobiletechreview.com/tips/pocketop.htm. I think I got mine for about $29 a couple of years ago.
Also, how does this work exactly, does it load the keyboard driver into memory and reload the PSP GUI so one can use say during the WEP encryption typing or does it solely run in a test app that you made.
Well, it's not a driver in the usual sense. You don't load it and then go use whatever other function you want. For that, we need Sony to provide something in flash. This has to be part of each program that wants to use it.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Re: IRDA keyboard driver concept w/source

Post by tundrwd »

Since you have the SDK installed, when you do a "make kxploit", you can see that it just uses the pbp-packer and pbp-unpacker (or very similiar names in the SDK bin). The magic lies in those tools.
Thanks. I'll have to check them both out.
I will probably check this out, and if you are going to continue work on this project, to make it compatable with more keyboards, then I will definately incorperate it into my IRC project. Messing with the fast keyboard is alright, but clunky at best.
I only have the Pocketop, and irk has the keyboard layout for a Targus. I can check the handheld.org version of an IRDA keyboard and see what else they have. Unfortunately, other than what's already in code, that is probably the extent of what can be done without access to other keyboards.
Rashman
Posts: 1
Joined: Mon Jul 18, 2005 6:26 am

Post by Rashman »

I got this one for my PDA yonks ago, hope it works! Just blew the dust off it!

Modl No:MP-0118
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

I've had several requests regarding what keyboard, what model, etc. so they can buy one.

Honestly, I can't help you much here. The Micro Innovations/PockeTop keyboard were sold under at least those two names, I seem to remember at least one other brand name that looked pretty much like the MI/PT keyboard. I believe the model on the packaging was a TKB700U, but that isn't on the keyboard itself. The keyboard is labeled as a Micro Innovations, but the silk screening on the PC board by the battery says PockeTop.

Mine is compatible with a Compaq Ipaq 3600/3800 PocketPC. There were some models that were Palm-specific. The Palm specific ones might work, I don't know.

These keyboards are still for sale in several locations (as well as the ever present eBay). Going price for new is around $30-40 (Amazon, etc.) eBay will probably be somewhat cheaper - who knows.

If others could post their results, and give whatever information they can, it might help others. Also, if you try a keyboard, and it displays characters, but they aren't the correct characters - post that as well.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

I should also mention that they code provided is useless in and of itself. It isn't going to get you typing anywhere else but within that one program. Any other homebrew will have to incorporate this interface/driver for a keyboard to be used within those programs as well.

So don't go out buying these keyboards up, thinking they will solve your problems today. It won't.

Right now, I'm studying what I've got available on the PSP, and what coding approach to take to make this more useful, and to be incorporated into other programs.
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

I purchased mine off eBay, waiting for it to arrive. If it doesn't work, no biggie, I can try and make the program work with mine. If not, at least you'll have people willing to test the program with other keyboards and get a much broader range of feedback than from just one person.
Squall333
Posts: 91
Joined: Thu Apr 28, 2005 5:32 am

Post by Squall333 »

How hard would it be to adapt that code to work for other keyboards? Im thining along the lines of a keyboard model selector. Maybe use the irda capture program for people to get the irda codes from their keyboard and maybe i (if its possible) can make a keyboard selector? Dont flame if its ridiculous just let me know.
sexdwarf
Posts: 34
Joined: Thu Jul 14, 2005 12:07 am

Post by sexdwarf »

Squall333 wrote:How hard would it be to adapt that code to work for other keyboards? Im thining along the lines of a keyboard model selector. Maybe use the irda capture program for people to get the irda codes from their keyboard and maybe i (if its possible) can make a keyboard selector? Dont flame if its ridiculous just let me know.
i think something like that would be doable - perhaps make a standardized reading library - and you put in a configuration file for your keyboard.... as more keyboards get tested the more likely your config file will exist - offer a seperate utility to learn an unknown keyboard (press A now; press a now, press B now) then it can be saved and shared as well... at least that way there will be one standard driver for reading the input data and reading from the mapping/config file...
...isn't it nice, sugar and spice...
...luring disco dollies to a life of vice...
Squall333
Posts: 91
Joined: Thu Apr 28, 2005 5:32 am

Post by Squall333 »

I would start this project asap but i dont have an Ir keyboard and im not 100 percent sure how this works ill take a look at the ir capture code and see how well its documented
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

I got my IR keyboard. PockeTop MP-01183US-468. It works, but buggy. Numbers don't work, caps lock types in the punctuation marks(as opposed to making capital letters). Backspace sends the cursor all over the screen.

Well at least we can chalk up another semi-working Model number to the list.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

F9zDark wrote:I got my IR keyboard. PockeTop MP-01183US-468. It works, but buggy. Numbers don't work, caps lock types in the punctuation marks(as opposed to making capital letters). Backspace sends the cursor all over the screen.

Well at least we can chalk up another semi-working Model number to the list.
There is a problem in the backspace. Honestly, I'm not too interested in fixing the initial concept driver until I've had a chance to think over how to do it right for the PSP. I only wrote that to see if there was interest (seems to be), and to see if the thing would be conceptually possible.

The original driver/interface really shouldn't be taken as "the way to do it".
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

Well if you want my input, the best way to do it, I think would be to clean up, document it better, maybe even make a 'tutorial' program for coding other model keyboards. Then make it a header file for other programs to include. This way, whenever the program needs the keyboard, it would have been called at the beginning of the program.

As far as the PSP GUI stands with using the keboard, I think thats a dead issue, since we'd need to write the information to flash and rewrite the GUI to accept the keyboard. But for the rumored WinPSP and any other PSP OSes that get made... Well it should work wonders with those, so long as the authors want to include them.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

F9zDark wrote:Well if you want my input, the best way to do it, I think would be to clean up, document it better, maybe even make a 'tutorial' program for coding other model keyboards. Then make it a header file for other programs to include. This way, whenever the program needs the keyboard, it would have been called at the beginning of the program.
Uhhh... yeah.

Maybe you didn't understand the concept of "concept driver". As I have stated (repeatedly) - it was not intended to be used as-is, was simply quickly put together to show that it could be done. I posted it to see what interest level may exist. I personally don't have lots of free time to code something "just for grins and giggles" anymore, and I'd certainly prefer a few other experienced coders helping to put something together. If it didn't generate any interest - then I didn't spend much time on it and life goes on.

A similar thing MIGHT be done with a USB keyboard once you get the converters to get it plugged in to the USB (I see someone claims to have done this - but it is unclear if there is any software to make it work).
the_fbi
Posts: 1
Joined: Thu Jul 21, 2005 4:58 am

Post by the_fbi »

Great work tundrwd.

I've got a Micro Innovations keyboard which I picked up for only £5.94 when eBuyer launched them in the UK, at the time it was for my PocketPC but I never really got on with it.

Works brilliantly although a couple of quirks as previously mentioned although all keys can be obtained with the correct prefix key being used.

The model number on the back of mine is MP-0118 (no other numbers after).

Seeing as the IrDA port is on the rear face of the PSP, be nice if any applications which use the keyboard would also turn the screen upside down too. Make it all a lot easier to use :)

Great start to what I'm sure will be quite a key (pun intended) area of any software development.
ironlung
Posts: 13
Joined: Thu Jul 21, 2005 8:00 am

any experience with this irda KB?

Post by ironlung »

I've ordered one of these and I'm looking for anyone who is familiar with the Adesso IR KB here:http://www.adesso.com/products_detail.asp?productid=190.

Got one at Computer Geeks http://geeks.com for $20.

They have a good manual inside the driver ZIP:http://www.adesso.com/drivers/SK-6688.zip

WHAT I LIKE: It has a pop up stand with elevated IR port to point down onto your PSP - suhweet!
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

I understood concept driver and have understood what you have said, repeatedly. I suggested what would aid the community if you wanted to continue on with this since you seemed unknowing of where to get started with a 'final' product.

I would help, but working full time and attending summer classes leaves me no time to bomb a computer to install linux and get it prepped to setup the PSP SDK. But I did want to test this(which is one of the few things I have time to do) and give you my feedback, for which, you apparently don't care about.
tundrwd
Posts: 13
Joined: Tue Jul 12, 2005 11:02 pm

Post by tundrwd »

F9zDark wrote:I understood concept driver and have understood what you have said, repeatedly. I suggested what would aid the community if you wanted to continue on with this since you seemed unknowing of where to get started with a 'final' product.
I'm quite well aware of what to do with this kind of code. I've been a systems programmer for 30+ years. However, when you have just popped into a new environment, you'd like to explore it thoroughly and understand where the boundaries are, and how to apply what SHIOULD be done with what CAN be done in that environment. I can certainly go off half-cocked and write the code, and then rewrite the code several times - or I can evaluate the environment thoroughly and do it correctly once.

Sorry if I jumped the gun - but I've gotten MANY responses to this from people wanting to code and wanting to help, but who are obviously not qualified for this kind of project. I'm glad so many are willing to help the community at large and want to program.

I certainly expected a certain amount of it, but I was surprised at the amount of it, and the kinds of questions asked. So, here's a general response to those who have the desire to help, and a few "things to live by" and consider:

If you don't understand what non-blocking I/O is - you don't want to mess with this type of project.

If you don't understand what keyboard scancodes are and how they relate to "what the user typed" - please seek something else to work on.

If you start asking questions about why something behaves the way it does, without looking at the source code first, and trying to understand it - seek another project.

If you don't understand interrupt driven, buffered bi-directional I/O with line arbitration on serial devices - you don't want to do this (no, the PockeTop is not bi-directional - but that isn't to say that ALL IR keyboards are not. Anyone remember the 1/2 or 2/3 size IR keyboards of 6-7 years ago? The ones that connected to your PC? Without having one, I'm assuming that SOME MAY be bi-directional, just like your everyday PC keyboard - using peeks and pokes on the I/O ports, and you gotta be careful WHEN you poke the port or you lock up the keyboard).

If you don't really understand real-time code, multi-threaded code, event driven code, or callback code, or you have done it and your only experience with that is dropping controls on a VB form or doing something similar with some "Visual Tools Application Environment", please seek another project.

I think it's wonderful so many have wanted to help. However, there's things to start on, and things better left until you have some experience and better understanding of not only the environment you're coding in, but understanding WHAT it is you're coding, and HOW you're gonna get there.

I'm not damning those who don't have experience. EVERYONE has to start somewhere. But this isn't a beginner project.

I'm not chastising those who use "Visual" products, but at this stage, PSP programming with the SDK toolkit as it stands today is a different kettle of fish. You're going to have to get your hands dirty and actually WRITE the code and not expect it to be plopped on a form and magically create code fragments.

I'm not pumping myself up and saying "Look up to me! I'm the only one with experience!" There's things I've done, and things I haven't. I've done this kind of code many times before.

This kind of code isn't terribly difficult - but it takes the right experince and mindset to make it work well.
I would help, but working full time and attending summer classes leaves me no time to bomb a computer to install linux and get it prepped to setup the PSP SDK. But I did want to test this(which is one of the few things I have time to do) and give you my feedback, for which, you apparently don't care about.
I quite understand the time constraints. Believe me when I say it doesn't get any easier the older you get.

News today also that someone connected a USB keyboard up to their PSP. Why in the world they used so much cable is beyond me when they could have gotten a USB miniB converter for $5 - UNLESS they've done some rewiring of the USB to fool the PSP into going into USB Host mode (if the PSP has such a mode - I've heard too many conflicting stories regarding this issue, so I simply don't know the real truth). They're gonna need software too. Guess what? IRDA and USB are both basically SERIAL interfaces. So the same basic driver/interface could be used for both - if coded properly.

Again - care needs to be taken in coding to easily incorporate other devices into the fold in the future - as well as multiple keyboard mappings - hence my pause before leaping into this too quickly.

A final thought regarding this keyboard project - there is supposed to be a keyboard device available the latter part of August, apparently from a UK(?) company. I assume it's not a group of hackers throwing something together, but a bona-fide company with the REAL SDK, development environment, and a license from Sony to produce this keyboard. If this device, and the software with it allow universal access from within any application to that keyboard, and it sells for somewhere near $50USD - then this project is probably toast. If they want $200USD for it, then this project has some life left in it.
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

Sorry if I sounded rude. But my offer stands, if you need someone to test your future versions, just PM me.

And about the PSP Keyboard being made. I heard that it will require a firmware addition. Not to mention, to make the PSP operate the keyboard in its native GUI there would need to be an upgrade to the firmware, since I doubt there are enough homebrew able PSPs to warrant the company making the keyboard to not require it.

I believe the current FW version out now is 1.52, with the keyboard's release slated for October. Now unless they upgrade the FW a few more times since then, I'd believe it would only be natural for the company making the keyboard to goto either 1.52 or higher(if anymore are released in the coming months.)

That will certainly inhibit anyone from buying the keyboard.
Post Reply