1986 Raspberry Pi Video Doorbell

36,990

263

32

About: I love the design and ambition of vintage technology, and the usability and potential of new - my passion is bringing the two together.

The PiNG Video Doorbell is powered by a Raspberry Pi and is retro-stylishly cased in a 1986 Intercom and an old Sony cassette player.

When the doorbell button is pressed the Pi makes a high-quality video call using Google Duo, which can be answered on a phone, tablet or computer, letting you see and speak to callers when you're away from home (or at home but trapped under a cat). It works over WiFi and cellular, so you can even answer the door when you're out pounding the streets.

It also sounds a standard wireless door chime inside the house as a fail-safe, in case the call can't be taken.

The setup and code are very straightforward, read on and I'll show how you can make your own video doorbell from scratch in just a couple of hours for well under £50 (or for practically nothing if you already have a Pi and some components lying around!).

There's a full video showing the build and features on YouTube at https://youtu.be/Bn1qj2Uvl0w if you can't see the embedded version. The video's quite long but there are individual chapter links below so you can skip to the relevant section. There's also a behind the scenes video at https://youtu.be/7_2Ll03UDBw

Step 1: Opportunity Knock Knocks

I've always fancied making a video doorbell using a Raspberry Pi, but until recently I couldn't find an easy way to make video calls that would both work in a project and be straightforward for others to recreate. That all changed on 26th February however, when I read reports that a browser-based version of Google Duo had been released - meaning that it would run without installing a dedicated app.

Having already researched the challenges of making Pi calls with Skype and WhatsApp I was on the point of installing Android to try and use Google Duo, but was put off by not being able to easily integrate the GPIO interface, so the web app news was really encouraging. After devouring the articles I first tested Duo on my windows laptop, and swiftly moved on to try it with Chromium on my workshop machine, a Pi 2. This didn't go so well, the Duo site appeared and let me log in, but didn't display my contacts list or any options to change settings. I decided to look into using other browsers (the write-up said it also worked on Firefox and Safari) and also test it on a more beefy Pi 3.

I hooked up a Logitech webcam to the Pi 3 then fired up Chromium, and to my amazement was able to video call my wife in the living room seconds later, after tweaking a few settings. The webcam I tested had a built-in microphone and even on the first thrown-together test call the quality was great. This was a very exciting moment, unlocking the potential of the video doorbell project as well as many other possibilities.

So video-calling with a keyboard, mouse and screen was a definite go - but how to make this work with a headless Pi and buttons?

Step 2: Appy Duo

Software Setup Video: https://youtu.be/Bn1qj2Uvl0w?t=1029

Having Duo running in Chromium was great, and I assumed I'd just run it full-screen, but then (literally by accident) I realised it could run "out of browser", in the same way you can "install" web apps on a Windows PC - here's how:

