Improved keyboard wedge

Merry Christmas everyone!
I have developed my own little keyboard wedge. It is still somewhat rough around the edges, but I consider it ready for publishing.
Take a look:

5 Likes

Well it’s been a while…

I’m afraid I was having to deal with the black dog, and while the new meds seem to be helping with that they also left me feeling like I couldn’t be bothered doing anything for a while.

So, I have just ignored most of my last rewrite which was non functional, and ported release one over to platformio as a development platform.

My current plan is to add the following features…

  1. (Completed) XOR the password with the UID and store the encrypted password in the array. If the UID can decrypt that entry we can use that (advantage, no clear text passwords or UIDs are stored on the controller. The encryption is not strong though, this will not slow down a determined attacker). This could be modified to search the chip for the encrypted password but I am not sure why you would want to do this, garbage on your chip would look suspicious.

  2. (Completed) Configurable headers and footers for the password stored on the chip itself. If you want to use PASS^ and ^ respectively you can. The Password cannot contain the footer though. PASS^^^ would be a null password not a single ^.

  3. (Completed) Add support for the reader to “press” the F15 key every 5 minutes. This is because my laptop goes to sleep in long meetings and cuts me off. I want to add this as I already have this microcontroller connected, so making it do double duty.

  4. Add support for a PN532 reader.

  5. (Completed) Configurable keyboard layout. The Keyboard library supports multiple languages, so we should be able to change that and send it other characters.

