A smart Lock solution with mobile clients and RasPi server.
An ordinary electromagnetic door lock is used as a standard solution in many office buildings. It is normally closed, and in order to open it, you should use either an RFID card from the external side (the very key card which is frequently left by the developers at home) or a button from the internal side. A simple relay could be connected to the button to make the lock get opened for a while. The relay in its turn should be controlled by a microcontroller (or a micro computer) which sends relevant signals. Raspberry Pi was chosen as the microcontroller which should control the relay after a verification of requests from a client application. The top entity in such a working algorithm is an application working with both iOS and Android operating systems. Hence, the entire smart lock project implies a complex hardware-software IoT solution which integrates various technologies such as web backend, clients for iOS and Android, embedded part in Linux, as well as various frameworks and Raspberry Pi specific libraries.
there no possibility to register to this app, as only users that are using our Redmine can use the same account to login, So we can easily control access to the doors.
Challenges and Nuances of the Development
Python was chosen as a programming language of a server part of the application. The choice was motivated by several considerations related to both quite a tight 24-hour period of the Hackathon and the ARM processor of the embedded target platform. The latter is a little bit inferior to x86 processors in terms of compilation and deployment. That’s why Python as an interpreted high-level programming language allowing to edit code on both a target platform and a host one was applied to run the application immediately for testing. Another reason for using Python was its standard library which could be easily extended with modules written in Cto access various operation system features along with a call system service. Besides, a Python app runs as a linux service when the operating system provides various facilities such as executing an app on startup, restarting when an app is crashed, perform an app as a background process etc.Thus, the advantages of Python have provided deploying the app to a target platform without a preliminary compilation of a source code into machine instructions.
In addition, the Flask web micro framework was applied for deploying the Smart Lock application since the framework has minimum dependencies along with minimized requirements from the third party libraries for running server apps.
In terms of some specific means of programming used in the project, the RPi.GPIO library was applied in order to provide control over pin outputs on the target board Raspberry Pi 3. The library provides a straightforward way to manipulate physical pins on the board in only few lines of code.
Read More Detail :Smart Lock
Current Project / Post can also be found using:
- raspberry pi smart lock iphone