Plugin for RFID Reader RDM6300
Moderators: grovkillen, Stuntteam, TD-er
Plugin for RFID Reader RDM6300
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?
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?
Re: Plugin for RFID Reader RDM6300
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.
case PLUGIN_SERIAL_IN:
{
}
There can be one plugin active that intercepts hardware serial data.
Re: Plugin for RFID Reader RDM6300
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?
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?
Re: Plugin for RFID Reader RDM6300
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:
Do you run the sendData function call in your plugin?
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);
Re: Plugin for RFID Reader RDM6300
This is my code:
What could be the problem?
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;
}
Re: Plugin for RFID Reader RDM6300
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.
Re: Plugin for RFID Reader RDM6300
Did you already have a look at the ESP Easy internals?
Re: Plugin for RFID Reader RDM6300
I did and it will not work without some workarounds.Thotti wrote:Did you already have a look at the ESP Easy internals?
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:
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.
Re: Plugin for RFID Reader RDM6300
That would be great. Can you push it to the playground?
I would like to check it out.
I would like to check it out.
Re: Plugin for RFID Reader RDM6300
Pushed to the playground.Thotti wrote:That would be great. Can you push it to the playground?
I would like to check it out.
Please check if P116 works for this device.
Re: Plugin for RFID Reader RDM6300
Thank you very much! It works with the RDM6300.
Re: Plugin for RFID Reader RDM6300
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
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
Re: Plugin for RFID Reader RDM6300
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.
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.
Re: Plugin for RFID Reader RDM6300
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.
the long int store only 32bit em4001 cards have 40bit
so that was the reason why one byte is missing here.
Re: Plugin for RFID Reader RDM6300
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
invalid conversion from 'unsigned int*' to 'int' [-fpermissive]
event->idx = Settings.TaskDeviceID[index];
Regards Peter
Re: Plugin for RFID Reader RDM6300
Is this now included in the latest normals?
Who is online
Users browsing this forum: Google [Bot] and 122 guests