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://imgur.com/a/AnAVzLt
Current Working Code: https://github.com/kevbo423/RPHSP/blob/master/Home_Security_System.py
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.
Related
I am currently working on a project that make me control media center and a few domotic parts in my living room.
I have connected on my raspberry pi 3 a NAS, my Spotify account (with hifiberry, controls to close my amp, my PC and a few lights...
At first to control it all I programmed a web server that I can access on my phone. That made the job but it is not completely user friendly since I have to have my phone go to the interface and do whatever I have to... And I'm not a web designer 😁 it's far from perfect!
I've made some research and I have decided to build a bluetooth remote control (raspberry pi 3 do have Bluetooth low energy).
Since nothing exist as I want, it is going to be a custom one made with Arduino mini and hm10 module.
But I'm stuck on the raspberry part!
How can I read the Bluetooth data send by my remote and launch scripts according to the command sent?
Via a serial listener of some kind?
Yes, in fact, you should use a serial port to connect your pi with Bluetooth module.
You then use software input information for your purposes, but you must first implement the hardware and hardware interface first.
You can build application software with the Python programming language.
I got my Raspberry Pi 3 quite recently and have made some basic projects. I'm looking for a method to create a website (on my laptop) and control my raspberry pi through that - well, more just a circuit attached to it. Would that be possible? If so, how would I approach it?
Depending on the language you want to use for the project, you will want to find a gpio library to control the GPIO pins. You would then want to wrap the calls in a webserver. Some examples of the libraries:
https://pypi.python.org/pypi/RPi.GPIO
https://www.npmjs.com/package/pi-gpio
http://wiringpi.com/
I am doing my master thesis and one of the important things for me is to transfer the recordings of pressure and temperature from a patient simulator to a PC. From the sensors, the information is taken by the raspberry pi3. I am using raspberry pi3 because it has inbuilt wifi option. Now I have to transfer the data from the raspberry pi to the PC wirelessly using python programming. I am new to python and I have absolutely no idea how to do this. Could anyone help me with writing the code so that I could at least send some data from where I could adjust the bit rate and other things according to my requirements?
Take a look at sockets, a simple client - server communication is really easy to do :)
https://wiki.python.org/moin/TcpCommunication
I am developing project on Raspberry Pi and I need to add feature of measuring heart rate. I want to use Smart Watch to do that but I do not know which smart watch provide environment which allows me to implement wireless communication between watch and Raspberry (Raspbian OS) easily. Thank you in advance for each answer.
I don't think any smart-watch allows direct connection between Raspberry Pi and smart-watch. It is not recommended on android developer site to open lower level sockets as well. You can send smart-watch's sensor data to Phone and then send it to Raspberry Pi.
I have built a home surveillance and alarm system with raspberry pi's.
What I need now is an easy and safe remote control to arm the system and disarm it.
The most workable solution is to have a wireless router in the middle.
Before stepping out in the door, take out my phone, connect to my home network and via a custom built web page arm my system. (Web page would run the arming scripts)
But for this I need to have a wireless router (currently I have a non wireless Ubiquiti Router Station Pro, no radio card on it) and need to enable wireless on my phone (it is not enable-d, battery reasons) before leave, connect and so on. It is not one click unfortunately...
Other solution is to have just a wireless dongle in the Raspberry PI and do an Ad Hoc WiFi connection with my phone. My phone is Sony Ericson Xperia. Over here my technical knowledge hits the limit. It is possible to broadcast an Ad Hoc network over Raspberry PI I do not know if I can reach it from my Sony Ericson Xperia phone.
Third option is Bluetooth. I know very little about Bluetooth. I do not know how safe it is, and how to program it, to have on and off switch on my phone. However this might be the most promising.
Fourth option is to use the Pi Face. Link one or two switches to some type of receiver device. Have a sender device on my key chain and control it from there.
However I do not know from where I can buy such a safe remote control and if it is compatible with Pi Face.
Fifth option. To get home alarm system components and link those with the Pi Face. But I do not know what component might fit.
The best user scenario is the following.
User takes out out a device (phone or remote control) and presses arm/disarm.
User has appropriate time (30 sec) to get out or shut down.
If the remote device had run out from battery still have something to shut it down.
So my question does any body knows a fast, easy, cheap solution how to do this?
Though Bluetooth's security is questionable, it seems like the best option for your goal. Next to an adhoc
Bluetooth is not complicated.
On your mobile phone, if you don't want to make your own app you can look for some sort of Bluetooth Terminal or Bluetooth Chat. On your raspberry pi you'll have to setup a bluetooth rfcomm server with bluez.
How to configure Linux to act as a Bluetooth RFCOMM SPP server?
RFCOMM without pairing using PyBluez on Debian?
Modify these servers which do nothing by default, to listen for commends "arm" and "disarm". Make sure the ID of the device is the ID of your phone.
Ad-Hoc is even less complicated (assuming you know how to make a webserver and are going to make it secure enough, and have a dongle which supports adhoc):
Here is a post about ad-hoc networking with a raspberry pi.
In terms of distance, you'll have to see the specifications on your dongle(s) but I would say they're relatively the same.. your bluetooth dongle will have a class see Bluetooth Basics: Range. This will require more research but if you have either one of the dongles I would use that method.
I hope this helps, good luck setting up your alarm.
In the mean time I realized that a fast arming could be done via the Pi Face and pressing a button.
Disarming could go by other ways.
However the fastest solution would be a fingerprint button linked safely to Pi Face.
Updates. Finally went with the Ad-Hoc method:
This is the tutorial for it:
http://elinux.org/RPI-Wireless-Hotspot