The new code including a UF2 file for a trinket is at (https://GitHub.com/zwack-am/ZKBW2/) I will make this a bit more obvious when I have completed item 1. Item 4 will be the next release, and then porting to the pico.

6 Likes

This sounds awesome!

there are great library for the PN532 out there (and they work).
Ive been looking at teh PN5180, it is suposed to get even better reads, but i cannot make it work … at all … (might make a dedicated thread for it)

1 Like

I am very familiar with that feeling. I feel like I have lost years to that limbo state.
Its really good to hear you are fighting the black dog.

Also, I had not heard of platformio, until now. It looks pretty cool.

I have found another useful thing(and tested it) for supported boards

If the board has a USB interface, and supports UF2 I don’t need to worry about distributing source code and having people fail to flash their board properly.

I have already tested this but I can compile a .bin file for the board and then convert it to a UF2 file (you need the python script from the utils directory of https://github.com/microsoft/uf2)

The end user just needs to press the reset button twice, and the board will mount itself as a USB drive. If they then upload the .uf2 file to that drive it will reboot and come up with the new code running.

The supported chips do include the Atmel SAMD21 (Trinket m0), the raspberry pi rp2040 (pico) and various ESP32 chips.

This means that I can develop in platformio, or Arduino, or avr-dude or… And users do not need to use a similar development environment, or separate flasher to install the working code. As long as they load the correct uf2 file for their board it will work for them.

3 Likes

Release 1.0 is here…

GitHub site

This includes an easy upgrade mechanism IF you don’t mind using my Config.h.

If you are using a trinket m0 you can just grab the uf2 file. Press the reset button on the trinket twice and you will see a new USB device (TRINKET_BOOT). Drop the uf2 onto that device, wait for it to reboot and you will have upgraded.

If you want to use your own configuration you will need to modify config.h and use platformio to build a new version.

Remaining planned tasks…

  1. Add support for a PN532

  2. Port it to the Raspberry Pico

I will start on those once I have got the initial working version of my next project done.

5 Likes

image

200w (1)

Ho, dam … Forgot about coming back to this …

The read range with a full card is about 1/2" but I can’t pick up the implanted NExT …
I really love the code @Zwack made, it’s “simple”, does what it’s supposed to do perfectly and is easy to use …

I’m trying to get my pn5180 to work to test out some of the other wedges that popped up but I’m not having any success with it … I’m getting discouraged about my inability to make this work …

2 Likes

I’m
Interested in maybe making one of these, assuming I understand the concept

Where do I even start?

There are basically two main hardware components to this.

The microcontroller (atsamd 21) and the NFC frontend (PN532).

For the microcontroller I like to use the Seeeduino XIAO, because its small and it has a USB type C port.

For the PN532 most people recommend the elechouse PN532 (PN532 NFC RFID module V4 - ELECHOUSE), due to its good coupling with X series implants.

The PN532 seems to be getting phased out by NXP. However there aren’t as many nice libraries for the alternatives.

Once you have the required components, you need to solder them together. The firmware will contain info on where the wires go.

Then flash the firmware and perhaps 3D print a case for the whole thing.

When it comes to picking firmware you can either use mine (Schlaf / Yet Another Keyboard Wedge · GitLab) or Zwack’s (GitHub - zwack-am/ZKBW2: Second Generation Keyboard Wedge using Platformio for development).

Both projects are in a bit of a jank state. Feel free to ask if you run into issues.

You probably also want to write passwords to your NFC chip. My project doesn’t have an easy way of doing that right now. Might polish up the code for that, and make it more usable.

Also, I made 3D printable case for my design. It has holes that are sized for Ruthex M2.5 threaded inserts.
YAKW2 (another copy).stl (139.0 KB)

Ok, I might pull the trigger on this

First step, order the parts, then figure it out as I go I guess, I have a friend IRL who apparently does arduino stuff, assuming that’s what this is…. So I can lean on him if it goes really poorly

For the pn532, the one linked is like 35$ instead of like 3-5$ is it really worth the difference?

1 Like

I thinks it’s close to $50 with shipping and tax. I’ve ordered a couple of them. From everything I’ve read, the v4 is the best for the form factor and code/libraries that exist for it. I am able to scan my xseries implant through a 3d printed case using the v4 reader.

1 Like

Is the v3 not up to the task?

1 Like

The genuine elechouse PN532 boards are popular because their builtin antenna works well.
However there are many counterfeit versions of the elechouse PN532 boards out there. These may actually work. However performance will be worse. The V3 boards you can find on the internet are 100% counterfeit. Elechouse only produces and sells the V4. If you want to be sure to receive originals you have to order directly from them.
If you can get the counterfeit PN532 boards for 5$, it might be worth trying one out. If it doesn’t work, you at least didn’t spend much on it.

I have both real and counterfeit boards at home. Might post pictures and show the differences on the weekend. Will also test read performance of the counterfeit one, that I have.

2 Likes

Ok, so I’ll order a counterfeit v3 and a real v4
(Have you seen the v4 with the detached larger antenna?)

Talk to me about the micro controller options,
I reread the entire thread, and I was seeing different controllers being used… I looked up the one you listed and that looks to be 40$ but I see others using the trinket which comes in at 5-10 bucks

My firmware in its current state is written in Arduino. Technically any Arduino compatible chip should work. You may run in to weird clock speed issues and stuff like that.
Not sure about chip compatibility for Zwack’s thingy. (is he still around?)

The boards discussed in this thread use some sort of SAMD21 chip. I was going to say under 10$ is a good price for these. However the prices seem to have gone up compared to last year. 40$ still seems a bit much. In Germany the Xiao seems to be available for about 13€ (check ebay).

There might be a supply shortage for the chip.

The board I like to use is the Seeeduino Xiao. Its small and has a USB type C port.
Notice, there are variants of the Xiao with entirely different chips on them. Make sure to get a SAMD21 board.

The other one discussed here is the Adafruit trinket M0. It uses a slightly different variant of the SAMD21, but that doesn’t really matter. However uses a micro USB port (ew).
Another option, that should work is the SparkFun SAMD21 Mini.

The latter two may be more interesting options if you are somewhere in america. Both of the manufacturers sell the things directly afaik.

Ofc only the Xiao will fit in the case I have designed, but designing a new box for this should not be a huge challenge.

I have been absent for a while but have been following this thread via email.

The SAMD21 has built in USB capabilities which makes that chip preferable to other chips.

I used a trinket m0 because of the processor, and it is small, cheap, and I already had one lying around.

The USB connection doesn’t matter so much to me as I already have a bunch of connectors, and in my case I use a USB keyboard/mouse switch to switch between computers, and that has 4 USB A ports. So a micro USB to USB A cable is dedicated to this device.

If you are going to dedicate the board to this then I would suggest using whatever you can get cheap. But that might just be me.

2 Likes

You lost me here,
Doesn’t the trinket have a USB port on it?

Yes, the SAMD21 is the chip on the Trinket M0. So it does have a USB port. You want to make sure you get a Trinket M0 not just a Trinket, because you are looking for one with an Atmel SAMD21 microcontroller. The older trinkets use a bit banging technique for USB that isn’t nearly as reliable.

3v or 5v?