项目作者: acejacek

项目描述 :
PIR controlled HDMI output for Raspberry Pi
高级语言: Python
项目地址: git://github.com/acejacek/pir_hdmi.git
创建时间: 2018-02-01T21:03:40Z
项目社区:https://github.com/acejacek/pir_hdmi

开源协议:MIT License

下载


PIR controlled HDMI

This daemon allows to control HDMI output in Raspberry Pi. It can put monitor to sleep when no nearby movement detected. It can be useful in kiosk applications. Works beautifully with MagicMirror. Requires Passive Infrared Sensor connected to Raspbrerry Pi. Look here for inspirations:

Installation

  1. Make sure you have all needed components:

    1. sudo apt-get install git
  2. Clone repository. From pi home execute:

    1. git clone https://github.com/acejacek/pir_hdmi.git

    New folder will appear: pir_hdmi. Navigate into it.

  3. Test if program works correctly. Check all options:

    1. sudo python pirhdmi.py --help
  4. Real check. Specify where your PIR is conencted (pin 11 in this example):

    1. sudo python pirhdmi.py --debug --pir-pin 11

    If all behaves as expected, interrupt program with Ctrl-C, and follow next step to install service.

  5. In pirhdmi.service adjust your setting, specifically --pir-pin to be the same as used in your connection.

  6. Configure systemd daemon to run script. Copy service definition to /lib/systemd/system folder:

    1. sudo cp pirhdmi.service /lib/systemd/system
  7. Now, activate the service:

    1. sudo chmod 644 /lib/systemd/system/pirhdmi.service
    2. sudo systemctl daemon-reload
    3. sudo systemctl enable pirhdmi.service
    4. sudo systemctl start pirhdmi.service
  8. Check the status:

    1. sudo systemctl status pirhdmi.service

Update

  1. In pir_hdmi folder execute:

    1. git pull
  2. All your customizations can be overwritten. Check again, if --pir-pin in pirhdmi.service points to correct one.

  3. If you copy updated service definition pirhdmi.service to /lib/systemd/system folder, remember to inform systemd about the changes:

    1. sudo systemctl daemon-reload
  4. Restart service:
    1. sudo systemctl restart pirhdmi.service