AcK77 / AmiiBomb-uino

Amiibo Cloning with Arduino
218 stars 70 forks source link

Not all NFC215 tags get recognized by Amiibomb #8

Open PeggerWed opened 7 years ago

PeggerWed commented 7 years ago

I have bought a few new NTAG215 tags, same as the previous ones but not the same store Amiibomb doesn't recognize the tags, so i tested them on my Android phone that has Tagmo installed (Samsung phone) Tagmo recognizes the NFC NTag215 and writes the amiibo bin perfectly, my N3DS does recognize the tag, so the NTAG215 cards do work perfectly fine.

I checked the info with NFC taginfo from NXP and there identical as the first batch of cards, same info, same stuff, the first batch, Amiibomb could write perfectly fine and it recognized a written card and was able to dump it fine, but this second batch of 10 Amiibomb does not recognize a NFC card while trying to write a bin to it

kauden commented 7 years ago

Hi, I have the same problem. +1

AcK77 commented 7 years ago

Huuum, so if I understand well AmiiBomb say "Waiting for NTAG..." and nothing change? (That's what you said on GBATemp ^^). Did you use the version of AmiiBombuino inside v0.2 or v0.3? Your NTAG are cards or stickers? It's really strange ^^! But let we see how we can fix that!

kauden commented 7 years ago

ERROR: Your Tag it's probably not a NTAG215! AmiiBombuino = v0.3 NTAG = cards (https://fr.aliexpress.com/item/Free-Shipping-100pcs-Lot-NTAG215-NFC-Cards-NFC-Forum-Type-2-Tag-ISO-IEC-14443-A/32804767997.html?spm=2114.13010608.0.0.fDqE1v)

AcK77 commented 7 years ago

Can you try to flash the AmiiBombuino inside the v0.2 and tell me if you have anything different?

kauden commented 7 years ago

When I use v0.2, I have this exception:

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.FormatException: Impossible de trouver des chiffres reconnaissables.
   à System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
   à System.Convert.ToInt32(String value, Int32 fromBase)
   à AmiiBomb.Amiibo_Class.Calculate_Long_UID(String Short_UID)
   à AmiiBomb.Flash_Form.<button2_Click>d__9.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)

************** Assemblys chargés **************
mscorlib
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1637.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AmiiBomb
    Version de l'assembly : 1.0.0.0
    Version Win32 : 1.0.0.0
    CodeBase : file:///C:/Users/thierrycorbin/Downloads/AmiiBomb_v0.2/AmiiBomb.exe
----------------------------------------
System.Windows.Forms
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1637.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Configuration
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1638.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Newtonsoft.Json
    Version de l'assembly : 10.0.0.0
    Version Win32 : 1.0.0.0
    CodeBase : file:///C:/Users/thierrycorbin/Downloads/AmiiBomb_v0.2/AmiiBomb.exe
----------------------------------------
System.Numerics
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1637.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1636.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
BouncyCastle.Crypto
    Version de l'assembly : 1.8.1.0
    Version Win32 : 1.0.0.0
    CodeBase : file:///C:/Users/thierrycorbin/Downloads/AmiiBomb_v0.2/AmiiBomb.exe
----------------------------------------
AngleSharp
    Version de l'assembly : 0.9.9.0
    Version Win32 : 1.0.0.0
    CodeBase : file:///C:/Users/thierrycorbin/Downloads/AmiiBomb_v0.2/AmiiBomb.exe
----------------------------------------
mscorlib.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Management
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1646.0 built by: NETFXREL3STAGE
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Windows.Forms.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.6.1586.0 built by: NETFXREL2
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple :

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
AcK77 commented 7 years ago

Ok so, the problem is when I calculate Long UID based on the short UID readed from the tag... If someone can send me the UID of NTAG who's give this error (or nothing) it will be great! You can use NXP TagInfo App for Android or you can use DumpInfo (https://github.com/miguelbalboa/rfid/blob/master/examples/DumpInfo/DumpInfo.ino) with the Arduino :)! Thanks

kauden commented 7 years ago

