Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. RFID Reader ID-3LA

RFID Reader ID-3LA

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 2 Posters 2.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jeti
    wrote on last edited by
    #1

    Hello everybody,

    i am trying to establish a node with a RFID reader to recognice which Resident is at home. Therefore I have a ID-3LA including antenna.
    The reader works fin with this sketch:

    #include <SoftwareSerial.h>
    
    SoftwareSerial rfid = SoftwareSerial(5, 6);
    String msg;
    
    void setup()  
    {
      Serial.begin(9600);
      rfid.begin(9600);
      Serial.println("Ready");
    }
    
    void loop(){
      msg = "";
      
      while(rfid.available()>0) {
        msg += char(rfid.read());
        delay(1);
      }
      
      if(msg.length() >= 13) {
         msg=msg.substring(1,13);
         tone(4, 262, 100);
         Serial.println(msg);
      }
    }
    

    this code results on the serial Monitor with 9600 baud in something like:

    Ready
    0100B058FD14

    which is excactly what i want (for now).

    But Iam strugeling implementing it into MySensors, that is what i came up with:

    /**
     * ID-3LA       Arduino
     * -----      -------
     * GND   ->   GND
     * VCC   ->   +3.3V
     * D0   ->   D5
     * D1   ->   D6
     * FORM -> GND
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #define MY_NODE_ID 102 
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <SoftwareSerial.h>
    
    SoftwareSerial rfid = SoftwareSerial(5, 6);
    String key;
    
    #define CHILD_ID 1   // Id of the sensor child
    
    MyMessage KeyMsg(CHILD_ID, V_VAR1);
    
    void setup()  
    {
      Serial.begin(9600);
      rfid.begin(9600);
      //Serial.println("Ready");
    }
    
    void presentation()  {
      sendSketchInfo("RFID Reader", "1.0");
      present(CHILD_ID, S_CUSTOM);
    }
    
    void loop(){
      key = "";
      
      while(rfid.available()>0) {
        key += char(rfid.read());
        delay(1);
      }
      
      if(key.length() >= 13) {
         key=key.substring(1,13);
         Serial.println(key);
         send(KeyMsg.set(key)); 
         
         
      }
    } 
    

    but i do not get any readings... as i still consider myself as a started i have very little clou where to beginn finding the wrong/missing parts. It would be great to get some indications or tips.

    thanks in advance!

    mfalkviddM 1 Reply Last reply
    0
    • J jeti

      Hello everybody,

      i am trying to establish a node with a RFID reader to recognice which Resident is at home. Therefore I have a ID-3LA including antenna.
      The reader works fin with this sketch:

      #include <SoftwareSerial.h>
      
      SoftwareSerial rfid = SoftwareSerial(5, 6);
      String msg;
      
      void setup()  
      {
        Serial.begin(9600);
        rfid.begin(9600);
        Serial.println("Ready");
      }
      
      void loop(){
        msg = "";
        
        while(rfid.available()>0) {
          msg += char(rfid.read());
          delay(1);
        }
        
        if(msg.length() >= 13) {
           msg=msg.substring(1,13);
           tone(4, 262, 100);
           Serial.println(msg);
        }
      }
      

      this code results on the serial Monitor with 9600 baud in something like:

      Ready
      0100B058FD14

      which is excactly what i want (for now).

      But Iam strugeling implementing it into MySensors, that is what i came up with:

      /**
       * ID-3LA       Arduino
       * -----      -------
       * GND   ->   GND
       * VCC   ->   +3.3V
       * D0   ->   D5
       * D1   ->   D6
       * FORM -> GND
       */
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #define MY_NODE_ID 102 
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <SoftwareSerial.h>
      
      SoftwareSerial rfid = SoftwareSerial(5, 6);
      String key;
      
      #define CHILD_ID 1   // Id of the sensor child
      
      MyMessage KeyMsg(CHILD_ID, V_VAR1);
      
      void setup()  
      {
        Serial.begin(9600);
        rfid.begin(9600);
        //Serial.println("Ready");
      }
      
      void presentation()  {
        sendSketchInfo("RFID Reader", "1.0");
        present(CHILD_ID, S_CUSTOM);
      }
      
      void loop(){
        key = "";
        
        while(rfid.available()>0) {
          key += char(rfid.read());
          delay(1);
        }
        
        if(key.length() >= 13) {
           key=key.substring(1,13);
           Serial.println(key);
           send(KeyMsg.set(key)); 
           
           
        }
      } 
      

      but i do not get any readings... as i still consider myself as a started i have very little clou where to beginn finding the wrong/missing parts. It would be great to get some indications or tips.

      thanks in advance!

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @jeti could you post the debug output of the node? I looked at the sketch but didn't notice anyhong suspicious.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jeti
        wrote on last edited by
        #3

        so this is the debug:
        I also just figurer out, that i can only see the tag code when i use 9600 baud, thats why the first line is messed up. When i use 115200 baud the tag ID does not show up...

        ¸Ëÿi"ùŸÒ9q„Š3ñ“â@Ù8>‹`ÿÊ<›Ð%ŠÆ/t6þTSP:MSG:SEND 102-102-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
        TSP:MSG:SEND 102-102-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
        TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
        TSP:MSG:READ 0-0-102 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
        TSP:MSG:READ 0-0-102 s=255,c=3,t=6,pt=0,l=1,sg=0:M
        TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=ok:RFID Reader
        TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
        TSP:MSG:SEND 102-102-0-0 s=1,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=ok:
        Request registration...
        TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
        TSP:MSG:READ 0-0-102 s=255,c=3,t=27,pt=1,l=1,sg=0:1
        Node registration=1
        Init complete, id=102, parent=0, distance=1, registration=1
        TSP:MSG:READ 154-154-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
        TSP:MSG:BC
        0100B058FD1
        TSP:MSG:SEND 102-102-0-0 s=1,c=1,t=47,pt=1,l=1,sg=0,ft=0,st=ok:1
        0100B058FD1
        TSP:MSG:SEND 102-102-0-0 s=1,c=1,t=47,pt=1,l=1,sg=0,ft=0,st=ok:1
        TSP:MSG:READ 154-154-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
        TSP:MSG:BC
        

        can it be the case the the format of the tag ID is not correct?

        thanks

        mfalkviddM 1 Reply Last reply
        0
        • J jeti

          so this is the debug:
          I also just figurer out, that i can only see the tag code when i use 9600 baud, thats why the first line is messed up. When i use 115200 baud the tag ID does not show up...

          ¸Ëÿi"ùŸÒ9q„Š3ñ“â@Ù8>‹`ÿÊ<›Ð%ŠÆ/t6þTSP:MSG:SEND 102-102-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
          TSP:MSG:SEND 102-102-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
          TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
          TSP:MSG:READ 0-0-102 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
          TSP:MSG:READ 0-0-102 s=255,c=3,t=6,pt=0,l=1,sg=0:M
          TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=ok:RFID Reader
          TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
          TSP:MSG:SEND 102-102-0-0 s=1,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=ok:
          Request registration...
          TSP:MSG:SEND 102-102-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
          TSP:MSG:READ 0-0-102 s=255,c=3,t=27,pt=1,l=1,sg=0:1
          Node registration=1
          Init complete, id=102, parent=0, distance=1, registration=1
          TSP:MSG:READ 154-154-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
          TSP:MSG:BC
          0100B058FD1
          TSP:MSG:SEND 102-102-0-0 s=1,c=1,t=47,pt=1,l=1,sg=0,ft=0,st=ok:1
          0100B058FD1
          TSP:MSG:SEND 102-102-0-0 s=1,c=1,t=47,pt=1,l=1,sg=0,ft=0,st=ok:1
          TSP:MSG:READ 154-154-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
          TSP:MSG:BC
          

          can it be the case the the format of the tag ID is not correct?

          thanks

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @jeti Looks like it has no trouble reading the tag, the print fro the node matches the one you got with the first sketch. st=ok means that the gateway acknowledged the message so it got through alright.

          What does the gateway receive? (could you post the debug log?)

          1 Reply Last reply
          0
          • mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

            I think the problem is that Domoticz doesn't support V_VAR1. This post suggests to use V_TEXT instead.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jeti
              wrote on last edited by jeti
              #6

              I am using FHEM as controller.

              Log of the gateway:

              0;255;3;0;9;TSP:MSG:READ 102-102-0 s=1,c=1,t=24,pt=1,l=1,sg=0:1
              102;1;1;0;24;1

              so it receives a "1" correct?
              Can Mysesnors handle strings?

              mfalkviddM 1 Reply Last reply
              0
              • J jeti

                I am using FHEM as controller.

                Log of the gateway:

                0;255;3;0;9;TSP:MSG:READ 102-102-0 s=1,c=1,t=24,pt=1,l=1,sg=0:1
                102;1;1;0;24;1

                so it receives a "1" correct?
                Can Mysesnors handle strings?

                mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by
                #7

                @jeti Yes that is correct.

                https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/4 has info on how to read the debug messages.

                pt=1 means payload type 1. Payload type 1 is "byte". According to https://www.mysensors.org/download/serial_api_20#variable-types V_VAR1 has a custom type. I don't know what that means, but it looks like the MySensors library interprets that as a byte, which won't be very useful for sending an RFID tag. I have not used the custom variable types and I don't know how they work unfortunately.

                Yes, MySensors handles strings. Use S_INFO and V_TEXT as suggested in the post I linked to above.

                J 1 Reply Last reply
                0
                • mfalkviddM mfalkvidd

                  @jeti Yes that is correct.

                  https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/4 has info on how to read the debug messages.

                  pt=1 means payload type 1. Payload type 1 is "byte". According to https://www.mysensors.org/download/serial_api_20#variable-types V_VAR1 has a custom type. I don't know what that means, but it looks like the MySensors library interprets that as a byte, which won't be very useful for sending an RFID tag. I have not used the custom variable types and I don't know how they work unfortunately.

                  Yes, MySensors handles strings. Use S_INFO and V_TEXT as suggested in the post I linked to above.

                  J Offline
                  J Offline
                  jeti
                  wrote on last edited by
                  #8

                  @mfalkvidd:
                  also with S_INFO amd V_TEXT the gateway only receives a "1"...

                  I just searched and played a little more and i got i working now:

                   /**
                   * ID-3LA       Arduino
                   * -----      -------
                   * GND   ->   GND
                   * VCC   ->   +3.3V
                   * D0   ->   D5
                   * D1   ->   D6
                   * FORM -> GND
                   */
                  
                  // Enable debug prints to serial monitor
                  #define MY_DEBUG 
                  
                  // Enable and select radio type attached
                  #define MY_RADIO_NRF24
                  //#define MY_RADIO_RFM69
                  
                  #define MY_NODE_ID 102 
                  
                  #include <SPI.h>
                  #include <MySensors.h>  
                  #include <SoftwareSerial.h>
                  
                  SoftwareSerial rfid = SoftwareSerial(5, 6);
                  int  val = 0; 
                  char code[10]; 
                  int bytesread = 0; 
                  
                  #define CHILD_ID 1   // Id of the sensor child
                  
                  MyMessage KeyMsg(CHILD_ID, V_VAR1);
                  
                  void setup()  
                  {
                    Serial.begin(9600);
                    rfid.begin(9600);
                    //Serial.println("Ready");
                  }
                  
                  void presentation()  {
                    sendSketchInfo("RFID Reader", "1.0");
                    present(CHILD_ID, S_CUSTOM);
                  }
                  
                  void loop(){
                  if(rfid.available() > 0) {          // if data available from reader 
                      if((val = rfid.read()) == 10) {   // check for header 
                        bytesread = 0; 
                        while(bytesread<10) {              // read 10 digit code 
                          if( rfid.available() > 0) { 
                            val = rfid.read(); 
                            if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
                              break;                       // stop reading 
                            } 
                            code[bytesread] = val;         // add the digit           
                            bytesread++;                   // ready to read next digit  
                          } 
                        } 
                        if(bytesread == 10) {              // if 10 digit read is complete 
                          Serial.print("TAG code is: ");   // possibly a good TAG 
                          Serial.println(code);            // print the TAG code 
                        } 
                        bytesread = 0; 
                       Serial.println(code);
                       send(KeyMsg.set(code)); 
                       
                      }
                    }
                  }
                  

                  The issue seemed to be the string, now with a char it works...

                  now i only need to get reset the reader every now an then to recognice if a tag is removed. The reader only updates when a tag enters the reading adistance but not when it leaves it.

                  thanks!

                  mfalkviddM 1 Reply Last reply
                  1
                  • J jeti

                    @mfalkvidd:
                    also with S_INFO amd V_TEXT the gateway only receives a "1"...

                    I just searched and played a little more and i got i working now:

                     /**
                     * ID-3LA       Arduino
                     * -----      -------
                     * GND   ->   GND
                     * VCC   ->   +3.3V
                     * D0   ->   D5
                     * D1   ->   D6
                     * FORM -> GND
                     */
                    
                    // Enable debug prints to serial monitor
                    #define MY_DEBUG 
                    
                    // Enable and select radio type attached
                    #define MY_RADIO_NRF24
                    //#define MY_RADIO_RFM69
                    
                    #define MY_NODE_ID 102 
                    
                    #include <SPI.h>
                    #include <MySensors.h>  
                    #include <SoftwareSerial.h>
                    
                    SoftwareSerial rfid = SoftwareSerial(5, 6);
                    int  val = 0; 
                    char code[10]; 
                    int bytesread = 0; 
                    
                    #define CHILD_ID 1   // Id of the sensor child
                    
                    MyMessage KeyMsg(CHILD_ID, V_VAR1);
                    
                    void setup()  
                    {
                      Serial.begin(9600);
                      rfid.begin(9600);
                      //Serial.println("Ready");
                    }
                    
                    void presentation()  {
                      sendSketchInfo("RFID Reader", "1.0");
                      present(CHILD_ID, S_CUSTOM);
                    }
                    
                    void loop(){
                    if(rfid.available() > 0) {          // if data available from reader 
                        if((val = rfid.read()) == 10) {   // check for header 
                          bytesread = 0; 
                          while(bytesread<10) {              // read 10 digit code 
                            if( rfid.available() > 0) { 
                              val = rfid.read(); 
                              if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
                                break;                       // stop reading 
                              } 
                              code[bytesread] = val;         // add the digit           
                              bytesread++;                   // ready to read next digit  
                            } 
                          } 
                          if(bytesread == 10) {              // if 10 digit read is complete 
                            Serial.print("TAG code is: ");   // possibly a good TAG 
                            Serial.println(code);            // print the TAG code 
                          } 
                          bytesread = 0; 
                         Serial.println(code);
                         send(KeyMsg.set(code)); 
                         
                        }
                      }
                    }
                    

                    The issue seemed to be the string, now with a char it works...

                    now i only need to get reset the reader every now an then to recognice if a tag is removed. The reader only updates when a tag enters the reading adistance but not when it leaves it.

                    thanks!

                    mfalkviddM Offline
                    mfalkviddM Offline
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #9

                    @jeti great work!

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    18

                    Online

                    12.0k

                    Users

                    11.2k

                    Topics

                    113.4k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular