MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Profile Switcher - RC522 RFID

    Scheduled Pinned Locked Moved Unsolved Requests
    13 Posts 3 Posters 5.9k Views 3 Watching
    Loading More Posts
    • 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.
    • S Offline
      sdetweil @richland007
      last edited by

      @richland007 open the developers console, either by

      npm start dev

      when you start the mirror

      or ctrl-shift-i

      when then mirror is running

      then select the console tab

      these tools send notifications from one module to another…
      so you should see those messages in the console

      you can also filter the messages by the name of the file so
      put rfid in the filter field to see only messages sent from the rfid module

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 1
      • richland007R Offline
        richland007
        last edited by

        @sdetweil @miguel-abap Ok so i see that the modules are receiving data from MMM-RFID on the console under npm start dev when i scan the rfid tag. RFID_DATA and RFID_UID… do not know why 2 different ones

        0_1559703351342_consoleRFID.png

        But what kind of data?? Where can i see if they are receiving Denis or Eva or just the decimal value stored on the tag etc etc??

        Hers is my config.js entry for the MMM-RFID module and the MMM-ProfileSwitcher and also all my modules have the appropriate classes entry assigned according to our names for whatever module belonging to each one of us

        {
                module: 'MMM-RFID',
                config: {
                    events: {
                        Eva: [ // data on rfid tag as decimal block will be used as identifier [0691180970000000]
                            {
                                CURRENT_PROFILE: "Eva" // i.e. "CURRENT_PROFILE" is used for notification identifier and "Eva" for notification payload
                            }
                        ],
                        Denis: [ // data on rfid tag as decimal block will be used as identifier [0681011101051150]
                            {
                                CURRENT_PROFILE: "Denis" // i.e. "CURRENT_PROFILE" is used for notification identifier and "Denis" for notification payload
                            }
                        ]
                                 
                    }
                }
            },
        
        
        {
                module: 'MMM-ProfileSwitcher',
                config: { // See 'Configuration options' for more information.
                   includeEveryoneToDefault: true,
                   alwaysShowLeave: true,
                   ignoreModules: ["alert", "updatenotification"],
                   enterMessages: {
                        "Denis Eva": "What's up %profile%?", // We both have this message
                                  },
                   leaveMessages: false,
                   defaultTime: 120000,
                   timers: {
                            "Eva": {
                             time: 60 * 1000
                             },
                             }
                }
            }, 
        

        so on each of our MM modules we have classes: for “default everyone” and “Denis” or “Eva”

        what am i doing wrong ??

        Denis

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @richland007
          last edited by sdetweil

          @richland007 said in Profile Switcher - RC522 RFID:

          no ideas really… the node_helper code sends two different notices up to the module,
          which forwards them on…

          I don’t see any debug info in the module, so edit the MMM-RFID.js file

          and change it like this

                  if (notification === "RFID_UID") {
                      Log.log(" UID received="+payload);
                      this.sendNotification("RFID_UID", payload);
                  }
          

          and

                  if (notification === "RFID_DATA") {
                       Log.log(" DATA received="+payload);
                      this.sendNotification("RFID_DATA", payload);
                      this.dispatchEvents(payload.data)
                  }
          

          it looks like the converter should work… u did WRITE those decimal values to the tags, right?

          I see he has a test reader tool

          sudo python modules/MMM-RFID/MFRC522-python/Read.py
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          richland007R 1 Reply Last reply Reply Quote 1
          • richland007R Offline
            richland007 @sdetweil
            last edited by richland007

            @sdetweil For the tags i am 100% sure i have written them right i have tasted with the Read.py script and others … One thing i am unsure of why are the zeros at the end needed?? In the online translator they just add spaces at the end of the name for no reason.
            Do i have to write the names with spaces in the back too i don’t think it makes sense or do i write the tags with out the zeros at the end??

            Another thing i am unsure off is that on the MMM-RFID config.js entry do i need to assign the tag values to the names or is that done by the module directly through “translation”

            {
                    module: 'MMM-RFID',
                    config: {
                        events: {
                            Eva: [ // data on rfid tag as decimal block will be used as identifier [0691180970000000]
                                {
                                    CURRENT_PROFILE: "Eva" // i.e. "CURRENT_PROFILE" is used for notification identifier and "Eva" for notification payload
                                }
                            ],
                            Denis: [ // data on rfid tag as decimal block will be used as identifier [0681011101051150]
                                {
                                    CURRENT_PROFILE: "Denis" // i.e. "CURRENT_PROFILE" is used for notification identifier and "Denis" for notification payload
                                }
                            ]
                                     
                        }
                    }
                },
            
            

            I am not very familiar with how this works but maybe the original creator of the MMM-RFID has made a mistake on commenting out // the value part after the name in the above config entry …i don’t know

            Anyhow always your input is greatly appreciated … i will try your changes as soon as i get home
            thanks again
            Denis

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @richland007
              last edited by

              @richland007 I think the node helper strips the trailing spaces. I don’t know if the tag needs all 16 digits

              If there ARE trailing spaces, then it won’t match the config entries

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 2 / 2
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy