Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

IoT Engineering Project description

## Concept

Remote steuerbares Türschloss mittels abgesicherter Zero-trust networking Lösung (265bit end2end verschlüsselt).

Motor, welcher einen Bolzen (Schliessmechanismus) bewegt, ist ein 12V DC - Linearer angetriebener Motor und wird über ein Arduino zusammen mit einem externen Stepper Chip gesteuert. An dem Arduino ist ein Fingerprintsensor angehängt, welcher das Türschloss ebenfalls aktivieren kann. Die API-Anbindung ist mittels NodeJS, zusammen mit dem Zero-trust VPN relisiert. Das Raspberry ist wiederum via Serial-USB mit dem Arduino verbunden.

Folgende API-Endpoint ist momentan vorgesehen:

Verb Ressouce Description
POST /api/door moves the bolt on the door (open/close)
GET /api/status return the motor state (e.g door open / close)
GET /api/total_operations returns operations executed by Arduino
GET /api/total_access returns the amount of door open / closed
GET /api/total_locations return a list of permitted access locations (Fingerprint & Remote)
POST /api/location add access location to DB and returns all locations accessed

Die Halterung für Motor, Fingerprint, Verschalung für Raspberry & Arduino sind 3D-gedruckte Teile und in einer Miniatur Türe verbaut werden (für Demozwecke)

Project Setup

Requirements

Zerotrust-VPN Configuration

Client (Windows, Android, IOS) Setup:

Download Zerotier-VPN to access the Webservice

  1. Download the zerotier client Windows, Android, IOS
  2. Join Network abfd31bd47ba5b87
  3. Wait for confirmation of ZeroTier administrator

Once connected to the Zerotrust Network: API calls can be made using: https://3to5.ch:4001/api/

RaspberryPi (Server) Setup:

  1. Access Raspberry SSH console access
  2. install zerotier-cli curl -s https://install.zerotier.com | sudo bash
  3. or with GPG installed: curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import && \ if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
  4. start service sudo service zerotier-one restart
  5. join network sudo zerotier-one.zerotier-cli join <network id>

Deployment

Prerequisite RaspberryPi has joined the Zerotier VPN and is configured properly

Deploy on Arduino [INO]

  1. navigate to RemoteDoorControl/Arduino/
  2. Compile and upload project to Arduino 00-Motor_Control.ino

Deployment on Raspberry [backend & frontend]

The backend is a Nodejs application. The frontend is a reactjs application. Both applications run on a single raspberry connected to zerotier VPN network: playground: abfd31bd47ba5b87

Deploy backend-service [NodeJs]:

  1. navigate to RemoteDoorControl/RPI/Nodejs/backend
  2. run npm install
  3. plug in Arduino on USB-Serial interface
  4. npm run start will start the backend server on https://3to5.ch:4001
  5. nodemon for development purposes is configure and run with npm run dev 2.1) to start server in dispatched mode forever start server.js

Backend-API is reachable under: https://3to5.ch:4001/api/docs

Troubleshooting:

  1. Find blocking ports: lsof -i :4001 -t --> kill xxx
  2. To find which USB interface is used dmesg | grep USB

Deploy frontend-service [react-js]:

  1. navigate to RemoteDoorControl/RPI/Nodejs/frontend
  2. run npm install
  3. make sure SSL certificates are places on repositories root path
  4. (HTTPS=true SSL_CRT_FILE=cert.pem SSL_KEY_FILE=key.pem npm start&) run production in HTTPS will start the frontend-service

Webapp is reachable under: https://3to5.ch:3000

Generating self-signed-certificate

Create certificate and place it into root folder of Nodejs app. Files: key.pem, cert.pem openssl genrsa -out key.pem openssl req -new -key key.pem -out csr.pem openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem rm csr.pem

3D Printed parts

Door Lock

Prototype

Webview

Videos

Videos: Fingerprint - Demo Remote Acces - Demo

Production Links

RemoteDoorControl - Webapp RemoteDoorControl - Backend (Swagger-UI)

Wiring

IFTTT Setup

About

Remote controllable door lock using secured zero-trust networking solution (265bit end2end encrypted) and onPremise Fingerprint sensor

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages