I thought I’d post a little update as I’ve come to the conclusion that the RDM6300 rfid reader was the wrong choice for what I was trying to do. Also it bugs me when I find things on forums where people solve their issues and then not post that solution!
For anyone interested I swapped to working with the Gwiot7941e rfid reader, mostly because the antenna shape is better suited to physically fit where I need it to! Also the RDM6300 spits out a continueous stream of serial data (which continues for about 1.5 minutes after the tag is removed), where as the 7841e only spits out the detected code once (which much better suits what I’m doing!).
Anyway so the RDM6300.h library mentioned above relies on the softwareserial.h library (even when running in dedicated hardware serial mode) and so just isnt really compatible with the propboards M4 processor. This seems to be a common thing amoungst other rfid reader libraries as well.
I imagine that with time (and a little more ability from me!) I could get the softwareserial.h library to work. But thats not something I can do right now.
The work around for all this I’ve found is to connect the rfid reader to the propboards serial pins (0 & 1) and then manually read the serial data. I used a for loop, storing the data in a char array, 14bytes long for the RDM6300 reading EM4100 type tags (10bytes for the 7941e reading the same tags). From there I can search in the array using strchr command to find the start character I’m looking for.
Worth pointing out the RDM6300 outputs hexidecimal data, where as the Gwiot7941e outputs decimal data (well its actually hex, but the module pre-converts it to decimal before sending it), so convert it as needed. Then store the detected tag using strtoul command (which converts the char array into an int, and also converts hex to decimal).
After that I basically ran the code twice to make sure I got a consistant data reading. Since the RDM6300 continually writes to the serial buffer sometimes bytes get mixed up. I found reading twice and checking the codes matched worked well enough. I also included some error detection for what I know I expect to see. By that I mean all my tags that I’m using have a code that starts with either a 3 or 4, so the code throws out any results that dont start with 3 or 4.
After that I just store the tag code and let the rest of the code carry on. Oh and also during testing its really helpful to have the propboard write data to the usb serial port. So you can follow that its doing things you expect it to.
Hope thats in any way helpful to anyone in a similar situation!
TLDR: dont bother with RFID reader libraries when using the propboard. Use hardware serial1 (pins 0 & 1) and write your own code!
Edit: I’m bad at spelling