I do not have android phone. I tested dumpinfo but I do not see where I can find the UID on OUTPUT

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/thierrycorbin/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14111
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/var/folders/r3/rrjjsmsj0f3bttm1fdgpjsjr0000gn/T/arduino_build_777969/DumpInfo.ino.hex"
avrdude: writing flash (8208 bytes):

Writing | ################################################## | 100% 1.38s

avrdude: 8208 bytes of flash written
avrdude: verifying flash memory against /var/folders/r3/rrjjsmsj0f3bttm1fdgpjsjr0000gn/T/arduino_build_777969/DumpInfo.ino.hex:
avrdude: load data flash data from input file /var/folders/r3/rrjjsmsj0f3bttm1fdgpjsjr0000gn/T/arduino_build_777969/DumpInfo.ino.hex:
avrdude: input file /var/folders/r3/rrjjsmsj0f3bttm1fdgpjsjr0000gn/T/arduino_build_777969/DumpInfo.ino.hex contains 8208 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.06s

avrdude: verifying ...
avrdude: 8208 bytes of flash verified

avrdude done.  Thank you.

Do you want DumpInfo.ino.hex dump ?

Thanks

AcK77 commented 7 years ago

You have to run the Serial Windows inside Arduino IDE, and setting it at 9600 baud to get the informations, after that, you have to scan a NTAG and the informations appear ;)! What's you copy/paste here it's just the Arduino IDE logs, nothing useful here ^^! It's not too difficult to found how you have to do on google to compile an INO file and use the Serial windows ;)!

kauden commented 7 years ago

Output:

FirmFirmware Version: 0x92 = v2.0
Scan PICC to see UID, SAK, type, and data blocks...
Card UID: 04 42 C2 62 AE 4F 81
Card SAK: 00
PICC type: MIFARE Ultralight or Ultralight C
Page  0  1  2  3
  0   04 42 C2 0C
  1   62 AE 4F 81
  2   02 48 00 00
  3   E1 10 3E 00
  4   03 00 FE 00
  5   00 00 00 00
  6   00 00 00 00
  7   00 00 00 00
  8   00 00 00 00
  9   00 00 00 00
 10   00 00 00 00
 11   00 00 00 00
 12   00 00 00 00
 13   00 00 00 00
 14   00 00 00 00
 15   00 00 00 00
kauden commented 7 years ago

Do you have enough information with my Arduino IDE output ?

Thanks.

peacepenguin commented 7 years ago

That looks like most of the ntag215's I've seen. Can you post the same dumpinfo output for one of the working Ntag215's to compare the results of the UID short to long conversion for a working UID vs a non-working UID?

kauden commented 7 years ago

Sorry but I do not have functional NTAG. I have no android for flash a NTAG215.

Maybe @PeggerWed can post us a functional NTAG ?

PeggerWed commented 7 years ago

My non working Empty NFC card on AmiiBomb info (there working fine on Tagmo Android) All information according to "NFC Taginfo by NXP" on Android phone

NFC Taginfo (empty card that Amiibomb does not recognize) IC manufacturer: NXP Semiconductors

IC Type: NTAG215

Memory Data: 504 bytes user memory 126 pages with 4 bytes per page

IC detailed information: Full product name: NT2H1511G0DUx Capacitance: 50pF

Version information: Vendor ID: NXP Type: NTAG Subtype: 50pF Major version: 1 Minor version: V0 Storage size: 504 bytes Protocol: ISO/IEC 14443-3

Configuration information: ASCII mirror disabled NGC counter disabled No limit on wrong password attempts Strong load modulation enable

Originality check: Signature verified with NXP public key

Technologies supported: ISO/IEC 1444-3 (Type A) compatible ISO/IEC 1444-2 (Type A) compatible

Android technology information Tag description: TAG: Tech [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.NdefFormatable] Maximum transceive lenght: 253 bytes Default maximum transceive time-out: 618ms

Detailed protocol information: ID: 04:50:B5:52:AF:4F:81 ATQA: 0x4400 SAK: 0x00

Memory content: [00] 04:50:B5 69 (UID0-UID2, BCC0) [01] 52:AF:4F:81 (UID3-UID6) [02] 33 48 00 00 (BCC1, INT, LOCK0-LOCK1) [03] E1:10:3E:00 (0TP0-OTP3) [04] 03 00 FE 00 |....| [05] 00 00 00 00 |....| ... [82] 00 00 00 BD (LOCK2-LOCK4, CHK) [83] 04 00 00 FF (CFG, MIRROR, AUTH0) [84] 00 05 -- -- (ACCESS) [85] +P FF FF FF FF (PWD0-PWD3) [86] +P 00 00 -- -- (PACK0-PACK1

PeggerWed commented 7 years ago

The old ntags that did work on Amiibomb have he same config, (except there already witten to) If you wish i can ship 2 of those non working on Amiibomb/working on Android Tagmo NFC cards to you.

PeggerWed commented 7 years ago

Ok, i found an old NTAG 512 from my first batch that worked on Amiibomb that was still empty:

Amiibomb info:

Wachten op NTAG... Gevonden!

Short UID is: 04037EAA064F81 Long UID is: 04037EF1AA064F8162

"D:\AmiboDumps\Smash 4[SSB4] Donkey Kong.bin" is gepatched. "D:\AmiboDumps\Smash 4[SSB4] Donkey Kong.bin" is verzonden naar AmiiBombuino.

Amiibo is klaar! Veel plezier!


NXP Taginfo: (after the card was written) IC manufacturer: NXP Semiconductors

IC Type: NTAG215

Memory Size: 504 bytes user memory 126 pages with 4 bytes per page

IC detailed information: Full product name: NT2H1511G0DUx Capacitance: 50pF

Version information: Vendor ID: NXP Type: NTAG Subtype: 50pF Major version: 1 Minor version: V0 Storage size: 504 bytes Protocol: ISO/IEC 14443-3

Configuration information: ASCII mirror disabled NGC counter protected (cause it's already written) Wrong password attempts allowed: 7 (cause it's already written) Strong load modulation disabled (cause it's already written) Configuration locked (cause it's already written)

Originality check: Signature verified with NXP public key

FULL SCAN: Technologies supported: ISO/IEC 1444-3 (Type A) compatible ISO/IEC 1444-2 (Type A) compatible

Android technology information Tag description: TAG: Tech [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.NdefFormatable] Maximum transceive lenght: 253 bytes Default maximum transceive time-out: 618ms

Detailed protocol information: ID: 04:03:7E:AA:06:4F:81 ATQA: 0x4400 SAK: 0x00

Memory content: [00] 04:03:7E F1 (UID0-UID2, BCC0) [01] AA:06:4F:81 (UID3-UID6) [02] 62 48 0F E0 (BCC1, INT, LOCK0-LOCK1) [03] F1:10:FF:EE (0TP0-OTP3) [04] +r A5 00 00 00 |....| [05] +r 44 0C 37 48 |D.7H] ... [82] r 01 00 0F BD (LOCK2-LOCK4, CHK) [83] r 00 00 00 04 (CFG, MIRROR, AUTH0) [84] *r 5F 00 -- -- (ACCESS) [85] +P XX XX XX XX (PWD0-PWD3) [86] +P XX XX -- -- (PACK0-PACK1

AcK77 commented 7 years ago

The problem is when I calculate the Long UID, with certains of them (who can't be write on the NTAG - Read only). I have to see to fix it, but I just don't have time, I just need many UID of NTAG who's not working with AmiiBomb, to test if the calculation will be good! Please be patient. Thanks

kauden commented 7 years ago

Hi, Waiting for more UID, would it be possible to have an option to disable NTAG verification ? Thanks

PeggerWed commented 7 years ago

AcK77,

Like told, i'm willing to ship a few not working NTAG cards to you, i live in Belgium and shipping to France isn't a problem

Or i can at least read 20+ Long UID's from my batch and post in here.

If i'm not wrong i take the following numbers/letters to get the Long UID: (Example from my previous post)

Memory content: [00] 04:03:7E F1 (UID0-UID2, BCC0) [01] AA:06:4F:81 (UID3-UID6) [02] 62 48 0F E0 (BCC1, INT, LOCK0-LOCK1)

Seems the Long UID = 04037EF1AA064F8162


Memory content: [00] 04:03:7E F1 (UID0-UID2, BCC0) [01] AA:06:4F:81 (UID3-UID6)

and short UID is 04037EAA064F81

PeggerWed commented 7 years ago

LongUID (Empty cards) (for short UID just remove the bold stuff) 0441945952AF4F8032 0443CC0352AF4F8133 045E7BA952AF4F8133 04B6B08A52AF4F8032 04ADA38252AF4F8032

LongUID (Written Cards) 0457E13A52AF4F8032 04A67D5752AF4F8032 04A992B752AF4F8032 0450B56952AF4F8132

So i noticed, all cards that don't work on Amiibomb have 52AF4F8032 or 52AF4F8132 or 52AF4F8132 at the end

Those cards that did work on Amiibomb have AA064F8162 or AA064F8063

I know those numbers different for alot of cards, but It's a tip maybe :)

peacepenguin commented 7 years ago

Here's how tagmo is overcoming the problem.. scan the entire "raw" or "long" uid, then trim out the checksum bytes from "slot 3" to derive the "actual" or "short" uid.

Or the checksum could be calculated (somehow) to go the other direction and generate the long uid from the short uid.

Notice how it skips "pages0_1[3]" to generate the correct "short" uid from the first two pages. the long uid then is just the raw first two pages read it looks like.. not sure how to fix this in code, but the problem appears easy to overcome.

TagUtil.java

/**
 * Returns the UID of a tag from first two pages of data (TagFormat)
 */
public static byte[] uidFromPages(byte[] pages0_1) {
    //removes the checksum bytes from the first two pages of a tag to get the actual uid
    if (pages0_1.length < 8) return null;

    byte[] key = new byte[7];
    key[0] = pages0_1[0];
    key[1] = pages0_1[1];
    key[2] = pages0_1[2];
    key[3] = pages0_1[4];
    key[4] = pages0_1[5];
    key[5] = pages0_1[6];
    key[6] = pages0_1[7];
    return key;
}

Card UID: 04 51 3D BA E8 4C 81 Card SAK: 00 PICC type: MIFARE Ultralight or Ultralight C Page 0 1 2 3 0 04 51 3D E0 1 BA E8 4C 81 2 9F 48 0F E0 3 ...trimmed...

PeggerWed commented 7 years ago

Well, let's hope AcK77 can do something with all this info :)

Im willing to test a new Alpha release to see if the cards get working.

kauden commented 7 years ago

Hi, Do you have little progress on the subject ?

PeggerWed commented 7 years ago

Would like to know also.

Any news on progress about this problem would be great :)

kauden commented 7 years ago

Has the project died?

PeggerWed commented 7 years ago

I hope not, but no response and no update :/ Makes you wonder...

peacepenguin commented 7 years ago

Hey, project isn't dead, I'm using it successfully still. The code issue with long to short uid is documented in this thread. Take a stab at forking the code, modify your fork based on the notes here, then compile using visual studio 2017 community edition. Not super hard and you'll learn the fundamentals of software development and simultaneously be giving back to the community!

AcK77 commented 7 years ago

@peacepinguin: It's exactly what I think :)!

For all others who can't wait until I update AmiiBomb, Right now I don't have time to work on it! So be patient. Your NTAG works, it's just an error inside the UID calculation, I make AmiiBomb open source for get other people fix possible error or add functionality, but all I have it's people who claim there is a mistake "here" or "here"! So if you can't wait the fix, do it yourself :)!

Nothing mad here, anyone can understand I'm just busy.

PeggerWed commented 7 years ago

@AcK77 Thanks for the news update :)

