4 Replies Latest reply on Feb 4, 2015 2:07 AM by paulpw

    Adafruit PN532 RFID board & Edison?

    ChemicalOli

      Does anyone know if the Adafruit PN532 RFID board is compatible with the Intel Edison Kit for Arduino board?

       

      I'm totally new to this so any advice or recommendations would be greatly appreciated!

       

      Thanks.

        • 1. Re: Adafruit PN532 RFID board & Edison?
          DiegoV_Intel

          Hi ChemicalOli,

           

          I've just searched for information about that shield and it seems to be compatible with the Edison Arduino kit at least in the hardware side since the shield uses an I2C interface and the Edison also has I2C interface. Regarding the software side, Adafruit offers the library for the shield however I'm not sure if it will work with Edison. Apparently it is compatible with Galileo, so you could try using it with the Edison in order to know if the library is also compatible with Edison.

           

          #if defined(__AVR__) || defined(__i386__) //compatibility with Intel Galileo
          

           

          Unfortunately I don't have the shield to test it and make sure it is 100% compatible, but if you decide to try using the shield I invite you to post your results in the Community.

           

          Regards,

          Diego.

          • 2. Re: Adafruit PN532 RFID board & Edison?
            ChemicalOli

            I've just tried the board now. Compiling one of the provided Adafruit sketches yields the following error message. Ignore the Galileo bit, I'm using an Edison

             

            Arduino: 1.5.3-Intel.1.0.4 (Windows 7), Board: "Intel® Edison"

             

            In file included from C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/Print.h:26:0,

                             from C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/Stream.h:26,

                             from C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/HardwareSerial.h:24,

                             from C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/TTYUART.h:5,

                             from C:\Arduino_Galileo\hardware\arduino\edison\variants\edison_fab_c/variant.h:20,

                             from C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/Arduino.h:33,

                             from C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:44:

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp: In static member function 'static void Adafruit_NFCShield_I2C::PrintHex(const byte*, uint32_t)':

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:142:18: note: in expansion of macro 'F'

                 Serial.print(F("0x"));

                              ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp: In static member function 'static void Adafruit_NFCShield_I2C::PrintHexChar(const byte*, uint32_t)':

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:173:20: note: in expansion of macro 'F'

                   Serial.print(F("0"));

                                ^

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:177:20: note: in expansion of macro 'F'

                   Serial.print(F(" "));

                                ^

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:180:16: note: in expansion of macro 'F'

               Serial.print(F("  "));

                            ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp: In member function 'boolean Adafruit_NFCShield_I2C::inDataExchange(uint8_t*, uint8_t, uint8_t*, uint8_t*)':

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:1147:20: note: in expansion of macro 'F'

                   Serial.print(F("Don't know how to handle this command: "));

                                ^

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:1153:20: note: in expansion of macro 'F'

                 Serial.println(F("Preamble missing"));

                                ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp: In member function 'boolean Adafruit_NFCShield_I2C::inListPassiveTarget()':

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:1201:24: note: in expansion of macro 'F'

                     Serial.println(F("Number of tags inlisted:"));

                                    ^

            C:\Arduino_Galileo\hardware\arduino\edison\cores\arduino/WString.h:37:93: error: 'PSTR' was not declared in this scope

            #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                                                                                                         ^

            C:\Workspace\Galileo\libraries\Adafruit_NFCShield_I2C\Adafruit_NFCShield_I2C.cpp:1207:20: note: in expansion of macro 'F'

                   Serial.print(F("Tag number: "));

                                ^

            • 3. Re: Adafruit PN532 RFID board & Edison?
              DiegoV_Intel

              Hi ChemicalOli,

               

              I've just tried to compile the code in the Intel Arduino IDE, but I wasn't able to do it. It seems that the library is not compatible with the Edison. However, there is a workaround in this thread (Galileo thread) Re: 2.8" TFT V2 and Galileo Problem for the library of a TFT from Adafruit to make it compatible with the Galileo board, and I believe it works with the Edison as well.

               

              The solution for the TFT library is to edit the Arduino.h file. So I tried this same workaround for this library and I was able to compile the code with no errors for the Galileo and the Edison, but since I don't have the shield I can't test it to make sure it is working.

               

              You could try it as well to check if the workaround works for this library too.

               

              Regards,

              Diego.

              • 4. Re: Adafruit PN532 RFID board & Edison?
                paulpw

                Hi,

                I had the exact same problem and have a work around that I have verified as I have the adafruit NFC shield.

                The file you need to change for the Edison is /usr/local/arduino-1.5.3-Intel.1.0.4/hardware/arduino/edison/cores/arduino/WString.h

                (This file exists in ....../x86/... as well but used by Galileo or other boards).

                Just remove "PSTR", my changes are below,  the adafruit library "Adafruit_NFCShield_I2C" (+ all the code examples) will then work.

                "

                class __FlashStringHelper;

                //#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

                #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>((string_literal)))

                "

                 

                Regards

                Paul W

                1 of 1 people found this helpful