Skip to content

Repository files navigation

インターホン(ラズパイ2台接続)

急に家の2部屋間で連絡を取りたくてインターホンが欲しくなった。
スマホでOKなんだけど、ちょっとした会話には充分過ぎる。 また、スマホが普及しているからだろうけど、市販のインターホンは少なくなっているようだ。
そこで、余っているラズパイを使ってみました。

構成

構成図

  • 2部屋間を繋ぐだけなのでそれぞれに1台ずつ設置し、Wi-Fiで接続
  • 通話ボタンをタッチするだけで相手と会話が始まり、ふたたびタッチすると切断
  • 保留やその他の通話機能は無し
  • 片方のラズパイには、SIPサーバー機能も兼用

ハードウェア構成

  • ラズパイ2台: Raspberry Pi 4B with タッチディスプレイ
  • USBスピーカーフォン2台: audio-technica AT-CSP1

ソフトウェア構成

他に開発環境として、Raspberry Pi connect (Beta)とVSCodeを使用

使い方

画面

アプリ画面待ちアプリ画面会話中

項目操作
発信通話ボタンを押すと、会話が始まる。
受信勝手に会話が始まる。
切断会話中に通話ボタンを押すと切断する。

マイクとスピーカーの音量調整もできる。 サービス化


導入

それぞれのRaspberry Piの構成と設定

項目Intercom1Intercom2
Raspberry PiRaspberry Pi 4BRaspberry Pi 4B
タッチディスプレイWAVESHARE 18645MPI4008
スピーカーフォンaudio-technica AT-CSP1audio-technica AT-CSP1
OSRaspberry Pi OS(64bit) with desktopRaspberry Pi OS(64bit) with desktop
Wi-Fi有効有効
IPアドレス(固定)(固定)
ホスト名intercom1intercom2
ユーザー名voicevoice
パスワード****************
SIPサーバーAsterisk version22.2.0-
SIPライブラリィpjsip version2.15.1pjsip version2.15.1
SIP nameintercom1intercom2
SIP idUrisip:intercom1@intercom1sip:intercom2@intercom1
SIP registrarUrisip:intercom1sip:intercom1
SIP passwordunsecurepasswordunsecurepassword

SIP password は例です、ちゃんと自分で考えましょう。

ダウンロード

git clone --depth 1 https://github.com/tomosatoP/intercom.git

次に設定ファイルを編集すること。

さらに次のファイルを再配置する。

filenameコピー先フォルダ補足
intercom.png~/.icons$ mkdir ~/.icons
intercom.desktop~/.local/share/applications
intercom.sh~/intercomコピーしなくて良いけど、実行権限を付与
$ chmod 755 (filename)

~/intercom にインストールした場合

SIPサーバーソフトAsterisk version22.2.0の導入

INSTALL_ASTERISK

  • Intercom1のみ実施

参考 https://docs.asterisk.org/Getting-Started/Beginning-Asterisk/

SIPライブラリィpjsip version2.15.1の導入

INSTALL_PJSUA2

  • Intercom1, Intercom2の両者で実施
  • 合わせて Python用仮想環境venvPython用GUIキットkivy も導入

参考 https://docs.pjsip.org/en/latest/pjsua2/intro.html

About

ラズパイ2台でインターホン

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages