Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome Display #10

Open
2 of 8 tasks
nelsonic opened this issue Jul 10, 2020 · 12 comments
Open
2 of 8 tasks

Welcome Display #10

nelsonic opened this issue Jul 10, 2020 · 12 comments

Comments

@nelsonic
Copy link
Member

nelsonic commented Jul 10, 2020

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

  • Connect the Welcome Display to the Raspberry Pi 4 running the Auth Server smart-home-auth-server
  • If a recognised device (NFC/RFID tag) is scanned on the reader (connected to the RPiZero), greet the person.
  • If an unrecognised display "Hello Stranger!" and Basic instructions to register the device.
  • Send a notification to connected devices informing people @home that there is an unrecognised device i.e. new person at the door who needs help getting in the building.
  • Allow the person to register their device by authenticating using auth-plug and associating the device

    Note: approval of the person/device will still be required by the "admin", but this can be done remotely (especially if the Pi Camera has high enough quality). This is basically a "door entry system" akin to the video door entry systems that have been common place in buildings since the 1980's. Most modern apartment buildings have a camera on the intercom that allows the person answering the door from their apartment to see who is requesting access.

Stretch Goals:

  • before the person scans their device, Show instructions to people to scan their device on the NFC reader
    e.g. "Hello! Please scan your device to enter the building." 👋
  • Saver Energy by only powering the display when a person is nearby (turn it off after 2 minutes to save power). 🔋
    e.g. using a relay to power the display and the Pi Cam to detect movement.
  • Use Pi Camera Using Raspberry Pi Camera with Wifi and Picam learn-nerves#5 to detect motion and turn on display. 📷
@nelsonic
Copy link
Member Author

@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
Copy link
Contributor

th0mas commented Jul 10, 2020

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
Copy link
Contributor

th0mas commented Jul 10, 2020

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

  • Elixir Scenic - https://github.com/boydm/scenic. This is a well-supported library on Nerves and would be absolutely fine for our use case

  • JS/WebView - Theres already a well supported Kiosk mode Nerves image that would allow us to just write normal JS for our GUI

@nelsonic nelsonic mentioned this issue Jul 10, 2020
5 tasks
@nelsonic
Copy link
Member Author

@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 dwyl/learn-nerves#5 (comment)
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
Copy link
Contributor

th0mas commented Jul 13, 2020

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
Copy link
Member Author

@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
Copy link
Contributor

th0mas commented Jul 13, 2020

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

@nelsonic
Copy link
Member Author

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

@th0mas
Copy link
Contributor

th0mas commented Jul 16, 2020

sigh

boydm/scenic_driver_nerves_rpi#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
Copy link
Contributor

th0mas commented Jul 16, 2020

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
Copy link
Member Author

@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 #9 (comment) (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
Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants