Today I added a new applet to the NFC chip and thought that it may be nice to cover the software part of the project.
Let's talk about what we need to program the chip. Hardware wise it's simple: a ACR122U - NFC Reader/Writer is the simplest writer to use for this task. It's also fairly inexpensive.
Then there's software. We'll need:
- The ACR122U drivers
- GlobalPlatformPro for loading and managing JavaCard applets on the chip
- The NFC Tools Android app.
Regarding applets I'll cover loading the two I'm using right now:
- The already mentioned Gauss Key Card from darconeous which make the watch act as a Tesla key
- JavaCard NDEF Applet which makes the chip act as an NFC NDEF Tag. I'll use it to store a link to my Hackaday.io projects page.
Applets installation instructions
Step 0: Install ACR122U drivers
Step 1: Install GlobalPlatformPro. You can simply download pre-built binaries form their release page.
Step 2: Install Gauss Key Card applet.
Download the pre-built .cap files from the Gauss Key Card project page and load the file onto the chip using GlobalPlatformPro
java -jar gp.jar -install GaussKeyCard.cap
Step 3: Install JavaCard NDEF full applet
Clone the project repository which contains also the pre-built .cap files.
git clone https://github.com/OpenJavaCard/openjavacard-ndef.git
Once cloned load the full variant of the applet which will let you write the content once. Note: the command to upload the applet differs slightly from the official documentation because of a recent change in the behaviour of GlobalPlatformPro create/applet command.
java -jar gp.jar \ -create D2760000850101 \ -params 810200F182020800 \ -install build/javacard/javacard-ndef-full.cap -default
Step 4: Write the NDEF applet content using NFC tools
Step 5: Pair your watch to your Tesla following the official instructions.
Overall the process is fairly simple and throughly documented. The two applets I mentioned are just a few exemples of what the JavaCard standard can offer. Here's a curated list of interesting JavaCard applications that can be loaded on the Tesla Key Watch.