Hi! I am happy to publicly release the Arduino sketches for amiibo cloning using the PN532 NFC module!
Here I will provide a short manual on how to use them. If you want more detail, check the initial Create amiibo clones with Arduino article.
Required tools
- Arduino and NFC shield
- Some wires to conveniently connect Arduino to the NFC module
- Blank NTAG215 NFC tags — one per amiibo figurine
- My Arduino sketches for amiibo management
- Modified Arduino library for the NFC shield
- Amiibo dump in bin format
- Encryption/decryption key for the dump editing (it is usually not linked directly but easily found by googling “Use this to Encrypt your custom Amiibo NTag pastebin”)
Preparation
Connect the NFC module to the Arduino.
In case you have an ordinary module, not an actual shield, make the following connections:
SCK → Digital 13 MOSI → Digital 11 SS → Digital 10 MISO → Digital 12
Download the modified Adafruit library and put it with the rest of your Arduino libraries.
Then use Dump_amiibo_PN532
Arduino sketch from my repository in order to get the NFC tag UID.
Run the sketch and put the card on the reader:
In my case, the UID is: 04676752AF4F81
Getting the amiibo dump
Now it is required to dump the amiibo figurine that we have. Dumps from the Internet are suitable too. Usually you can find them by googling “Amiibo BINs”.
Again, use my Dump_amiibo_PN532
Arduino sketch and put the amiibo figurine on the reader. In a few seconds the dump will appear on the screen. Just copy it into a hex-editor and save the resulting file. In this example I called mine Chibi-Robo.dump.bin
.
Decoding, editing, and encoding the dump
Now prepare the dump to be written to the tag.
Go to https://games.kel.mn/amiibo, pick your dump, the key, then specify the UID of the blank tag.
Press “Submit”, the new dump will appear in a popup window!
Writing the dump into the NFC tag
Now this code should be pasted into the Write_amiibo_PN532
Arduino sketch.
Copy the results into the sketch:
Run the sketch, put the tag, wait till the writing process is finished.
After you see the “Write process finished! Now please take your Amiibo card away!” message it is safe to take the tag away.
Results
If all the steps were performed correctly then your amiibo clone is ready!
Buying Guide
Known issues
The Adafruit library is not perfect and suffer from some issues which I was unable to fix.
First and the most noticeable one is the performance issue.
While it takes just a second to dump or write a tag with RS522 module, it takes whole nine seconds with PN532.
Writing is even slower! It takes 17 seconds to write a tag.
And please stand still during that time because it is impossible to check whether the writing to a single page was successful or not. The checking procedure simply doesn’t work as intended, always reporting success.
So please be careful and check the written tag with Dump_amiibo_PN532
sketch after writing to it. If you find it empty, try to write again. And again. It should work eventually.
Credits
I want to thank all the donators who helped me to buy the module and tags for test and who participated in the beta test to fix some ridiculous bugs!
Big thanks to my patrons at Patreon! Guys, you’re great! Thanks for your support!
And I also want to say thank you to all the people who come here to the blog every day! You really helped me to move on and continue my work on this project.
Thank you all!
Спасибо за информацию!!!!!
Hello,
It’s me again 🙂
There is one thing I do not understand so your sketch for writing:
if (uidLength == 7) {
// Compare tag UID to the UID dump
for (byte uidbyte = 0; uidbyte 2) {
actualbyte ++;
}
if (dataBlock [actualbyte]! = uid [uidbyte]) {
Serial.println (F (“UID mismatch!”));
Serial.println (“UID of the tag does not match the UID specified in the dump.”));
countdown ();
return;
}
}
You make a test to compare if the UID of the Ntag215 to be burned is identical to the UID of the dump_amiibo.bin
But they will NEVER be identical since each Ntag215 has its own UID and each Amiibo has its own UID.
So, when I tried to write a Ntag215 with a viable dump of Amiibo, it failed and I went through your loop “UID of the tag does not match the UID specified in the dump.” logical;)
Because to come to create a clone Ntag215 I delete your test and it seems to work …
So I’m just asking you to explain your loop.
Thank you for your help.
Hi Yave.
Seems like you don’t understand the point of the whole procedure described in this manual.
You have a dump with a certain UID and you have a blank tag with a different UID. You convert the dump using the online tool specifying the dump and the UID of the blank tag to make the dump compatible specifically with your blank tag.
So the resulting dump should pass the check in the sketch and you shouldn’t remove it from there 🙂
Hope you get the point now.
Hello,
I just understood … I did not read everything in the tutorial …
Sorry for bothering you!
In fact, the UID of a blank T NTag215 must correspond to that of the Dump because you can not write on PAGES 1 and 2 of an NTag215, because the UID of 7 bytes is write-protected;)
Regarding your web application Online dump editing tool v1.2, I imagine that it is from Amiitool. Having seen your github repository I did not find anything on Amiitool.
Is it possible to share me your sources (php, or javascript I think …) to help me reach for example on: Arduino or PC off line
So without browser, server …
So I could have fun creating a GUI for editing and checking Dump;)
Thank you for everything ! Thanks to you I think to be done with the part Tag!
Hello Kostia,
You do not want to share your sources?
The main script is available here: https://games.kel.mn/en/companion-script-to-simplify-amiibo-cloning-with-arduino/
You can also simply save the webpage at https://games.kel.mn/amiibo to get the frontend source.
The only thing I can not share due to security reasons is the backend configuration and scripts.
your link is very interesting, but a bit technical for my current skills. However, I find something more “simple”:
https://github.com/ThisIsAreku/arduino-amiibo/blob/master/Amiibo.cpp
But, because there is always a but 🙂
I go through the loop fasle, for a reason that I do not know, so my friendibo is detected as “It may not be an amiibo, or nothing found”
and if I add in the code the method:
“amiibo.read ()” BEFORE the if (! amiibo.readInfo (& info)) test
Well, he dumped the amiibo with his corresponding ID.
I’ll admit that I’m blocking, do you see the worry?
I’m still in SPI mode and I do not use the in / out of the author (because otherwise nothing is detected) but these:
Adafruit_PN532 NFC (PN532_SCK, PN532_MISO, PN532_MOSI, PN532_SS);
Thanks 😉
EDIT:
in fact I understood, but I do not know how to solve the problem!
When we execute the script “int oldId = info.amiibo_id;” is necessarily 0 … so suddenly the following return fasle 🙁
and I do not understand how to tell him to take the current UID for continued
this function makes sense and is convenient for multiple scan …. we purge the cache and rescanne, but for a first scan for him it’s empty 🙁
Sorry, Yave, I can not assist you with this code. You should better create an issue on GitHub to contact the author directly.
Of course no problem, I will not bother you any more;)
In any case I thank you for your help!
We have the same passion for consoles / video games and programming!
I wish you a very good continuation, great job you did!
Thanks a lot! Wish you luck with your project!
I would like to be able to display the Character ID and the GAME ID of each scanned Amiibo, thus lighting LEDs, playing a sound etc. 😉 But different for each Character ID.
And also recovered all their data (for further processing, not yet defined)
I thought amiitool would do it but no. Or most certainly I did not understand!
No, that’s not something amiitool was designed for. I think you should check this project, it looks very similar to what you’re trying to build: http://www.instructables.com/id/Amiibo-NFC-Reader/
I know this project, but having failed to do a simple dump I had a little left;)
And I was not sure that the script was using UIDs?
Another concern of this link is the code, which did not work on my Adafruit version (again) 🙁
I will investigate again in this code Thank you very much! 😉
Hello,
I just checked and that’s what I thought, this tutorial only explains how to recognize SON amiibo (UID) and not the Character ID, as I told you below 🙁
So, that does not interest me at all, it’s not dynamic.
UID is just a serial number, not the Character ID of the Amiibos models, that’s …
I’m still trying to get clear and legible this famous Character ID
Offset Size Description Notes
0x0 0x2 Game & Character ID First 10 bits are the Game ID and last 6 bits are Character ID.
0x2 0x1 Character variant
0x3 0x1 Amiibo Figure Type
0x4 0x2 Amiibo Model Number
0x6 0x1 Amiibo Series
0x7 0x1 Unknown Always 0x02
Then you should check this project: https://github.com/Xerxes3rd/Wifiibo
It is for ESP8266 modules, not standard Arduino, but you might be able to port the needed features. It is 100% able to distinguish the amiibo characters.
I have already tested your library and also the “official” Adafruit, with always the same result, PAGE 0 is not dump
As for the SPI I’m all rewired, I just have to find the right connections, I think used that explain comment in your code (which are ultimately only the official commentary of Adafruit)
and I repeat once tested;)
For the last part of my answer, it is a translation error sorry I am French;) I do not try to erase my friendibos, we can not with nTag.
I wanted to say that I can not correct dump a complete friendibo, but especially the UNIQUE ID to recover the DATAS, for me it is the most important. The uid does not really matter from what I understand.
thank you,
> but especially the UNIQUE ID to recover the DATAS, for me it is the most important. The uid does not really matter from what I understand.
You understand it wrong. The UID is the UNIQUE ID.
Previously you wrote the following:
> Knowing that this 1st Offset contains all the interesting datas, including the ID, NAME of each amiibo
That is also not right. The first block contains just the first half of the UID, nothing more. Such data as Amiibo name, stats and so on are stored further in the dump and are encoded.
I thought I understand that the UID is unique to each Amiibo and not to each model of Amiibo?!
Example:
UID = the UNIQUE serial number for each Amiibo Link, so for unique summary and related to its owner.
ID = ID unique to Amiibo Link model (not unique) and linked only to Link model
So, I’m pretty surprised of your answer.
For now, I’m just going to try the SPI communication mode
If you do not see any material difference in our cards, that can only be the worry!
I’ll let you know as soon as possible. I am very grateful for your explanations and your help, really thank you, I love this kind of fun project.
Moreover really thank you to all the people who, like you who spontaneously share their knowledge to the novice;)
I guess it has to be explained that U in UID stands for “Unique” 🙂
Can recommend you to check the NTAG215 datasheet, which will help you to understand these tags better: https://www.nxp.com/documents/data_sheet/NTAG213_215_216.pdf
The UID is the only really unique thing for a tag and this helps the console to distinguish between amiibos. So if you have written the same amiibo to two different tags (of course performing a necessary encoding process, which is also based on UID), the system, say 3DS, will be able to understand that these are different tags and will handle them separately.
By going through the SPI everything works perfectly!
The main concern is that the PINS present in the code were not good at all, those of origin Adafruit, like yours (why mystery?)
So, I give them for those who would meet the same concern as me 😉
// If using the breakout with SPI, define the pins for SPI communication.
#define PN532_MOSI (7)
#define PN532_SS (6)
#define PN532_MISO (5)
#define PN532_SCK (4)
And well used:
// Use this line for a breakout SPI connection (recommended):
Adafruit_PN532 NFC (PN532_SCK, PN532_MISO, PN532_MOSI, PN532_SS);
So the concern was the I2C controller (by the way the dump time is incredibly long …)
Congratulations for your help;)
Regarding the Amiibos, I read so many things on the net … Nobody seems to agree, which has troubled my thinking!
I do not want the serial number of each Amiibos (which is unique, we agree)
But their Character ID
I hope I made myself better understood? Sorry the language barrier does not help. Once again here is the source for illustrated my words:
https://www.3dbrew.org/wiki/Amiibo
Here:
Offset Size Description Notes
0x0 0x2 Game & Character ID First 10 bits are the Game ID and last 6 bits are Character ID.
0x2 0x1 Character variant
0x3 0x1 Amiibo Figure Type
0x4 0x2 Amiibo Model Number
0x6 0x1 Amiibo Series
0x7 0x1 Unknown Always 0x02
Now that I know how to get a full Dump, I have to test it and make sure it’s clean!
In order to recover all the decrypted data I used Amiitool (compiling it)
I get all the Offset but it still does not tell me the name of the Amiibo or that series (example: SSB series, ZEDLA series etc)
Yet amiitool is supposed to decrypted them.
I’ll capture you for clarity:
https://ibb.co/cvhdqc
So, at no point in all this I do not see the first 10 bits are the Game ID and the Character ID etc.
🙁
I’m glad SPI worked for you and thanks for posting the pinout of your module.
The result on the screenshot you provided looks like a valid decrypted dump for me.
What is the issue you’re experiencing now? Do you have any troubles with hex? What did you expect to see after decoding the dump?
hi Kostia,
I used https://github.com/konstantin-kelemen/Adafruit-PN532 it well and yet the 1st Offset is not Dumper.
As you told me, it’s a pretty simple code or the fact that I do not understand the problem;)
all other Offset are Dumper properly, but without this 1st I can not do anything 🙁
Little precission that I have not said before! I use I2C to communicate and a PN532 from Adafruit
here is a picture of my montage, as you see I respect the connections RST / 3 and IRQ / 2:
https://ibb.co/iaj85c
Thanks again for your help!
Unfortunately I haven’t used the Adafruit shield before, and the picture doesn’t really say much to me. What I can recommend is to try to use it in SPI mode in case the board supports it.
If nothing helps, could you send the dump sketch output, I’ll need to take a look at it?
I can try the SPI mode but I do not know or connected the pins …
I did not find the equivalence in terms of schemat for the SPI mode with my Adafruit shield, sorry!
Here is the beginning of the Dump Offset:
https://ibb.co/mXxCgH
As you see the 1st Offset 0x0 is not dump …
Thanks !
Hi, the output looks weird but you can easily recover the data from the first bank, since you already have the most part of it in the UID.
Just go to this page and enter the UID: https://dynamoreason.com/res/g/amiibo/uid/
The first 4 bytes you’ll get is the data in the first bank (in your case it is 04C15914).
It’s that simple!
Hello,
Why the 1st 4 bytes are not calculated in the dump while they are for UID? This is what I do not understand…
When you execute your code you have no errors, you that it comes from the fact that I use a control card different from yours (Adafruit PN532) I do not see any material differences between mine and yours.
So, I’m blocking and I do not know how to get them clean … Do you have an idea? especially since I scrupulously respect your code and I use the library that you have modified.
In short, this is the impasse 🙁
thank you,
> Why the 1st 4 bytes are not calculated in the dump while they are for UID?
Sorry, but I have no idea why this is happening. I advice you to try the original Adafruit library, possibly there have been some recent fixes for that.
> I do not see any material differences between mine and yours.
Right, our NFC modules use the same chip. But mine usually works with SPI protocol which might have been implemented differently within the library. Again, try the official library for dumping purposes.
> So, I’m blocking and I do not know how to get them clean … Do you have an idea?
Are you trying to erase the tag? If so, I’m sorry to disappoint you, but that is not possible with Amiibos.
Hello,
First of all thank you for your sharing!
I have a PN532 Adafruit, and when I dump my amiibos I never recuèpre the first page 0x0 I have the error message, so I’m not a proper Dump.
Will you have an idea?
Knowing that this 1st Offset contains all the interesting datas, including the ID, NAME of each amiibo and I do not see at any time in your code the decryption via the private key.
In short, how did it go?
thank you !
Hi, make sure you have NFC module connected properly and use the modified library https://github.com/konstantin-kelemen/Adafruit-PN532
The dumping process is fairly simple and does not require any specific keys or something.