I'm not mad or anything, i was just wondering :) As always, real life stuff is more important then anything else, so take your time. I hope i wasn't one of the people who claimed about mistakes here or there (except for this issue i started) but i think i provided helpfull info for it also.

@peacepenguin Well, i can't program, i don't have the power to get it inside my brains :D, i've tried but it just doesn't work, it's just, programming isn't compatible with my brains.

Maybe i do hope you could share your working version, so i can try out my ntags with it and can get started to have some fun with them.

With Kind Regards, Peg Wed

kokkie20 commented 7 years ago

@peacepenguin can you give me a direction where to look to adjust the code? Trying to find it tough i can't seem to get trough all the files lol. @AcK77 at first want to thank you for this project you made, realy love it and hope soon somebody will be able to help me out to fix it (At least where to look for this part to adjust) or hoping you have some day time to adjust the code (Do note; no rush, meanwhile i will search, and use a android phone. Tough rather do it trough this awesome program i just found out!)

peacepenguin commented 7 years ago

You know I'm not really sure where to find the code that handles the long uid and short uid conversions. I found the code in tagmo that seems related to this problem, and how they are stripping particular positions of the long uid to get to the short uid. For me the bigger question is this: what is actually failing when using these problematic NTAG215's. I couldn't interpret the error log posted to see exactly what the problem was. AcK77 mentioned that he thinks the problem exists in the short-long conversion, I'm just not sure where or when that conversion is necessary. But, finding the long- to short uid code in tagmo seems related to what AcK77 was saying is where the problem sits.

