Grove nfc- help

boron
mesh
Tags: #<Tag:0x00007fe21f201210> #<Tag:0x00007fe21f2010d0>

#1

So i have been following this wiki for the grove NFC (http://wiki.seeedstudio.com/Grove_NFC/) but i’ve been facing a lot of errors in the library when compiling locally. I have been using the reference in Particle docs (https://docs.particle.io/reference/device-os/firmware/boron/#nfc_) however i can’t figure out how to make it work, it keeps asking for “Particle.h” library which cannot find. Can someone help guide me through reading NFC tags using a Boron. i currently have a Boron connected to a grove shield with the NFC grove v1.1 connected through UART.


#2

Who cannot find that file?
Have you tried just adding #include <Particle.h> in your .h file?

Would be useful to post which errors that are and also what IDE you are using for local compiling?
The video you are watching there in your photo is using Web IDE.


#3

I went through the example in the reference documents with no issues using the antenna attached to the NFC uFL connector on the Gen3 devices first.

I have also built a feather adaptor to use an I2C PN532 based NFC board. This took a bit of time to get working as there is an IRQ connection that needs to connected otherwise it doesn’t work! Further questions - with the SEEED board you using serial are you sure that it is correctly connected to the Boron - there appear to be no LEDs on the NFC board lit!


#4

These are the problems that i am facing. i also found this github repo that i am trying to use (https://github.com/peacemoon/GroveNFC). This is the youtube video i am using as a reference (https://www.youtube.com/watch?v=bflX8n-w5Kg). I also downloaded arduino and its not letting me add the examples manually or through sketch as a zip!
48%20PM 09%20AM


#5

Is it possible to show me a picture of “NFC uFL connector on the Gen3 devices " and " the feather adapter you built”. And no the NFC board never lit up. would this be because i haven’t found a library for the grove NFC?


#6

These appear to the IntelliSense messages, not necessarily causing actual build errors.
Try compiling and see whether they turn out to be wrong flags.

Have you created the Project via the dedicated Workbench task?
image

How and where have you added the GroveNFC library?

Can you share a screenshot of your entire Workbench window with the project explorer open?


#7

This is the feather adaptor.

The NFC uFL is under the microUSB on the underside of each Gen3 device.

As for the library I used - I found an Arduino library for the PN532 using I2C and adapted it for Photon and then last year ported to use with a Xenon. The IRQ line is likely to be the problem, I don’t know how the SEEED board controls this.


#8

Here is an upload for my VS studio, i downloaded the file on my desktop and i did not create a project. i basically opened the Grove-master and tried to compile locally where this happens.

Still trying on Arduino ide i finally figured out how to upload the zip in sketch. However now when i try to upload it i get this error and i cant find what serial1 is in the scope. (if anyone has used arduino’s ide) also lets say the Arduino Library works, would i be able to program my devices through there or can i work on that library on VS studio.


#9

The Arduino IDE is not capable of building binaries for Particle devices.

You also got one error WiFi not declared which is absolutely expected since you are targeting a Boron which has no WiFi connection.

Next the GroveNFC and PN532-arduino folders should probably be placed inside the lib folder, but I’m rather expecting you won’t need them at all as there already is a ported library for the PN532 board.


#11

So i am currently trying to fix the errors. Yes that’s what i thought about the libraries. i will check WiFi not declared and see how it can be edited. Would it be easier to try to run it on the Particle IDE? but how can that work if there is no libraries i can use for the grove NFC.

Also, i keep getting this but don’t know what to do with it 58%20AM


#12

So i just compiled the project locally and compiled successfully. This is how to looks like in terminal

.

But when i try to compile on the cloud for my boron this is what happens


#13

When you are cloud compiling and use a library that’s available in the cloud any changes you made in your local copy will not be used for the cloud build but the cloud based version will be used.

To prevent that you’d need to edit the project.properties file and remove/comment the respective dependency line.


#14

Now when i try to run locally i get the same errors as initially. Let me ask this; what is the easiest way to get a helloworld out of my grove NFC using particles IDE or via VS code?

these are the libraries i found i have been looking at:

https://github.com/Seeed-Studio/Seeed_Arduino_NFC --> for Arduino doesn’t work on Particle IDE

GitHubGitHub

Seeed-Studio/Seeed_Arduino_NFC

NDEF Library for Arduino. Read and Write NDEF Messages to NFC tags with Arduino. - Seeed-Studio/Seeed_Arduino_NFC

https://github.com/peacemoon/GroveNFC --> library last edited 2017 too many errors

GitHubGitHub

peacemoon/GroveNFC

Contribute to peacemoon/GroveNFC development by creating an account on GitHub.

(https://sunvessel.slack.com/archives/DP7DQ84DT/p1573137324004700)

https://github.com/Brewskey/Brewskey.Device --> Last edited was May 2019, basically a clone of peacemoon/GroveNFC

GitHubGitHub

Brewskey/Brewskey.Device

Brewskey Kegerator using Particle P1/Photon. Contribute to Brewskey/Brewskey.Device development by creating an account on GitHub.

https://github.com/Seeed-Studio/PN532/blob/arduino/PN532_I2C/PN532_I2C.h–> PN532 library for arduino


#15

Just use the Particle ported Adafruit library :wink:
https://build.particle.io/libs/Adafruit_PN532/0.0.1/tab/Adafruit_PN532.cpp

I’d have to test again, but I did get the Grove shield to work with it just fine.


#16

Okay i will try that now. By any chance do you have reference or code i can look at or use as a guide?


#17

This does some other things too, but that was what I did last on it
https://go.particle.io/shared_apps/5d2ef90439259500156ab7c1


#18

Okay thats great !!! i can use this to help me with using the libraries. By any chance do you have a picture of the hardware setup?


#19

Nope, it’s quite a while since I’ve played with that.


#20

how can i call the Grove NFC thats attached in my grove shield to work for this example. My setup is currently a boron on a grove shield where Grove NFC is connected through UART and Chainable LED connected through D2

#include "Particle.h"

SerialLogHandler logHandler(LOG_LEVEL_TRACE);

static void nfcCallback(nfc_event_type_t type, nfc_event_t* event, void* context);

int counter = 0;
volatile bool updateCounter = true;

void setup (void) {
    pinMode(D7, OUTPUT);
    digitalWrite(D7, 0);
}

void loop(){
    if (updateCounter) {
        updateCounter = false;

        char buf[64];
        snprintf(buf, sizeof(buf), "testing counter=%d", ++counter);

        NFC.setText(buf, "en");
        NFC.on(nfcCallback);

        Log.info("next read should show: %s", buf);
    }
}

static void nfcCallback(nfc_event_type_t type, nfc_event_t* event, void* context) {
    switch (type) {
    case NFC_EVENT_FIELD_ON: {
        digitalWrite(D7, 1);
        break;
    }
    case NFC_EVENT_FIELD_OFF: {
        digitalWrite(D7, 0);
        break;
    }
    case NFC_EVENT_READ: {
        updateCounter = true;
        break;
    }
    default:
        break;
    }
}

#21

The code I shared with you above uses I2C and your device also supports I2C, you’d only need to change the solder-jumper like shown here and connect to a I2C/Wire connector on your base shield.