- Go to the Google Duo site in Chromium on the Pi (https://duo.google.com/)

- Log in with the Google account you want to use to make the doorbell calls

- Click on the three dots (hamburger) > Install Google Duo (If you're not using the most recent Raspbian you may need to select More Tools > Add to Desktop

- Click "Add" in the dialogue box that appears

- A Google Duo shortcut appears on the desktop

If you then double-click the icon on the desktop Duo opens, but like an app, without the usual Chromium furniture. I'm not sure if running it in this way uses less Pi resources (seems to make sense?) but it does make for a cleaner interface.

After some testing I set up a separate google account for the doorbell and linked it to a phone number on an android phone - you may not need to do this if you have an existing google account and you're happy to use it for the doorbell.

It doesn't remember your login details at every launch, but it does stay logged in once you've opened it, mine has been running for over a week without having to touch it. Before making a test call you need to make sure the webcam is plugged in and choose the audio sources, by clicking on the "cog" settings icon and "Manage Sources". The mic & speaker options available are straightforward, and you can play a test sound to make sure they're correct - you'll have to grant permission in a popup the first time you do this, and may need to experiment depending on your webcam/audio setup.

With the sources saved it's also a good idea to set the video shape to Wide so that you see as much as possible when the doorbell calls you. To do this click on a contact as if you're about to make a call, then click on the "Show Wide Video" rectangle in the top corner of the video preview, then hit the X to go back. This setting will be remembered until the Pi is rebooted.

Step 3: Mouse Maps

If Duo were a full app then command line options might be available, for example to launch the app and immediately call a specific contact. In the absence of this (for now?) I needed to find a way to automatically start a call with a GPIO button press.

To do this I used the Python module PyUserInput which lets you program mouse movements, clicks and keyboard strokes.

The idea was to set up a script to wait for a button press, then move the mouse to the "Contacts" textbox, type the name of the contact, press "Enter" and click "Video Call". Duo remembers the last person contacted and shows them in the centre of the screen, but I didn't want to rely on this in case the doorbell called the wrong person (which happened in testing - sorry Harry)!

It took some trial and error to get the mouse to click in just the right place (having the app full-screen helped) and finding the right keystroke to emulate the "Enter" key was the same, but it was a lot of fun. On the GitHub page there's also a little script called Position.py that displays the mouse co-ordinates, which was very useful.

With this resolved, I then added in some more code to kick off the mouse moves based on a GPIO button click. This worked very well in testing, once the call had been hung up on the phone the Pi went back to its original screen, so when the doorbell button was pressed again it would repeat the same action.

Step 4: Software Setup

Software Setup Video: https://youtu.be/Bn1qj2Uvl0w?t=1029

After a lot of experimenting I refined the setup process to the steps below.

With a fresh (full) installation of Raspbian it's best to do most of the setup below with a monitor connected. First enable VNC server, and ideally log in / create a VNC account to make connecting to the Pi as straightforward as possible. With the Pi running headless you need to connect and log in to Duo after booting up, which is easy and just takes a few seconds - I normally just use my phone for this.

VNC can be enabled under Start > Preferences > Raspberry Pi Configuration (Interfaces tab). Because the Pi will be running headless we also need to tell it to assume an HDMI monitor is connected, and manually set a resolution (System tab) so that the mouse commands in the script line up with the elements on the web app. I chose option 19, 1280x720, if you use a different resolution you'll likely need to edit the mouse co-ordinates in the PiNG.py script.

Next we need to install PyUserInput from the terminal:

pip3 install PyUserInput

...and download the PiNG.py script from GitHub onto the Pi, I just popped it in the main Pi folder. To save having to start the script after each reboot it's worth setting it to run automatically once the desktop has loaded, by editing the global autostart file:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart 

...and adding in the following line at the bottom to point at the script location:

@python3 /home/pi/PiNG.py 

After a reboot the script should run automatically.

As the Pi will be probably be waiting a while for the doorbell to ring (unless you're really popular) it's also best to disable the default screen dimming, as this could interfere with the mouse clicks. Counter-intuitively the best way to achieve this is to install Xscreensaver:

sudo apt-get install xscreensaver

...as after installation you can configure the screensaver options (Start > Preferences > Screensaver) and set it to Disabled.

The Python code is on GitHub and is very simple - it essentially just programs the doorbell button to perform a series of mouse clicks to control the Duo web app on screen. Except it's not really on screen as the Pi is running headless.

If you've completed the above and the Pi has rebooted, you should be able to disconnect the monitor (if you used one), connect to the Pi via VNC from a phone or PC and log in to Duo, setting it to full-screen, choosing the audio sources and setting the video width as detailed above. Once that's done you can disconnect VNC and the doorbell is ready for use!

Step 5: Phat Audio

I knew that audio would be important for this project, as there's no point talking to the postman remotely if he can't hear you properly! I decided to go with the Pimoroni pHAT BEAT, as I had one handy - though in some ways that was slightly overkill for this project.

I only really needed a single mono output for the doorbell, but the pHAT BEAT offered stereo output to two speakers, as well as a nice LED VU meter.

There's not much to say about the installation & setup, I followed the instructions and was up & running in no time, listening to the hypnotic "Front Left, Front Right" of the test file.

The only complication of using the pHAT for the audio was that it would sit on all of the pins on the GPIO header - and I needed some of these to connect up the doorbell button and LED. To get around this I added in a pico hat hack3r - found in a party bag from last year's Raspberry Fields. It's a tiny but very handy board that essentially splits the GPIO output in two, letting you connect a HAT while still exposing a full set of GPIO pins. Though this is great you do have to be careful not to conflict with pins already in use by the HAT, so I double-checked pinout.xyz and decided on the following:

Doorbell button - GPIO22 (Pin 15) and 3v3 next door (Pin 17)
Notification LED - Positive to GPIO9 (Pin 21, via a resistor), Negative to GND at Pin 25

With the webcam, audio, button and LED connected up and working, I now had a working video doorbell - albeit spread out over an entire workbench. Next I needed to think about how it would be used and what it would look like.

Step 6: Extra Chime

So the setup worked fine on the bench, but what would happen IRL? I wanted to only have a single doorbell outside to save confusing visitors, but at the same time wondered what would happen if someone pinged it while I was unable to answer the call, or if someone else was in the house and didn't hear the Duo call coming through.

The answer to these worries was to include a standard wireless doorbell transmitter in the build, that would pair with our existing chimes in the house. This way the "normal" doorbell would ring even if the Pi part of the build stopped working for some reason.

I ordered a compatible doorbell button from Ebay (used, £2.50) and after some testing soldered two flying leads to the microswitch contacts of its circuit. This meant I could chop down the doorbell's plastic case and connect my own lever switch to trigger the chime.

Having this fail-safe made me feel a lot better about using this project "in the wild" and also added functionality for very little money - some video doorbell vendors will charge you up to £50 if you want an extra chime unit!

Step 7: Case Logic

Doorbell Case Video: https://youtu.be/Bn1qj2Uvl0w?t=416

Base Unit Video: https://youtu.be/Bn1qj2Uvl0w?t=856

Once I'd proved that the code would work the next thing was to decide on a case for the project. I wanted it to be obviously a doorbell, but didn't like the idea of having a fully-connected Pi hanging outside my house for obvious security reasons.

What I decided was to split the project in two - to have a doorbell unit outside the house, connected to a Pi base station inside. There were a couple of good reasons to go in this direction:

- Fewer components to squeeze into the exterior case and be exposed to the elements

- Much better WiFi signal inside the house, with the added option of Ethernet

- Easier to perform maintenance & upgrades

- Secure my precious Pi 3B+ behind a locked door

Making the decision on the webcam was easy - one of my MotionEye security cameras has been running 24/7 for over two years using a Microsoft Lifecam HD 3000 and a Pi Zero so this was a logical choice - especially as it has an integrated microphone. Many other webcams work well with the Pi, and you could even use a standard Pi camera - though then you'd need a separate microphone to capture the audio.

The exterior unit was also a no-brainer, a 1986 Intercom! I bought a 3-pack of these retro devices a while back and only used one in 2017 for the Google Pi Intercom project so had spares handy - plus I was already familiar with its innards and was confident I could make everything fit.

For the interior base unit I considered just using a standard plastic project box, but with the local Maplin having closed down it wasn't so easy to choose a suitable match - so I decided to re-use some more old tech and fit the Pi inside an old cassette player. This worked out really well as there was plenty of space - and meant that the VU meter LEDs could display through the tape window, a convenient extra touch. I was also able to connect the cassette player's original speaker to the spare output on the Phat Beat - meaning the ringtone and speech would play inside the house as well as outdoors.

To connect the two units together I decided on 6-core alarm cable, as this is pretty thin and easy to work with, adding a connection block at each end.

Step 8: Chopping and Fitting

As always the cases needed some dismantling & modification before they'd be ready for use, so I set to with the rotary tool to tidy up the insides, once I'd stripped out the original circuits.

The intercom was first, I had to chop out a plastic post to make room for the webcam, cut a hole for the wide angle lens (bought from Tiger) and sand away lots of protrusions to make things like the speaker easier to fit. Once I had a blank canvas I then thought about how to fit in the various components. I needed to make space for:

- A new speaker

- Two lever microswitches

- The wireless doorbell circuit

- The webcam

- The cable connection block

- The small protoboard circuit for the LED

...as well as the original switch and mechanism - this had looked spacious at first but now I was beginning to wonder.

To make the process easier I used a handy tip from my Hitachi Pi TV conversion, and first built a perspex chassis to hold all of the components. Perspex is absolutely ideal for this, as you can see through it when marking where to cut holes. First I cut it roughly to size, then drilled holes so that it would fit onto the intercom's existing screw posts. From here I added components one by one, drilling and cutting holes to either fit or make space for them. The other benefit of doing this was that I was able to test that everything was working before the final assembly!

To make the webcam fit I had to carefully chop away a lot of its plastic case, so that it would glue directly behind the wide angle lens - if you need to do this start by prying the front off it, don't hack away at the back with wire cutters and pliers as I did!

I was less fussy about the cassette player, and ruthlessly stripped out all of the circuits & components leaving just an empty box. Cosmetic parts like the big buttons were just hot-glued in place, and I filled a small broken lamp window hole with a red push-button.

To make the pi sit in the right place behind the tape window I first hot-glued a Lego plate to the underside of an old (obtained at the Pi 3rd birthday party!) Pi case. I then hotglued a matching plate inside the cassette player in just the right position, to make a nice semi-permanent fitting - the GPIO pins would be accessible with the tape door open, but I wanted to make sure I could get the Pi out to swap SD cards etc without any trouble. I've learned the hard way to plan ahead for future disassembly and maintenance! Lastly I chopped some slots in the exterior of the cassette player so that the USB and HDMI ports would still be available after assembly just in case.

Step 9: Assembly and Painting

Assembly Video: https://youtu.be/Bn1qj2Uvl0w?t=2002

Having test-fitted the perspex chassis into the intercom I gave it a coat of paint - I agonised over colours for a while, trying to choose between white, matt black and brown, but went with "Claret Red" for a change.

The final assembly was pretty straightforward thankfully, and I hot-glued the intercom chassis to the case towards the end, also fitting the wireless doorbell circuit inside the back of the unit to make it easy to change the battery. The very last job was to add in a nameplate, which I just printed out in various font sizes - but when I came to add this I realised that disastrously some hot glue had seeped through a tiny hole in the case, spreading all over the fresh paint and blocking the nameplate slot.

Two hours of delicate scalpel-scraping later the glue was gone, but I had to repaint part of the case - a total pain, but really I should have left the paint to harden for another few days - I'll never learn!

Step 10: Installation

To prepare for the installation I painted some thin conduit brown to match the front door, and drilled a hole to poke the cables through, using rubber grommets to fill the gap. I left myself about an hour to fit it, but this wasn't nearly enough time! In theory I just needed to mount the doorbell unit, feed the wires through the door and reconnect the alarm cable to the base unit, which should have been straightforward - it was anything but.

The intercom fixed to the doorframe easily, using strong 3m velcro pads rated for double the weight of the unit. When I came to reconnect the cables I found I'd snapped the stripped ends off two of them, and having them at different lengths needed some delicate work with tweezers to make the connections. Soon enough it was all connected though, and I powered up the Pi to test it. Here came problem number two - very weak WiFi in the porch. Not to worry, I thought, and added in an ethernet cable and powerline adaptor, which fixed the problem.

Next came the real-world test, and I logged in via VNC to set up Duo - this worked fine as before, but while I was setting the audio sources the PyUserInput actions fired as if I'd pressed the doorbell - and again and again, making video calls almost as fast as I could decline them. This set me sweating, and I carefully dismantled everything to check the connections, as it'd been working perfectly on the workbench for nearly a week. After checking the connections and finding nothing amiss I replaced the doorbell lever switch and tested the resistance of the whole unit with a multimeter. Then I tried a different pHAT BEAT. Then a different Raspberry Pi. And lastly a fresh pico hat hack3r. Nothing worked, it was as if someone was outside constantly leaning on the doorbell, the script just kept firing and making calls.

The only thing that was different to the workbench setup was that the cables were now fixed in place inside conduit, and in a much busier environment - and that turned out to be the problem. Interference was causing the GPIO to interpret pretty much anything as a button press. To try and combat this I first added in a 1k resistor between the switch and the Pi - this confirmed my thoughts as it slowed the false positive presses to one or two a minute. Next I shortened the cables inside the base unit as much as possible, and replaced the 1k resistor with a 10k version. This did the trick - I built a simple script to test it and each button press only fired it a single time, with no phantom presses in between.

For a part of the project I'd assumed would be fun & easy this turned out to be a frustrating problem solving exercise lasting over the Easter weekend, but finding the solution was very satisfying. The silver lining to the whole thing was swapping out the Pi - I was now using a Pi 3 B+, and there was a noticeable improvement in both call speed and quality - if you plan to build one of these I'd definitely encourage you to spend the extra few pounds on the highest-spec Pi possible.

Step 11: More Options

With the PiNG doorbell finally working I had a lot of fun with the kids (& cats) making the project video, and started thinking about the other things we could do with it. As the Python code is so simple to adapt there are endless options here, many of which I hope to try out soon:

  • Set the script to take a picture each time the doorbell is pressed, and upload it to Dropbox
  • Set the notification LED on the bellpush to light up constantly in the evening, either at a set time or using a Python module like Astral to calculate the local sunset/sunrise times
  • Set the ringtone & speech volume to automatically reduce at night (I just flip open the cassette lid and use the buttons on the pHAT)
  • Add in an extra button inside the house to cancel the call in case it's ringing but someone answers the door "manually" - it does time out after about 45 seconds however.
  • Set the script so that you can call the doorbell back - you could possibly poll the window name or check which window has focus and tell it to click "answer" if it detects the change
  • Theoretically you could program in the button & keyboard presses to automatically log in to Google Duo to save having to do this via VNC - this feels a bit unsafe though, and Duo does stay logged in once you've done it, I've left it running for days on end between presses to test it.

There are also lots of hardware adaptations possible:

  • Cut the USB cable and extend it using multi-core alarm cable (You can get 8-core quite easily) - I'm not 100% this will work or how long you could go but it would mean a much smaller hole to drill.
  • Make a version that uses a PIR sensor to start the call instead of a button - this would need fine tuning to be practical, but would be handy if your child has lost their ball and you can see it behind a chair in the garden.
  • Add in some extra LEDs or a separate solar-powered floodlight for night-time illumination
  • Make the case more waterproof (ours sits under a canopy so doesn't need it so much)

For receiving calls the phone & PC work really well, but you could potentially build a dedicated receiver unit, say for the living room, that's constantly listening out for calls and displaying photos or something in the meantime. It could still use PyUserInput to click "Answer" and you could probably even integrate Google Assistant using the AIY Kit, so that on a given voice command the call is answered - that would be very cool.

Another good use of the technology would be to build a super-easy video chat station, with just one big "Call" button - useful for making easy video calls with, say, an elderly or tech-phobic relative.

Step 12: The Last Bit

Conclusion Video: https://youtu.be/Bn1qj2Uvl0w?t=2894

I say this almost every time, but this was the most fun project I've made so far. It has just the right combination of new technology, old hardware and practicality. Maybe my favourite part though is its simplicity and reliability - I initially thought programming mouse moves on a headless Pi would be temperamental if it worked at all, but it works very well.

It was also really satisfying to harness video calling using a Pi, this has been one of my "Holy Grails" for a while, and Google Duo does a great job, especially on the Pi 3B+. The sound quality of the calls is astonishingly good, and the video is certainly smoother than expected. I hope the web version of Duo continues to develop and Google don't mess with the interface too much - although even if they did something like move a button or textbox the co-ordinates in the script could be easily changed. I read this week they may be adding group chat, I'll be interested to see how this works.

I'm now looking back at some of my old TV conversions and wondering whether to update them as video chat consoles, I do have one that already has a webcam built in, it would just need a mouse to control the calls. It'd be great to bring to life the future vision of videophones as imagined back in the 50s and 60s.

I admittedly went a bit overboard with this project, but you could build something similar with very few components, just a Pi, webcam, speaker & button really - we'd love to see any pics or videos if you do make one, you can tweet us @OldTechNewSpec or leave a pic in the comments. How about a nice touchscreen videophone in a dedicated case, or one where you use a rotary dial to choose a contact?

I'm writing this on 1st May and today was a momentous occasion - the first unsolicited "in the wild" call from the doorbell! During a lunch-hour walk in the city centre the doorbell called and I had a great 2-way conversation with an Amazon delivery person. I found out he didn't need a signature, discussed where to stash the parcel etc and the call quality was excellent, even though I was on a busy street with a not-brilliant 4G signal. I've been chuckling away to myself ever since.

It'd be ideal if there was a dedicated doorbell HAT for the Pi, with integrated speaker, microphone and button on one board, that could fit into a 3d-printed doorbell case using either a PI camera or webcam - I think that would make a great, low-cost (compared to commercial options) and practical kit, like the wildlife camera kits you can get now.

Thinking about it the Google AIY Projects HAT has all of those things - you'll have to excuse me while I give that a try...

If you enjoyed this Instructable check out my other projects and subscribe to Old Tech. New Spec. on YouTube for more videos!

Share

    Recommendations

    • Gardening Contest

      Gardening Contest
    • Party Challenge

      Party Challenge
    • Fandom Contest

      Fandom Contest

    32 Discussions

    0
    None
    PaulChau

    3 days ago on Introduction

    There is a modern version that is readily available in stores today. You can access the app from anywhere where there's a connection and you can save the video recordings too. It works great for receiving of parcels when you are away and to prevent thefts as the app detects motion too.

    0
    None
    SpinobiFire

    Question 7 days ago

    Hey MisterM,

    First of all thanks for your time and effort in sharing this resource, you've done an amazing job!
    I'll start by sharing something small that I've seen a few people asking about, then I've a question of my own too if that's okay?

    I noticed a few people asked about their camera taking a photo after the button depression, this thread is for people using Webcams:
    https://www.raspberrypi.org/documentation/usage/webcams/
    eg 'fswebcam image.jpg'

    This is for people using a Raspberry Pi camera:
    https://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md
    eg 'raspistill image.jpg'

    This would be a bash script to make a webcam take a photo and save it with datetime:

    #!/bin/bash
    DATE=$(date +"%Y-%m-%d_%H%M")
    fswebcam -r 1280x720 --no-banner /home/pi/webcam/$DATE.jpg



    So that's my contribution {^_^}! Now, I'm trying to follow in your footsteps and I'm encountering a problem with pymouse.

    I've made some notes here to try to document what's gone wrong and ways I've attempted around it:



    So the issue centers around it not being able to see the pymouse module, although it should be satisfied as you can see above, it's been presumably installed via PyUserInput, but to be doubly sure I've taken pymouse down on it's own.



    Next up, you can see some of the permutations of the module name that I've attempted changing:

    'from pymouse import PyMouse' {your original, working line that seems off now}
    says:
    pi@raspberrypi:~ $ sudo python3 PiNG.py
    Traceback (most recent call last):
    File "PiNG.py", line 7, in
    from pymouse import PyMouse
    ImportError: No module named 'pymouse'

    'from PyMouse import PyMouse'
    says:
    pi@raspberrypi:~ $ sudo python3 PiNG.py
    Traceback (most recent call last):
    File "PiNG.py", line 7, in
    from PyMouse import PyMouse
    ImportError: No module named 'PyMouse'

    Then adding '-1.0' to the name as it arrives after download from pip3 causes a syntax error:
    pi@raspberrypi:~ $ sudo python3 PiNG.py
    File "PiNG.py", line 7
    from PyMouse-1.0 import PyMouse
    ^
    SyntaxError: invalid syntax

    pi@raspberrypi:~ $ sudo python3 PiNG.py
    File "PiNG.py", line 7
    from pymouse-1.0 import PyMouse
    ^
    SyntaxError: invalid syntax

    Perhaps you could shed some light on what I've done wrong please? Has this affected the running of your door, or is it that I'm making a mistake that I'm not noticing?

    Thanks for your time & effort as it's much appreciated,
    Kenneth


    Edit after more attempts:


    So having learned of the merge of PyUserInput combining PyMouse and PyKeyboard, I've been following through their Github {the latest one, https://github.com/PyUserInput/PyUserInput}

    So I've fully removed PyUserInput and what I've established as an older redundant version of PyMouse, then taken down PyUserInput, Xlib, six and have attempted further ways of calling the modules:

    You can see here how I've tried to get it to import from PyUserInput directly ^


    After those changes, it doesn't complain about not finding the modules, however it's not able to see Xlib even though it's been taken down.


    Is there anything obvious that I'm getting wrong? After taking all of the packages down again, I'm getting the same problems in PiNG.py or position.py.

    Thanks for your time,
    Kenneth

    4 answers
    0
    None
    MisterMSpinobiFire

    Answer 7 days ago

    Hi Kenneth and thanks very much for sharing the useful links and your code experiences! I had similar head-scratching with PyUserInput at first but tracked it down to how I'd installed it, if I remember rightly I first installed it with "pip install PyUserInput" then got those "No Module Named ..." errors, then when I instead used "pip3 install PyUserInput" it was fine all the way, I think it's to do with the version of Python that pip and the Pi use as default. Hope that helps!

    0
    None
    SpinobiFireMisterM

    Reply 7 days ago

    Hey there! Thanks for your prompt reply!
    It seems as though Instructables has cleaned out the images I'd been sharing that were ladden throughout my post.

    Thanks for the tip on pip/pip3! The flumocksing thing about it is that the behaviour I'm mentioning happens even when I attempt pip3 install PyUserInput.

    So you can see here how I'm attempting to get it to take 'from PyUserInput import pymouse':
    https://monosnap.com/file/oSQV01abLU7x1UxWocFgfV5WwvVBP2

    Once you get that far it seems happy enough with the pathing to the modules PiNG.py wants, but it then starts to act up about not being able to find Xlib. Even with a pip3 of Xlib, it's still giving out:
    https://monosnap.com/file/eRhqNZVqcjHQVioyWEkwcarxXTWh97

    Once I can get past the issue of PyUserInput, my ambition then is to run a second python script that acts as a flask server, giving the user a HTML page with a button & remote GPIO, as it'd be the next logical step to allow a person trigger the door open if they're a friendly. You can see here in Matt Richardson's guide how it's quite easy to allow for a webpage that can add that functionality:
    http://mattrichardson.com/Raspberry-Pi-Flask/index.html

    For what it's worth, while investigating all of this manner of project, it is worth noting that UV4L can allow data transmissions, so in theory, it'd be possible to have a call in which one could invoke some python to allow the user to activate a relay switch to a door lock. However in the mean time, I'm hoping to get your project working with Google Duo and another HTML page to do what I'm after.
    Thanks,
    Kenneth

    0
    None
    SpinobiFireSpinobiFire

    Reply 7 days ago

    Okay, finally making a bit of ground here. It seems that you need to run this:
    pip3 install --user PyMouse
    Found here : https://stackoverflow.com/questions/51337887/cant-use-pymouse

    Having done that, I started to get new errors, at which point I twigged that the reason it was happening was because I was SSH'd into it.

    pi@raspberrypi:~/pingdoorbell-master $ sudo python3 position.py

    Traceback (most recent call last):
    File "position.py", line 4, in
    m = PyMouse()
    File "/usr/local/lib/python3.5/dist-packages/pymouse/x11.py", line 86, in __init__
    self.display = Display(display)
    File "/usr/local/lib/python3.5/dist-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
    File "/usr/local/lib/python3.5/dist-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
    File "/usr/local/lib/python3.5/dist-packages/Xlib/protocol/display.py", line 84, in __init__
    name, protocol, host, displayno, screenno = connect.get_display(display)
    File "/usr/local/lib/python3.5/dist-packages/Xlib/support/connect.py", line 73, in get_display
    return mod.get_display(display)
    File "/usr/local/lib/python3.5/dist-packages/Xlib/support/unix_connect.py", line 76, in get_display
    raise error.DisplayNameError(display)
    Xlib.error.DisplayNameError: Bad display name ""

    This is what it looked like via SSH^

    I skipped back over to the Pi itself directly {although VNC would be the same} and then tried position.py and it's doing what it's meant to now, pumping out x&y coordinates.

    The final hurdle now will be to get it to behave as it should via PiNG.py

    Thanks for your help MisterEmm, I'll share any other findings I have in case they help the next guy!

    0
    None
    MisterMSpinobiFire

    Reply 7 days ago

    I'm glad you're making progress there! I remember having problems like that with it when I was getting it to run on boot from the autostart file, turned out it would only run *without* the sudo before the python3, which sounds similar to your SSH problems. Good luck with the rest of it!

    Muchas gracias por darte tu tiempo y compartir tus conocimientos , se agradece sinceramente; sigue asi amigo

    0
    None
    MisterMauto13142828

    Reply 9 days ago

    Good question - I used a lot of bits I already had, to use exactly the same things it'd probably be around £60, but I splurged on a specific speaker for the case and used the pHAT Beat, really for a basic version you just need a Pi, a webcam, button and a battery speaker so could be as little as £40-45 :)

    0
    None
    MarkosMark

    15 days ago

    Nice project! Is it also possible to preview the video before answering? Because if I'm seeing it right, you can only see the video after picking up the call.

    6 replies
    0
    None
    MisterMMarkosMark

    Reply 15 days ago

    I think technically if you have "Knock Knock" turned on in the Duo settings then it's set to show the video as a preview, but in reality on the Pi it makes the connection first and starts ringing then shows video as soon as it can, which takes a second or two - I imagine it would show the preview if it was left ringing long enough?

    0
    None
    MarkosMarkMisterM

    Reply 14 days ago

    Would you, or someone who is using this, like to test this for me if that works? Because I don't have the hardware yet so I can't test it myself. And I can imagine that this would be an interesting feature for a lot of people.

    0
    None
    MisterMMarkosMark

    Reply 14 days ago

    That was an interesting test - I left it ringing until it timed out, about a minute, and the "knock knock" preview video didn't show through at all. Wondering if it would be any different with an integrated Pi camera rather than a USB webcam, will give it a try once I've got the "one box" version working.

    0
    None
    MarkosMarkMisterM

    Reply 13 days ago

    That's a bummer, hoped that the "knock knock" preview would work.

    0
    None
    MarkosMarkMarkosMark

    Reply 12 days ago

    I see more people have problems with the knock knock feature. I don't know if it isn't working at your setup because of the software in the doorbell or de settings on your phone. A few solutions I found are:
    - check settings to see if the option "limit mobile data usage" is disabled
    - clearing the app cache of Google duo and reboot
    - make sure it has the latest version
    - some countries block knock knock for legal reasons (privacy?)

    1
    None
    MisterMMarkosMark

    Reply 14 days ago

    I'll give it a go later this afternoon and reply back - curious myself now!

    0
    None
    pauldg99

    14 days ago on Step 12

    You need a laser cutter! :) Awesome project

    0
    None
    RumpelS

    14 days ago

    This is an interesting project. However your biggest error is using Google Duo. Do you remember that Youtube once was completely free of ad's? Now Google even puts ads which you cannot turn off anymore and asks you to pay for Youtube. The same will happen in the future with Google Duo. An other problem of a web based app is that in the future Google will modify it so it will need a newer browser. So you will permanently having to keep your doorbell up to date. Apart from that: Are you sure that you want Google to see all the people who ring your door? Did you know that Google uses Artificial Intelligence to scan ALL the data that runs over their servers? They make a profile about every user. So what you do is let Google see ALL your friends ringing you door bell and make a profile about you. Wellcome to George Orwell's state of surveillance!

    0
    None
    sevenmead

    15 days ago

    Excellent work! And the Instructable is top notch.

    1 reply