Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. jsondag
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    jsondag

    @jsondag

    1
    Reputation
    4
    Posts
    528
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    jsondag Follow

    Best posts made by jsondag

    • RE: Combo entry scene trigger?

      Here is a basic untested code that might do what you're wanting. I combined a my sensors button sketch with the following.
      http://www.instructables.com/id/Arduino-door-lock-with-password/
      I might build one up at some point, but currently I haven't tested it.

      #include <MySensor.h>
      #include <SPI.h>
      #include <Password.h> //http://playground.arduino.cc/uploads/Code/Password.zip //tells to use password library
      #include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip  //tells to use keypad library
      
      
      #define CHILD_ID 3
      
      
      Password password = Password( "0000" ); //password to unlock, can be changed
      
      const byte ROWS = 4; // Four rows
      const byte COLS = 4; // columns
      // Define the Keymap
      char keys[ROWS][COLS] = {
      {'1','2','3'},
      {'4','5','6'},
      {'7','8','9'},
      {'*','0','#'}
      };
      // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
      byte rowPins[ROWS] = { 9, 8, 7, 6 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
      byte colPins[COLS] = { 5, 4, 3 };
      
      MySensor gw;
       
      int oldValue=-1;
      
      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(CHILD_ID,V_TRIPPED);
      // Create the Keypad
      Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
      void setup()  
      {  
        gw.begin();
        delay(200); 
        pinMode(11, OUTPUT);  //green light
        pinMode(12, OUTPUT);  //red light
       
        keypad.addEventListener(keypadEvent); //add an event listener for this keypad
      
        
        
        // Register binary input sensor to gw (they will be created as child devices)
        // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
        // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
        gw.present(CHILD_ID, S_DOOR);  
      }
      
      
      void loop(){
        keypad.getKey();
        }
        //take care of some special events
        void keypadEvent(KeypadEvent eKey){
        switch (keypad.getState()){
        case PRESSED:
        
        Serial.print("Enter:");
        Serial.println(eKey);
        delay(10);
        
        Serial.write(254);
        
        switch (eKey){
          case '*': checkPassword(); delay(1); break;
          
          case '#': password.reset(); delay(1); break;
          
           default: password.append(eKey); delay(1);
      }
      }
      }
      void checkPassword(){
        
      if (password.evaluate()){  //if password is right open
          
          Serial.println("Accepted");
          Serial.write(254);delay(10);
          //Add code to run if it works
          gw.send(msg.set(1));
              digitalWrite(11, HIGH);//turn on
          delay(5000); //wait 5 seconds
          digitalWrite(11, LOW);// turn off
          delay(5000);
          gw.send(msg.set(0));
          
      }else{
          Serial.println("Denied"); //if passwords wrong keep locked
          Serial.write(254);delay(10);
          //add code to run if it did not work
          gw.send(msg.set(0));
          digitalWrite(12, HIGH); //turn on
          delay(5000); //wait 5 seconds
          digitalWrite(12, LOW);//turn off
          
      }
      }```
      posted in Hardware
      jsondag
      jsondag

    Latest posts made by jsondag

    • RE: [security] Introducing signing support to MySensors

      @Anticimex. Software signing is working fine.

      Thanks for the information though. I didn't realize the soic 8 couldn't do one wire. It's a ATSHA204-SH-DA-B according to the listing.

      EDIT:
      Looking at the datasheet, it says that the SCL pin can be ignored for single wire interface. perhaps I'll wire another one up and give it a go.

      Just connect, SDA to A3, correct?

      posted in Development
      jsondag
      jsondag
    • RE: [security] Introducing signing support to MySensors

      I put together a garage door opening using code from korttoma. I used soft signing, and it works great. I was wanting to use a real atsha though.

      I bought some atsha204a chips from amazon, and the chips are marked with only "3eas", and a "Y" in one corners. They are soic-8. Is that how this should be marked? I wired one up according to the data sheet. Gnd to Gnd, VCC to 5V, and SDA to A3. I ran the personalizer to generate a key and it said "Failed to wake device." in the serial console. Am I doing something wrong? or did I just get the wrong chip from the seller?

      posted in Development
      jsondag
      jsondag
    • RE: Garage door controller/checker

      I built this controller using the above code (plus atshasoft signing), and it works great when connected to computer's usb port, but doesn't work when connected to either a USB power adapter, a 12v input on the VIN pin, or 5V on the 5V pin. I'm not sure what could be the issue here. I'm using an arduino nano.

      EDIT:
      Ignore my stupidity. When you hook up the radio to the 5V instead of the 3.3v output only a PC has a low enough voltage for the (somehow not fried) radio to work. Connecting to the 3v3 works...

      posted in My Project
      jsondag
      jsondag
    • RE: Combo entry scene trigger?

      Here is a basic untested code that might do what you're wanting. I combined a my sensors button sketch with the following.
      http://www.instructables.com/id/Arduino-door-lock-with-password/
      I might build one up at some point, but currently I haven't tested it.

      #include <MySensor.h>
      #include <SPI.h>
      #include <Password.h> //http://playground.arduino.cc/uploads/Code/Password.zip //tells to use password library
      #include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip  //tells to use keypad library
      
      
      #define CHILD_ID 3
      
      
      Password password = Password( "0000" ); //password to unlock, can be changed
      
      const byte ROWS = 4; // Four rows
      const byte COLS = 4; // columns
      // Define the Keymap
      char keys[ROWS][COLS] = {
      {'1','2','3'},
      {'4','5','6'},
      {'7','8','9'},
      {'*','0','#'}
      };
      // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
      byte rowPins[ROWS] = { 9, 8, 7, 6 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
      byte colPins[COLS] = { 5, 4, 3 };
      
      MySensor gw;
       
      int oldValue=-1;
      
      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(CHILD_ID,V_TRIPPED);
      // Create the Keypad
      Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
      void setup()  
      {  
        gw.begin();
        delay(200); 
        pinMode(11, OUTPUT);  //green light
        pinMode(12, OUTPUT);  //red light
       
        keypad.addEventListener(keypadEvent); //add an event listener for this keypad
      
        
        
        // Register binary input sensor to gw (they will be created as child devices)
        // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
        // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
        gw.present(CHILD_ID, S_DOOR);  
      }
      
      
      void loop(){
        keypad.getKey();
        }
        //take care of some special events
        void keypadEvent(KeypadEvent eKey){
        switch (keypad.getState()){
        case PRESSED:
        
        Serial.print("Enter:");
        Serial.println(eKey);
        delay(10);
        
        Serial.write(254);
        
        switch (eKey){
          case '*': checkPassword(); delay(1); break;
          
          case '#': password.reset(); delay(1); break;
          
           default: password.append(eKey); delay(1);
      }
      }
      }
      void checkPassword(){
        
      if (password.evaluate()){  //if password is right open
          
          Serial.println("Accepted");
          Serial.write(254);delay(10);
          //Add code to run if it works
          gw.send(msg.set(1));
              digitalWrite(11, HIGH);//turn on
          delay(5000); //wait 5 seconds
          digitalWrite(11, LOW);// turn off
          delay(5000);
          gw.send(msg.set(0));
          
      }else{
          Serial.println("Denied"); //if passwords wrong keep locked
          Serial.write(254);delay(10);
          //add code to run if it did not work
          gw.send(msg.set(0));
          digitalWrite(12, HIGH); //turn on
          delay(5000); //wait 5 seconds
          digitalWrite(12, LOW);//turn off
          
      }
      }```
      posted in Hardware
      jsondag
      jsondag