mreugen
Posts: 2
Joined: Tue Oct 29, 2019 9:22 am

PN532 Module over I2C using Java

Tue Oct 29, 2019 9:29 am

Hi guys,

currently I'm thinking about a project which will allow user to send information from a phone to server via PN532 NFC Module.

I'm stuck thinking about how to read I2C messages from PN532 with Java.
My first idea is to write java code to continuously read data from PN532 over I2C in a while loop, but I think there could be another, better way to do it. Could you tell me another way I could make my RPi continuously waiting for messages from PN532.

Thank you,

Have a nice day.

raspjava
Posts: 2
Joined: Fri Nov 08, 2019 7:47 pm

Re: PN532 Module over I2C using Java

Fri Nov 08, 2019 8:00 pm

Hi mreugen,

First you may check your settings. ( http://wiki.sunfounder.cc/index.php?tit ... FID_Module ) This link also shows some solutions

Waiting for messages to arrive is waisting resources. These kind of actions are usually done by means of an event. It''s like an IRQ in the old days of the computers. It has the advantage that your raspberry pi can take care of other duties. When receiving an event it can actually pause all other duties and take care off handling the reading of data like you would like it to.

What is the purpose of reading messages ? I mean, what would you like to do with the information you receive ?

Kind regards

mreugen
Posts: 2
Joined: Tue Oct 29, 2019 9:22 am

Re: PN532 Module over I2C using Java

Sat Nov 09, 2019 2:40 pm

raspjava wrote:
Fri Nov 08, 2019 8:00 pm
Hi mreugen,

First you may check your settings. ( http://wiki.sunfounder.cc/index.php?tit ... FID_Module ) This link also shows some solutions

Waiting for messages to arrive is waisting resources. These kind of actions are usually done by means of an event. It''s like an IRQ in the old days of the computers. It has the advantage that your raspberry pi can take care of other duties. When receiving an event it can actually pause all other duties and take care off handling the reading of data like you would like it to.

What is the purpose of reading messages ? I mean, what would you like to do with the information you receive ?

Kind regards
Hi, thank you for your reply.

I want to write the information into a data base.

Return to “Java”