Search code examples
securityraspberry-pilcdkeypadraspberry-pi4

Raspberry Pi Home Security System - Request for Guidance


I had a quick opinion question regarding a Raspberry Pi/Python based home security system I'm working on. My end goal is to have magnetic door/window sensors being monitored by a Raspberry Pi 4 server. If a window or door is opened while the system is armed it will play an alarm sound to the connected speakers. I would then have Raspberry Pi Zero W powered keypad panels (with LCD screens and a 12 digit keypad) that would allow me to see whether the system is armed or disarmed and allow me to input the passcode to arm or disarm the system. The Raspberry Pi Zero W panels would connect to the Raspberry Pi 4 server over the network.

I already have a somewhat functional test system running in a single Python script with everything connected to the Raspberry Pi 4 (link below). However, I'm now at a point where I need to figure out how to tie in the Raspberry Pi Zero W keypad panels I would like to integrate over the network. My question for you all is how would you go about implementing the network connectivity portion of this? Should I use something like Node.js with some kind of database? Perhaps the socket module in Python for something low-level? Something else entirely?

I'm up for any and all suggestions for how to go about this. Please let me know if you have any questions. Thanks in advance!

Poorly Done Diagram: https://i.sstatic.net/8BUJd.jpg

Current Working Code: https://github.com/kevbo423/RPHSP/blob/master/Home_Security_System.py


Solution

  • If this was me, As you have the power of a full fat Pi 4, I would use a PHP web server on the "server" Pi that the other nodes POST to. This will give you the benefit of not having to deal with low level networking. You could also potentially add further devices or web services in the future with more integration opportunities.

    You would then need to interface python to the PHP server however this could be done with a simple text file or alike.