Plugin for RFID Reader RDM6300

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Plugin for RFID Reader RDM6300

#1 Post by Thotti » 11 Oct 2016, 15:36

I'm trying to develop a plugin for the RFID Reader Module RDM6300.
Is ist connected via the Serial RX PIN on my NodeMCU.

In my plugin i read the serial data via hardware serial.
I read the serial data in the function PLUGIN_TEN_PER_SECOND and put the result in UserVar[event->BaseVarIndex].
Is this the correct way of reading serial data?

But Something must be wrong. I always get wrong data.
The nearly same code of collecting the rfid tag from the serial data works on my arduino in the loop function.

Any ideas what could be wrong?

Martinus

Re: Plugin for RFID Reader RDM6300

#2 Post by Martinus » 11 Oct 2016, 15:58

Have a look at the Ser2Net plugin (020). You can use this call:

case PLUGIN_SERIAL_IN:
{
}

There can be one plugin active that intercepts hardware serial data.

Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Re: Plugin for RFID Reader RDM6300

#3 Post by Thotti » 14 Oct 2016, 09:55

Thanks.
I put my code into:

case PLUGIN_SERIAL_IN:
{
}

In the log i can see the RFID Tag by printing UserVar[event->BaseVarIndex].
But it seems that it is not accessable in the rules and the value of "Tag" is also not shown on the "devices page".
The event for that device is never triggered. The device is named "RFID" and the Variablename is "Tag".
So it should be accessable via RFID#Tag, shouldn't it?

Any idea?

Martinus

Re: Plugin for RFID Reader RDM6300

#4 Post by Martinus » 14 Oct 2016, 13:30

You asked how to read serial data, and using the case PLUGIN_SERIAL_IN call is the way to go. Making a working plugin is another thing ;)

This is how it should basically work when the data is received and processed, sample from the RFID plugin 008:

Code: Select all

UserVar[event->BaseVarIndex] = (Plugin_008_keyBuffer & 0xFFFF);
UserVar[event->BaseVarIndex + 1] = ((Plugin_008_keyBuffer >> 16) & 0xFFFF);
String log = F("RFID : Tag: ");
log += Plugin_008_keyBuffer;
addLog(LOG_LEVEL_INFO, log);
sendData(event);
Do you run the sendData function call in your plugin?

Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Re: Plugin for RFID Reader RDM6300

#5 Post by Thotti » 14 Oct 2016, 19:21

This is my code:

Code: Select all

case PLUGIN_SERIAL_IN:
      {
        if (Plugin_034_init)
        {
            Plugin_034_receivedTag = false;
            
            if(Serial.available() > 0) {          // if data available from reader 
              if((val = Serial.read()) == 2) {   // check for header 
                bytesread = 0; 
                while(bytesread<10) {              // read 10 digit code 
                  if( Serial.available() > 0) { 
                    val = Serial.read(); 
                    if((val == 2)||(val == 3)) { // if header or stop bytes before the 10 digit reading 
                      break;                       // stop reading 
                    } 
                    Plugin_034_tagNumber[bytesread] = val;         // add the digit           
                    bytesread++;                   // ready to read next digit  
                  } 
                } 
                if(bytesread == 10) {              // if 10 digit read is complete 
                  Plugin_034_receivedTag = true;
                  //Serial.print("TAG code is: ");   // possibly a good TAG 
                  //Serial.println(code);            // print the TAG code 
                } 
                bytesread = 0; 
              } 
            } 

            if(Plugin_034_receivedTag){
              unsigned long Plugin_034_keyBuffer = Plugin_034_hex2int(Plugin_034_tagNumber, 10);
              UserVar[event->BaseVarIndex] = (Plugin_034_keyBuffer & 0xFFFF);
              UserVar[event->BaseVarIndex + 1] = ((Plugin_034_keyBuffer >> 16) & 0xFFFF);
              
              String log = F("RFID : Tag: ");
              log += UserVar[event->BaseVarIndex];
              addLog(LOG_LEVEL_INFO, log);
              sendData(event);
              success = true;

              //memset(Plugin_034_tagNumber,0,sizeof(Plugin_034_tagNumber));
              // this clears the rest of data on the serial, to prevent multiple scans
              while (Serial.read() >= 0) {
                Serial.flush(); // trying
              }
              delay(500);
            }
            
        }
        break;
      }
