Arduino library compatibility question

Hey all!

New here but I’ve got a bit of an odd technical question. I’m working on some code for the propboard in the arduino IDE. One of the features I’m looking to implement needs a particular module, an RDM6300 rfid reader.

All the recommendations I’ve found online say this module works best with the SoftwareSerial.h library, specifically so I can setup a serial port on different pins thats the default. However that library isn’t compatible with the M4 processor on the propboard. I’m still looking at a few work arounds, but the standard serial library is missing a few useful functions that SoftwareSerial.h can do.

I was wondering if anyone had any suggestions? Or if anyone knew of a version of the SoftwareSerial.h library that works with the M4?

Any suggestions would be great! Thanks!

Hi @Drew_Bester,

I’m not aware of any particular features SoftwareSerial can do that a physical serial port can’t. In fact, the SoftwareSerial library is there mostly as a hack (because the original Arduino Uno has a single serial port that is being used for downloading sketches). Perhaps you can point me to these recommendations?

By the way. Are you using some library for the RDM6300? Like this one?

If so, you might use the spare serial port of the PropBoard (pin 0 and 1, as highlighted here).

For example, you can try the following:

#include <rdm6300.h>

Rdm6300 rdm6300;

void setup()
    // etc...

It’s better explained in the library’s example for HW serial port.

Note: I didn’t test the library or the RDM6300.

Thanks for the help!

When I said “recommendations” I meant “example code”. Embaressingly I was not even aware of a specific libray for the RDM6300! Thanks for that!

I continue to experiment. Very much a fan of the your work!

No problem. Let me know how it goes.

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

Hello @Drew_Bester

Sorry for the late reply. I’m glad it’s working now.

However, I still think that it might be possible to use a hardware serial port (as I wrote in the example from my post above). I see this line in the library that indicates that the Class accepts a Stream at construction, and thus, a probably hardware serial.

But if it’s working with your own code, then it’s even better!