I'll take a look around the Amiibomb code to help, perhaps someone experiencing the error could post an english error dump log as well?

peacepenguin commented 7 years ago

Might have found a clue that may help, ack77 said: "Ok so, the problem is when I calculate Long UID based on the short UID readed from the tag..."

Where-as in Tagmo it seems they are reading the long uid from the card, then converting that to small uid.

Same as the dump-info pastes, the long uid is already there, so converting to short uid is easy, just use the tagmo technique of dropping the checksum bits from the long uid. Instead of the apparent technique used by amiibomb that is attempting to calculate the checksum bits based on the short uid. We should be able to store the initially read long uid for use later, instead of converting short to long when needed.

Does the checksum change after its written? Is there a reason the long uid needs to be calculated by the application, instead of read and stored by amiibomb on initial scan of the empty card?

quessith commented 7 years ago

Hmm good questions, hopefully tomorrow (its 9:18 pm here atm) or the day after tomorrow i will have my nfc reader for the arduino so i can do some more tests then i can do now... Then i can read out stuff and adjust codes to give me more information then i can get out of it now at the moment. Will take a look at certain things and hope can make a solution for it :)

peacepenguin commented 7 years ago

Ok found the area of code that will need reviewed to fix these problematic Ntag215's: AmiiBomb-uino/AmiiBomb/Flash_Form.cs. line 84 A variable is created with an external call, not sure where to find this external code that does the actual "GET". string NTAG_Short_UID = Arduino.SendCommand("/GET_NTAG_UID");

Then on line 92, the long uid is calculated and stored in a variable using an external library: string NTAG_Long_UID = BitConverter.ToString(Amiibo_Class.Calculate_Long_UID(NTAG_Short_UID)).Replace("-", "");

I would suggest implementing a new way to gather the long uid, then generate the short uid with the technique used by tagmo that i posted above. Note that tagmo is java, amiibomb is c#, so comparable code will need to be written.

Hope that helps push some smart developer in the right direction! I will also try to implement these fixes, and will post here if i have any success!

quessith commented 7 years ago

Yes this will help me to the correct direction :) Tough need to test some things first cause i modified the arduino program.... So hopefully i can get more information like i said above as soon as i have my nfc reader.... Then its a lot easier to debug certain stuff ! Thanks for the help so far :)

edit: this part; string NTAG_Short_UID = Arduino.SendCommand("/GET_NTAG_UID");

That sends a "command" to the arduino software to get the ntag.... Already rewritten that part, but like i said above... need my nfc reader to confirm it works as it should do :/

kokkie20 commented 7 years ago

Ok got my nfc reader, now need to test stuff to get the correct information that I need... So far no luck but will try other stuff to get it to work :)

olijouve commented 7 years ago

Hi, when i've tested amiibomb 10 days ago I had the same "Waiting for NTAG..." problem with my Tags. Was totally new to arduino and elegy rc522, running on a windows VM so I'd suspected that it would be too much for it run as excepted and i forgave. I've recode a flask python web ui that wraps amiitool, amiibo_tool bash and communicate with a modified write_amiibo to get bytes from serial...all of it to run on a raspberry pi with 3,5 inch lcd on top. I've succeeded in writing some dump, well recognized on my switch but randomly depending of the tags i use the process often fail with an "MIFARE PICC responded with NAK error".

