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. Announcements
  3. 💬 RFID Lock Sensor

💬 RFID Lock Sensor

Scheduled Pinned Locked Moved Announcements
25 Posts 14 Posters 8.0k Views 13 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.
  • miroM Offline
    miroM Offline
    miro
    wrote on last edited by miro
    #9

    @mfalkvidd

    I have followed the guide here (https://www.mysensors.org/build/rfid) to the letter. Yes, it could be me that have problems but this isn´t so hard project. Feels like something is missing?

    In the description it says:

    "To find out the unique ID of your tag just run the example while looking at serial monitor. Hold tag in front of reader and your identifier should pop up."

    This I did, but the monitor don`t show anything, just this

    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    TSM:RADIO:OK
    TSM:FPAR
    TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    TSM:PDT
    

    ... And yes, I have switched the little pin to I2C on my PN532 RFID reader.

    mfalkviddM 1 Reply Last reply
    0
    • miroM miro

      @mfalkvidd

      I have followed the guide here (https://www.mysensors.org/build/rfid) to the letter. Yes, it could be me that have problems but this isn´t so hard project. Feels like something is missing?

      In the description it says:

      "To find out the unique ID of your tag just run the example while looking at serial monitor. Hold tag in front of reader and your identifier should pop up."

      This I did, but the monitor don`t show anything, just this

      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSM:FPAR
      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      !TSM:FPAR:FAIL
      !TSM:FAILURE
      TSM:PDT
      

      ... And yes, I have switched the little pin to I2C on my PN532 RFID reader.

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

      @miro the node is unable to connect to your gateway. What type of gateway are you using? Could you post the debug log from the gateway?

      samburner3S 1 Reply Last reply
      0
      • miroM Offline
        miroM Offline
        miro
        wrote on last edited by miro
        #11

        @mfalkvidd I`m using nano as serial GW. I didn´t have any trouble with GW for a long time now.

        0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
        0;255;3;0;9;TSM:INIT
        0;255;3;0;9;TSM:RADIO:OK
        0;255;3;0;9;TSM:GW MODE
        0;255;3;0;9;TSM:READY
        0;255;3;0;14;Gateway startup complete.
        0;255;0;0;18;2.0.0
        0;255;3;0;9;No registration required
        0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
        

        Should I install some XML in my vera edge to get this sensor to work?
        If I read the guide for this I will take it as GW has nothing to do with RFID until I have set the key code for the tags in the scetch and after that I implement the sensor to my vera?

        1 Reply Last reply
        0
        • miroM Offline
          miroM Offline
          miro
          wrote on last edited by
          #12

          It was just that easy as a broken radio. Thank you for your help to get me think in other ways :)

          mfalkviddM 1 Reply Last reply
          1
          • miroM miro

            It was just that easy as a broken radio. Thank you for your help to get me think in other ways :)

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

            Great work @miro, thanks for reporting back.

            1 Reply Last reply
            0
            • miroM Offline
              miroM Offline
              miro
              wrote on last edited by
              #14

              Has anyone got this http://www.ebay.com/itm/271316626820?rmvSB=true to work with NFC and Android phone?

              1 Reply Last reply
              0
              • ben999B Offline
                ben999B Offline
                ben999
                wrote on last edited by ben999
                #15

                Hi all,
                I can not get status of my doorlock node... begging for help! ;)
                Got myself bits and pieces as per "build" page :

                • arduino micro
                • NRF24
                • PN532
                • relay
                  Raspberry SGtw works fine with another node (temp, motion and hum)
                  RFID node "speaks" with Raspberry as follows (IDE serial monitor) :
                Starting sensor (RNNNA-, 2.0.0)
                TSM:INIT
                TSM:RADIO:OK
                TSP:ASSIGNID:OK (ID=10)
                TSM:FPAR
                TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                TSM:FPAR
                TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                TSP:MSG:READ 0-0-10 s=255,c=3,t=8,pt=1,l=1,sg=0:0
                TSP:MSG:FPAR RES (ID=0, dist=0)
                TSP:MSG:PAR OK (ID=0, dist=1)
                TSM:FPAR:OK
                TSM:ID
                TSM:CHKID:OK (ID=10)
                TSM:UPL
                TSP:PING:SEND (dest=0)
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
                TSP:MSG:READ 0-0-10 s=255,c=3,t=25,pt=1,l=1,sg=0:1
                TSP:MSG:PONG RECV (hops=1)
                TSP:CHKUPL:OK
                TSM:UPL:OK
                TSM:READY
                Found NFC chip PN532
                Firmware ver. 1.6
                close lock
                NODE:!REG
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
                TSP:MSG:SEND 10-10-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
                TSP:MSG:READ 0-0-10 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                TSP:MSG:READ 0-0-10 s=255,c=3,t=6,pt=0,l=1,sg=0:M
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=ok:RFID Lock
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
                TSP:MSG:SEND 10-10-0-0 s=1,c=0,t=19,pt=0,l=0,sg=0,ft=0,st=ok:
                Request registration...
                TSP:MSG:SEND 10-10-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
                TSP:MSG:READ 0-0-10 s=255,c=3,t=27,pt=1,l=1,sg=0:1
                Node registration=1
                Init complete, id=10, parent=0, distance=1, registration=1
                Found tag id: 0x35,0xA8,0xF5,0xAA,0x00,0x00,0x00
                open lock
                TSP:MSG:SEND 10-10-0-0 s=1,c=1,t=36,pt=1,l=1,sg=0,ft=0,st=ok:1
                

                That's my things file :

                
                Bridge mysensors:bridge-eth:gateway [ ipAddress="127.0.0.1", tcpPort=5003, sendDelay=200 ] {
                        lock            hallRfid01              [ nodeId="10", childId="1" ]    }
                

                And my items file :

                Contact         hallRfid01      "Front door lock"                 <frontdoor>             (gHall)                                 { channel="mysensors:lock:gateway:hallRfid01:lock" }
                

                This is the openhab "mysensors log tail" when powering node on (presenting to gateway)

                06:48:57.990 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                06:49:05.585 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;255;0;0;17;2.0.0
                06:49:05.597 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:49:05.600 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;255;3;0;6;0
                06:49:05.603 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - I_CONFIG request received from M, answering: (is imperial?)false
                06:49:05.606 [DEBUG] [rs.internal.protocol.MySensorsWriter] - Sending to MySensors: 10;255;3;0;6;M
                06:49:05.609 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:49:05.632 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;255;3;0;11;RFID Lock
                06:49:05.636 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:49:05.679 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;255;3;0;12;1.0
                06:49:05.683 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:49:05.684 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;1;0;0;19;
                06:49:05.696 [DEBUG] [ternal.handler.MySensorsThingHandler] - Setting last update for node 10 to 2016-12-19T06:49:05.687+0000
                06:49:05.712 [INFO ] [marthome.event.ItemStateChangedEvent] - mysensors_lock_gateway_hallRfid01_lastupdate changed from 2016-12-18T21:14:31.444+0000 to 2016-12-19T06:49:05.687+0000
                06:49:07.991 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                06:49:17.992 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                

                And last when RFID tag is presented to reader

                06:49:47.996 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                06:49:49.305 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;1;1;0;36;1
                06:49:49.310 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:49:57.998 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                06:49:58.567 [DEBUG] [rs.internal.protocol.MySensorsReader] - 10;1;1;0;36;0
                06:49:58.572 [ERROR] [rs.internal.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.internal.protocol.ip.MySensorIpReader
                06:50:07.999 [DEBUG] [al.protocol.ip.MySensorsIpConnection] - Bridge is connected, connection skipped
                

                On the bright side, the relay attached to arduino opens and closes as i present RFID tag in front of reader... :)

                Unfortunately i don't get the lock status (locked or unlocked) in PaperUI nor openHab for iOS...
                I don't get "open" or "closed" status as i do with motion sensor. I also don't get any change to the door icon (door_closed and door_opened)

                Thanks a lot for your help :)

                Best Regards,

                Ben

                1 Reply Last reply
                0
                • mfalkviddM mfalkvidd

                  @miro the node is unable to connect to your gateway. What type of gateway are you using? Could you post the debug log from the gateway?

                  samburner3S Offline
                  samburner3S Offline
                  samburner3
                  wrote on last edited by samburner3
                  #16

                  @miro said in 💬 RFID Lock Sensor:

                  @mfalkvidd

                  I have followed the guide here (https://www.mysensors.org/build/rfid) to the letter. Yes, it could be me that have problems but this isn´t so hard project. Feels like something is missing?

                  In the description it says:

                  "To find out the unique ID of your tag just run the example while looking at serial monitor. Hold tag in front of reader and your identifier should pop up."

                  This I did, but the monitor don`t show anything, just this

                  Starting sensor (RNNNA-, 2.0.0)
                  TSM:INIT
                  TSM:RADIO:OK
                  TSM:FPAR
                  TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                  TSM:FPAR
                  TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                  TSM:FPAR
                  TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                  TSM:FPAR
                  TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                  !TSM:FPAR:FAIL
                  !TSM:FAILURE
                  TSM:PDT
                  

                  ... And yes, I have switched the little pin to I2C on my PN532 RFID reader.

                  @mfalkvidd said:

                  @miro the node is unable to connect to your gateway. What type of gateway are you using? Could you post the debug log from the gateway?

                  I had the same question as @miro however my node is communicating and connected to the gateway correctly.
                  I only see the mysensors radio debug info on the serial monitor, and no application serial prints eg (Serial.print("Couldn't find PN53x board");) doesn't show up in the serial monitor at all.
                  Neither does "Found NFC chip" or anything else in the main code...
                  My radio is working and as I said no errors in the radio debug.
                  Is the main application even running?
                  I cannot get it to scan a card at all.

                  However if I comment out the <MySensors.h> library along with its dependencies in the main program, it works and I can scan cards, and get the Uid from them...

                  Any clues?
                  Thanks.

                  1 Reply Last reply
                  0
                  • ostgardhO Offline
                    ostgardhO Offline
                    ostgardh
                    wrote on last edited by
                    #17

                    Hi.

                    Started using mysensors with RFID readers.
                    I have a suggestion by I am bad code programmer.

                    Is better to save the RFID tag key in the EPROM approved.
                    And If you want to add a key/tag with special tag which add new or remove tag.

                    What do you think?

                    1 Reply Last reply
                    0
                    • cadetC Offline
                      cadetC Offline
                      cadet
                      wrote on last edited by
                      #18

                      Hi can you modify scetch for spi interface??

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        DirkB19
                        wrote on last edited by
                        #19

                        PN532.h: No such file or directory
                        Is driving me crazy ... I have Downloaded the zip file and extracted the 4 folders(PN532, PN532_SPI, PN532_I2C and PN532_HSU) into Arduino's libraries.
                        Same error.
                        I've tried adding the library as .zip : it says not a valid library file
                        what could be the problem ?

                        D 1 Reply Last reply
                        0
                        • D DirkB19

                          PN532.h: No such file or directory
                          Is driving me crazy ... I have Downloaded the zip file and extracted the 4 folders(PN532, PN532_SPI, PN532_I2C and PN532_HSU) into Arduino's libraries.
                          Same error.
                          I've tried adding the library as .zip : it says not a valid library file
                          what could be the problem ?

                          D Offline
                          D Offline
                          DirkB19
                          wrote on last edited by
                          #20

                          @DirkB19
                          Nevermind, I placed the PN532 related folders into the C:\Program Files (x86)\Arduino\libraries folder and now it works.
                          Before, I placed them into the \libraries folder where all my sketches are which does not work for this libary .

                          1 Reply Last reply
                          0
                          • Michel - ItM Michel - It

                            Hi, I have a MFRC522 module, and I would like to implement it with 2.0 library. could I use this code?

                            Aron SjöbergA Offline
                            Aron SjöbergA Offline
                            Aron Sjöberg
                            wrote on last edited by
                            #21

                            @Michel---It said in 💬 RFID Lock Sensor:

                            Hi, I have a MFRC522 module, and I would like to implement it with 2.0 library. could I use this code?

                            I would also really like to know how to use a RFID-RC522 module instead of the PN532 NFC RFID Reader/Writer Module used in the example! The RC522 is included in a lot of different beginner kits.

                            1 Reply Last reply
                            0
                            • AnticimexA Offline
                              AnticimexA Offline
                              Anticimex
                              Contest Winner
                              wrote on last edited by
                              #22

                              It would make much sense if this example used signing.

                              Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                              1 Reply Last reply
                              0
                              • jopebeJ Offline
                                jopebeJ Offline
                                jopebe
                                wrote on last edited by
                                #23

                                Hallo,
                                I like this example of RFID Lock Sensor.
                                But I`m not able to change it for my aim myself (just a user and beginner).
                                Here my imaginations:

                                1. There should be always a default after switching on, after calling seriell monitor or after power cut.
                                  This should be "Sensor Locked"
                                2. Every change to "Sensor open" should be for only let`s say 3 seconds or another adjustable time and than fall back to Default = "Sensor Locked" . Time enough e.g. to open the door or s.e.
                                  Is there anybody who can give me some hints how to ad this features into the given sketch?
                                  Thank You in advance
                                  Jopebe
                                T 1 Reply Last reply
                                0
                                • ben999B Offline
                                  ben999B Offline
                                  ben999
                                  wrote on last edited by ben999
                                  #24
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  • jopebeJ jopebe

                                    Hallo,
                                    I like this example of RFID Lock Sensor.
                                    But I`m not able to change it for my aim myself (just a user and beginner).
                                    Here my imaginations:

                                    1. There should be always a default after switching on, after calling seriell monitor or after power cut.
                                      This should be "Sensor Locked"
                                    2. Every change to "Sensor open" should be for only let`s say 3 seconds or another adjustable time and than fall back to Default = "Sensor Locked" . Time enough e.g. to open the door or s.e.
                                      Is there anybody who can give me some hints how to ad this features into the given sketch?
                                      Thank You in advance
                                      Jopebe
                                    T Offline
                                    T Offline
                                    The-Holgi
                                    wrote on last edited by
                                    #25

                                    @jopebe said in 💬 RFID Lock Sensor:

                                    1. Every change to "Sensor open" should be for only let`s say 3 seconds or another adjustable time and than fall back to Default = "Sensor Locked" . Time enough e.g. to open the door or s.e.
                                      Is there anybody who can give me some hints how to ad this features into the given sketch?
                                      Thank You in advance
                                      Jopebe

                                    Hello,
                                    i have the same problem.
                                    Does anyone have a solution? The relay should only put on for 3 seconds.
                                    Greeting Holger

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    14

                                    Online

                                    11.7k

                                    Users

                                    11.2k

                                    Topics

                                    113.0k

                                    Posts


                                    Copyright 2019 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