MFRC522, Nano/Uno/Mega, Serial/Ethernet
Tom,
I tried this latest version of the sketch on two combinations. The first was an Uno and single reader being used in Serial mode. Unfortunately it didn't work as hoped. It detected all six readers despite only one being connected. It didn't read any tags either on the Serial Monitor or JMRI.
The second combination was an Uno, Ethernet Shield and single reader. Again, it listed all six readers despite just one being connected. In did not read any tags in Serial Mode either on the Serial Monitor or JMRI. I then tried it with it connected to the network. Again it listed all readers, but would not read any tags on the Serial Monitor or JMRI. Switching JMRI to the network connection now. It listed all readers, then came up with 'Client Connected'. Unfortunately, it didn't read any tags. So we seem to have gone backwards here somewhere.
Just as a check on the hardware, I uploaded the Serial only sketch to the Uno/Reader combo. It listed one reader with the right connection and read the tags correctly. So that combo was okay. I then uploaded v6 of the Ethernet/Serial sketch to the Uno, Ethernet Shield and Reader combo. It correctly identified the reader and its connection, but as before, would only read a tag when connected to JMRI. So, same as before, but working as before and therefore correctly.
So I'm not sure what's happened there Tom? I wish I knew a bit more about coding but the Reader ID issue seems to have gone back to v5, which was solved in v6. I imagined that the Ethernet connection would be a sort of 'if, then, else' sort of argument. So IF the the shield is connected, THEN?connect to client and transmit the data on the Network and Serial, ELSE do not connect to client and transmit data on Serial only. I'm not sure if that sort of argument works on an Arduino, does it?
Anyway, hopefully you will have a few ideas on this.
Steve