Code Monkey home page Code Monkey logo

key-scanner's Introduction

Overview

Key-scanner is python based pack of scripts, able to scan, interpret, and authorize QR codes in order to open electronic lock

We advise you to use the product with our website https://keymanager.theiotproject.com/, mobile app and to visit our blog https://theiotproject.com/

Inputs

Raspberry is programmed to

  • listen to MQTT signals on topic dev/test
  • waiting for QR scanner input from COM port /dev/ttyACM0
  • simulate COM ports: /dev/ttyS90, /dev/ttyS91

Sample input

- yyyy-mm-dd HH:MM:SS/10 digit A-Z0-9 code ("2022-07-18 11:59:21/MSDECVKOPN")

image

lock has tollerance of +-1 minute, so the key will expire one minute after being generated

Additional features

  • Lock is able to open via MQTT after recieving secret signal
  • Lock is shipped with emergency opening. In order to open it scan QR code with the code matching magic.guid in /etc folder
  • Lock can push its logs to mosquitto MQTT broker, which then can forward them to MSQL database

Requirements

-Raspberry Pi model B or higher

-Honeywell QR scanner CM2D

-Single channel 12v relay

-Electronical lock

Modules:

-https://pypi.org/project/paho-mqtt/

-https://pypi.org/project/RPi.GPIO2/

-datetime

-serial

-mqtt client and mqtt broker

how to set everything up

  • flash the latest raspbian release, you can find it here
  • connect rasperry with pc using COM->USB hub
  • connect you raspberry to internet
  • set static ip and enable ssh protocol
  • now you can enter your pi remotely using cli ssh client or PuTTY
  • connect your scanner to raspberry pi
  • set it to send signal as COM port
  • connect single channel relay on GPIO 2
  • install given modules:
pip3 install pyserial paho-mqtt mysql.connector syslog
  • select a desired folder to store this repo and clone it, excluding MQTTlogPush.py as it`s a server side script
  • set up external server and install your database and mosquitto broker, config documentation can be found here
  • enter valid credentials in core.py your database and correct hosts to all the brokers and other hosts
  • deploy MQTTlogPush.py on the same server
  • run command mosquitto <path_to_config_file> and python MQTTlogPush.py
  • start all cloned scripts using command bash start in the containing folder

key-scanner's People

Contributors

nikodemq avatar suawek013 avatar wojciech812 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brunobola

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.