Intercom library for a raspberrypi
Project description
RPi Intercom
A mumble client written in python that makes a raspberry pi run as an 'intercom'. It can be used as a standalone service or imported as a library to integrate into other more complex projects.
What does this do?
This lets you set up a raspberry pi as an intercom. An intercom is a device that connects two points between to hear and be heard. This projects sets up a Raspberry Pi to do that. A Raspberry Pi intercom. It offers the following benefits:
- Easy to set up
- Configure GPIO inputs to mute/deafen/transmit/show connected status
- Uses Mumble, so you can also connect to it from your phone/computer/whatever.
- Requires no knowledge of Linux's truly arcane audio subystems
What does this NOT do?
- Solve problems that aren't related to intercoms.
- Handle bad networks well. There is no "anti-jitter" built into the audio processing like most audio clients so both sides of the intercom need to have a stable connection to the mumble server.
- Handle echo cancellation. This means that the audio played on a speaker "echos" back to the recipient unless the hardware you're using removes it. The project could eliminiate this in software but the algorithms for doing so are very hard.
Why does this exist?
I wanted to have an intercom between my living room and a basement office. After researching products available on Amazon and projects that do something similar I couldn't find anything that was both secure and easy, so I made it instead.
You will need
- A Mumble server. I host mine on a home server to keep everything local, but here isn't any reason it couldn't connect to the internet.
- A raspberry pi.
- Worked well for me on the Rapsberry Pi 2, 3, and 4.
- Worked like crap on a Raspberry pi Zero (but what doesn't?).
- Should theoretically work well on any Debian based environment. No windows because of an ALSA dependency.
- A speaker/microphone that does echo cancellation. I bought this one on Amazon and it works great, but many ~$50 alternatives exist. The echo cancellation is mandatory to avoid feedback that makes the intercom literally useless. Don't try to skip on this.
- Presumably you need a Raspberry Pi and speaker/microphone x2, so they can talk to eachother.
Quick Start
-
Install or acquire a mumble server. you coudl even install it on one fo your raspberry pi's.
-
Install the library:
sudo python -m pip install rpi_intercom
Note the
sudo
. This makes sure the library is installed for all users, which is important if you want to run it as a service later. -
Start the service on one or more devices:
python -m rpi_intercom --server my-mumble-server.local
--server
is the only mandatory configuration, you will probably to specify more stuff. With no further configuration it will use the default input and output sound device, connetct to the mumble server root, transmit constantly, and listen constantly.
Install it as a service
I've written a convenience script to set up the device as a systemd service that starts at boot as a dedicated user and restarts automatically. Once you have your configuration file, you can install the service a as by running:
sudo python -m rpi_intercom --install-service /path/to/your/config.yaml
Of course there is no reason you couldn't write the systemd unit file, create the user, etc yourself.
Configuration
While everything can be passed in on the command line, this is very cumbersome. Its better to create a configuration file, which you passin on the command line, eg:
python -m rpi_intercom --config /path/to/your/config.yaml
I even made a configuration script you can run to generate a config file easily by answering questions, which I recommend doing. Try it out with:
python -m rpi_intercom --generate-config /path/to/put/the/config.yaml
More on configuration TBD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rpi_intercom-0.0.19.tar.gz
.
File metadata
- Download URL: rpi_intercom-0.0.19.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41963b1f5bf7b29a330ba3da9591f6f58b003b68b3aaff54434e0fc4ebc80524 |
|
MD5 | 50e4cb76d64566f5724415d254c0acb1 |
|
BLAKE2b-256 | 2abb3d595f3b4b67769dd4f3bd107c4c67a2d209d3514f94490d0f0f19fe6ac7 |
File details
Details for the file rpi_intercom-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: rpi_intercom-0.0.19-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cf03c084ce0c69de9ced5046ee1234dc0a96b043492e015f4f310885c305484 |
|
MD5 | 664b43c3a62afc0a2ecd4380c827c30b |
|
BLAKE2b-256 | eadab137f88ac519907386ff2b39351f101730635697331f52f48e0843aeb932 |