My issue seems nearly similar as this #8 one, regarding to the random reproduction and the fact my NAK error is related to password auth process on the mirage side.

I just realize my lib MFRC522 was so out to date(v1.1.6 Jan 2016). miguelbalboa have been very active within the last year and the lib is now at v1.3.6(Mar 2017) and it has a fix for an auth problem with long UIDs since Jan 2017. https://github.com/miguelbalboa/rfid/blob/master/changes.txt

I can't see the versioning of the MFRC522 you're using in amibombuino. I need to find some time to give it a try on my code this week-end and see if can help to solve my issue. I'll let you know

olijouve commented 7 years ago

I've first test my proposed solution on amiibomb it seems i can now read the content of an amiibo on amiibombuino Dump with the updated MFRC522 lib. Now it can see my previously not detected Tags.

But i'm still stuck in the Create Tag action with the same "Waiting for NTAG..."

For a same Tag with the old lib my ID was: 04C7C388 2AAF4F80 and with the last updated one it is: 0493C3DC 2AAF4F80

If you want to test by yourself and give more feedback: Just rename and replace MFRC522.cpp and MFRC522.h with the fresh ones in the amibombuino folder and flash it again to your arduino.

olijouve commented 7 years ago

ok it definitely works for me in amiibomb in Writing tags. I removed the MFRC522 lib from amibombuino folder, update MFRC522 in the library manger of the official arduino studio and i flashed amiibombuino with my arduino with the arduino studio.

All my tag creation with amiibomb works like a charm now !!!

I'll also fix my raspberry app as i like the very convenient and portable way of creating amiibos.

kokkie20 commented 7 years ago

Hmm maybe updating it can indeed fix the problems. Maybe a idea for other people to try it who had the problems?

PeggerWed commented 7 years ago

Wel, it would be nice if somebody would provide a compiled versio we can download and just reflash the uno r3 with it. This is for all people who are not skilled in doing such stuff (like me)

AcK77 commented 7 years ago

I'll try to compile it, soon as possible, if anyone can't do it before!

kokkie20 commented 7 years ago

See my latest comment for the new "firmware" for the arduino (Updated)

Daisayah commented 7 years ago

Hi from germany. New news which one is needed?

kokkie20 commented 7 years ago

Sorry haven't heard anything yet from @AcK77 so cant help u for now :(

AcK77 commented 7 years ago

Hi,

You need the "with bootloader" file ;)! To get the hex files for the others boards, you have to select the board you want inside the Arduino IDE and compile to hex again. Nothing more :)!

kokkie20 commented 7 years ago

Ill re-upload correct ones in few hours from now :) thanks for the answer

kokkie20 commented 7 years ago

Recompiled the firmware for the arduino's Place it in the amiibomb folder and reupload it trough amiibomb. Not sure if i did correct, but according to what i read what AcK77 said it should work 👍 http://www.mediafire.com/file/5q3emofm16qms3f/lib.zip Enjoy !

@Daisayah (Just tagging for a new link for you with the updated firmware for the arduino 😄 )

Daisayah commented 7 years ago

Thanks a lot for your work. I flashed my arduino a few minutes before i go to work and everything works fine now. Reading and writing tags works correct now, later i check if i can use them with my 3DS XL and Switch.

Thanks André

kokkie20 commented 7 years ago

No problem, was easy to do :) Hopefully it fixes it for others to!

PeggerWed commented 7 years ago

Uploaded the uno.hex, still doesn't work with my ntags, so back to Tagmo on a borrowed nfc android phone. Thanks for the effort you all guys made to try to fix it for most of us.

Also i 1st tried to upload it through XLoader, but that gives a fail (previous ack77 hex works perfect to flash with xloader) so i used the internal writer, but i'm not sure if it does write the new hex, it says it did, buti think it doesn't

Screenshot in difference internal flashing

Internal: https://s28.postimg.org/ifntosj0t/amiibombhex.png

XLoader: https://s28.postimg.org/3lv5uyq3h/amiibombhex1.png