Connect 2 devices: Ethernet Shield and RC522

Hi,

I have a problem with my Ethernet shield and RC522. I want to send data from RC522 to Ethernet.

When I put one RC522 without Ethernet, it works perfectly. But when I connect the Ethernet, the both doen't work.

Thank you so much.

code_lan_1.ino (3.6 KB)

the both doen't work.

"the both" "doe" something. You need to describe what the code actually does, and how that differs from what you want.

I see that you started with the absolutely atrocious crap example that assumes that you want to do nothing but deal with valid data read from a card.

Change the logic around so that it does NOT use the ! operator and does NOT return when something doesn't go its way.

PaulS:
"the both" "doe" something. You need to describe what the code actually does, and how that differs from what you want.

I see that you started with the absolutely atrocious crap example that assumes that you want to do nothing but deal with valid data read from a card.

Change the logic around so that it does NOT use the ! operator and does NOT return when something doesn't go its way.

I'm sorry about my mistakes. I want to get UID from module RC522, then send this UID to localhost(172.16.40.95).

But after loading the program, I just get UID from serial mornitor, without access to localhost.

Is the Arduino supposed to be a server or a client? A client makes requests, asking a server to do something, possibly with some data.

A server responds to GET requests and does something.

Your code appears to be having the Arduino act as a server, where it ONLY responds to GET requests when there is a new tag read correctly.

The data that is returned to the client, in the event that one connects at just the right time, does not include the data read from the tag.

It is very unclear what you are trying to do.

If it were me, my Arduino would be acting as a client, making a GET request to a server, when a tag had been read, containing data read from the tag.