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
O

ozyreusz

@ozyreusz
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • RFID-RC522 and sending text via serialgateway
    O ozyreusz

    I get no output from the card I try to read. When I comment out all lines connected with mysensors library it works

    There are no errors
    The sketch checks cards id and returns name of the card owner, if it is known, if not "unknown person" is printed on serial. I wanted to send names detected to domoticz, so based on them it would be possible to create an event

    0;255;3;0;9;0 MCO:BGN:INIT GW,CP=R-NGA---,REL=255,VER=2.3.1
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;17;2.3.1
    0;255;3;0;11;USER
    0;255;3;0;12;1.1
    0;20;0;0;36;
    0;255;3;0;9;9 MCO:BGN:STP
    0;255;3;0;9;68 MCO:REG:NOT NEEDED
    0;255;3;0;9;71 MCO:BGN:INIT OK,TSP=NA```
    My Project

  • RFID-RC522 and sending text via serialgateway
    O ozyreusz

    Hello
    I have a problem with sending out data from arduino to controller. Without mySensors everything is working, but when I try to introduce mySensors syntax everything just stops

    #define MY_GATEWAY_SERIAL
    
    #include <MySensors.h>  
    #include <SPI.h>
    #include <MFRC522.h>
    
    #define CHILD_ID_USER 20 
    #define SS_PIN 53
    #define RST_PIN 5
    
    MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class
     
    const byte michal[] = {0xD4,0x9E,0x17,0xA3};
    const byte martyna[] = {0x16,0xCF,0x8F,0x12};
    MyMessage msgUSER(CHILD_ID_USER, V_TEXT);
    
    void setup() { 
      Serial.begin(115200);
      SPI.begin(); 
      rfid.PCD_Init(); 
    }
    
    void presentation()  
    { 
      sendSketchInfo("USER", "1.1");
      present(CHILD_ID_USER, S_INFO);
    }
     
    void loop() {
      // Look for new cards
      if ( ! rfid.PICC_IsNewCardPresent()) 
        return;
     
      // Verify if the NUID has been readed
      if ( ! rfid.PICC_ReadCardSerial())
        return;
     
      if (rfid.uid.uidByte[0] == michal[0] || 
          rfid.uid.uidByte[1] == michal[1] || 
          rfid.uid.uidByte[2] == michal[2] || 
          rfid.uid.uidByte[3] == michal[3] ) 
         {
              Serial.println("User: Michal");  
              send(msgUSER.set("Michal"),1);
              delay(1500);
              
      }
      else if (rfid.uid.uidByte[0] == martyna[0] || 
               rfid.uid.uidByte[1] == martyna[1] || 
               rfid.uid.uidByte[2] == martyna[2] || 
               rfid.uid.uidByte[3] == martyna[3] )
                    {
              Serial.println("User: Martyna");  
              send(msgUSER.set("Martyna"),1);
              delay(1500);
              
      }
      else 
      {
              Serial.println("Niepoprawna karta!!!");
              send(msgUSER.set("Obcy"),1);
              delay(2000);
              
      }
      
      // Halt PICC
      rfid.PICC_HaltA();
     
      // Stop encryption on PCD
      rfid.PCD_StopCrypto1();
    }
    

    Meybe someone can see the error in my implementation?

    My Project
  • Login

  • Don't have an account? Register

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