dwyl / smart-home-security-system

Smart Home Security System
GNU General Public License v2.0
4 stars 2 forks source link

Welcome Display #10

Open nelsonic opened 4 years ago

nelsonic commented 4 years ago

At the entrance to the building we will have a small screen that is unmissable we will refer to as the Welcome Display. The display will show a basic "Welcome Home {FirstName}" to the person when they successfully authenticate at the door or show "Hello Stranger!" when the device they are using is unrecognised. Later we will use this display to show the most relevant information to the person entering the building. But for now, it's just "Welcome".

Todo

Stretch Goals:

nelsonic commented 4 years ago

@th0mas as discussed on the standup call this morning, the Welcome Display will be a reasonably large 40" 1080p screen (Old but still perfectly working order LCD TV) that consumes around 50W of power. We obviously don't want to keep this screen on 24/7 as it will use more power than all the Raspberry Pis @home combined; hence powering the screen via relay. 🔋 The Amazon order containing your POE splitter has a relay: image https://smile.amazon.co.uk/gp/product/B078Q326KT image It should arrive tomorrow (or by Monday at the latest).

Please let us know if you need any electrical wire in order to connect the relay to a 230V appliance in order to test this feature. I'd advise you to use a simple light💡 to simulate the "screen" being switched on/off by the relay. But if you're feeling confident in the relay and want to hack a mains power cable and connect an actual monitor to the relay, LMK which cable you need.

th0mas commented 4 years ago

Currently have no wire (or tools) to hook up 230V to another device. I'm not quite sure what I'll need to get that working but i'll look into it.

Running this on a separate Raspberry Pi might be worth it to prevent any issues with the Relay/Pi taking down the entire system, it also makes for a more clear separation of concerns between hub and device.

th0mas commented 4 years ago

For rendering a GUI on our welcome display we realistically have two options:

nelsonic commented 4 years ago

@th0mas cool. let us know what you decide and if you need a separate PI for this part of the application. From the perspective of the safety of the PI the relay should shield the circuit because it's based on a

Given the potential complexity of doing motion detection noted in https://github.com/dwyl/learn-nerves/issues/5#issuecomment-656587838 Maybe we can just use a PIR sensor to detect motion instead of going down the Camera route? The HC-SR501 is relatively low power and does not raise any privacy concerns. 💭 https://www.amazon.co.uk/AZDelivery-HC-SR501-Detection-Raspberry-including/dp/B07V9GFHFW

th0mas commented 4 years ago

Looks good. That board appears to use a UART serial port though, which we're already using for the NFC reader. I don't know if its worth finding a I2C or SPI board - although I doubt many exist, or finding a small USB-to-UART adapter

nelsonic commented 4 years ago

@th0mas good point on the potential mutually exclusive UART devices. 👍 However, its worth remembering that the Welcome Display will be connected to a separate Raspberry PI. So the UART will still be available on the Display RPi which can be connected to a PIR and Relay.

The two distinct RPis will be separated by 2m and independently powered by POE. Let's operate under the assumption that we have 3 Pis that each perform one job:

  1. The first RPi0 reads the NFC/RFID chips/tags and send s
  2. The RPi4 ("Nerves Hub") handles authentication requests centrally and will be placed in the server rack next to the POE switch. (the location is not important just know they are physically separate but connected to the same network switch)
  3. The second RPi0 powers the Welcome Display and is otherwise "dumb" to the rest of the system; it just displays what the Hub instructs. A stretch goal for the RPi0 powering the welcome display is to use a PIR and Relay to switch on/off the display in response to motion at the front door.

Maybe this annotated photo of the entrance will help:

ihome-front-door-entrance-annotated

So we can still connect the PIR sensor to the RPI that feeds/powers the Welcome Display. 👍

th0mas commented 4 years ago

Whoops! that makes sense, looks like there is no problem using that motion detector then :)

nelsonic commented 4 years ago

@th0mas LMK if you need an extra RPi0 to connect to a Welcome Display so your setup is mirrored to "Production". 💭

th0mas commented 4 years ago

sigh

https://github.com/boydm/scenic_driver_nerves_rpi/issues/13

Can't currently run Scenic on an RPi4, and I doubt the RPi0 will be able to run it (it hangs on my MacBook).

I'll hack together a Js-based display for now

th0mas commented 4 years ago

Seems like RPi4 support for https://github.com/nerves-web-kiosk is lacking as well.

Might have to abandon Nerves for this display, and run Chromium on top of Raspbian as described here: https://pimylifeup.com/raspberry-pi-kiosk/

We could point it at a LiveView page on the hub?

@nelsonic thoughts?

nelsonic commented 4 years ago

@th0mas that's a bummer. 😕 (but not a brick wall) If anything, it might be a blessing in disguise. 💭 If we run the displays in Kiosk mode e.g: leveraging https://github.com/guysoft/FullPageOS (though I'm not so happy about the need for running it as root ...) It means they are truly "dumb" and don't know anything about the rest of the system. The default page for the Kiosk can still connect to the hub and display any content it needs to in near-real-time using incredibly basic JS code as noted in https://github.com/dwyl/smart-home-security-system/issues/9#issuecomment-657560631 (though I'm sure we will want a bit more than that)

Definitely up for using LiveView for this, seems like a good use-case. Does that mean Scenic is out? 💭

nelsonic commented 4 years ago

Obviously I would much prefer to run this as Nerves project to avoid having a full OS on any of the PIs ... 💭 Raspberry Pi 3 appears to be supported by: https://github.com/nerves-web-kiosk/kiosk_system_rpi3 💡 @mobileoverlord the Don of Nerves appears to be using RPi3 for his projects, so you know it will work. 😉

Happy to send you a RPi3 so you can maintain your momentum on this and use Scenic ✅ It makes sense to use the RPi4 as the "Hub" as it has the most power, it will eventually be controlling 40+ Pis once we have all the garden/plant stuff up-and-running running.

On our standup call you mentioned using a Raspberry Pi 3 A+: https://smile.amazon.co.uk/RASPBERRY-Plate-Model-Cortex-11811853/dp/B07KKBCXLY

raspberry-pi-3a+

But Raspberry Pi 3 Kiosk appears to focus on the "B" model:

image

Please confirm that it will work with the RPi3 A+. The difference in price to the B+ is negligible. Guessing you'll need another Micro SD card for it too. Do you need anything else?