What could be the problem?

Martinus

Re: Plugin for RFID Reader RDM6300

#6 Post by Martinus » 14 Oct 2016, 20:03

Let me have another look at the ESP Easy internals. It may well be that this is not directly supported yet, as no other serial plugin refers back to it's task.

Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Re: Plugin for RFID Reader RDM6300

#7 Post by Thotti » 17 Oct 2016, 08:18

Did you already have a look at the ESP Easy internals? ;-)

Martinus

Re: Plugin for RFID Reader RDM6300

#8 Post by Martinus » 20 Oct 2016, 16:02

Thotti wrote:Did you already have a look at the ESP Easy internals? ;-)
I did and it will not work without some workarounds.

But i also googled on RDM6300 and it looks like the output could be similar to a RFID device that i've used on the old Nodo project:
ID12LA.jpg
ID12LA.jpg (21.84 KiB) Viewed 6029 times
It's an ID-12LA from ID Innovations and produces serial output. I have a working plugin that i can push to the playground.

The Nodo Shop also sells the RDM6300. If Nodo users have been using this reader with the RFID Nodo plugin, than it should also work with this ESP Easy plugin without modifications.

Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Re: Plugin for RFID Reader RDM6300

#9 Post by Thotti » 20 Oct 2016, 18:37

That would be great. Can you push it to the playground?
I would like to check it out. :-)

Martinus

Re: Plugin for RFID Reader RDM6300

#10 Post by Martinus » 21 Oct 2016, 17:06

Thotti wrote:That would be great. Can you push it to the playground?
I would like to check it out. :-)
Pushed to the playground.
Please check if P116 works for this device.

Thotti
Normal user
Posts: 7
Joined: 08 Oct 2016, 13:43

Re: Plugin for RFID Reader RDM6300

#11 Post by Thotti » 22 Oct 2016, 09:40

Thank you very much! It works with the RDM6300. :D

ludogomez
Normal user
Posts: 2
Joined: 18 Mar 2017, 21:10

Re: Plugin for RFID Reader RDM6300

#12 Post by ludogomez » 18 Mar 2017, 21:14

Hi,

I try the plugin with RDM6300 and it's not working.

I connect the RDM6300 on RX on my wemos D1 mini and I can't read my tags.

Can you send me an advice ?
Please

Thanks a lot,
Regards

dumdidum
Normal user
Posts: 5
Joined: 30 Jan 2017, 17:19

Re: Plugin for RFID Reader RDM6300

#13 Post by dumdidum » 17 May 2017, 13:54

hi,
is it possible to change the plugin to read the full 10 digits - for now i get only 8.
so the card 7800108b38 gets read as 00108b38.
a checkbox to get a hex or dec value would also be nice.

dumdidum
Normal user
Posts: 5
Joined: 30 Jan 2017, 17:19

Re: Plugin for RFID Reader RDM6300

#14 Post by dumdidum » 18 May 2017, 13:48

is it possible to have a string as a sensor value ?
the long int store only 32bit em4001 cards have 40bit
so that was the reason why one byte is missing here.

fraeggle
Normal user
Posts: 21
Joined: 20 Nov 2017, 20:12

Re: Plugin for RFID Reader RDM6300

#15 Post by fraeggle » 28 Apr 2018, 13:53

When i try to compile with this plugin i allways get an error.

invalid conversion from 'unsigned int*' to 'int' [-fpermissive]

event->idx = Settings.TaskDeviceID[index];

Regards Peter

Naesstrom
Normal user
Posts: 21
Joined: 02 Jun 2017, 21:02

Re: Plugin for RFID Reader RDM6300

#16 Post by Naesstrom » 08 Jul 2018, 00:57

Is this now included in the latest normals?

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests