Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Latest commit

 

History

History
64 lines (44 loc) · 2.41 KB

README.md

File metadata and controls

64 lines (44 loc) · 2.41 KB

Dataview Raspberry Pi Automator

This project includes a Dataview Atomator for the Raspberry Pi.

Currently Available Features

This automator currently supports the following operations:

  • Turn the HDMI output off (turn_display_off)
  • Turn the HDMI output on (requires sudo - see #1) (turn_display_on)
  • Starting Kodi (stop_kodi)
  • Stopping Kodi (start_kodi)
  • Muting pulseaudio (mute)
  • Unmuting pulseaudio (unmute)

Installing

Installation of the Raspberry Pi Automator can be more complicated than other automators if your operating system uses an outdated version of Python:

$ python3 --version
Python 3.2.3

If you do not have at least Python 3.4 and you have fully updated your Raspberry Pi please follow the Python upgrade guide.

Generating a X.509 Server Certificate

In order to provide secure communications between the RPC consumer and the RPC server, TLS is utilized. You must create a X.509 Server Certificate for this to work.

openssl genrsa -out server.pem 4096
openssl req -new -x509 -key server.pem -out cert.pem -days 730

Please see the instructions on how to generate a certificate for information about how to fill out the questions openssl asks.

Once you have generated the private key and certificate, copy the certificate (cert.pem) to the machine the RPC consumer is operating from.

Generating Authentication Token

You must generate an Authentication Token of at least 32 characters. You can use openssl with the rand tool as shown below.

$ openssl rand -hex 32
493152a14843198555759262f1bd767235789aebdcc5f1b1f8f2cd3a965c8c7a

When you launch the automator script, be sure that the RPCSERVER_TOKEN environment variable is set.

export RPCSERVER_TOKEN='GENERATED_TOKEN'

Launching automator

Be sure that you have generated the X.509 Server Certificate and exported the RPCSERVER_TOKEN environment variable, then:

$ python3 automator.py --tlscert cert.pem --tlskey server.pem --host 0.0.0.0:8443

NOTE: Make sure you are using python 3.4 to run the automator. If you build python as part of the installation process then use the following command:

$ python3 automator.py --tlscert cert.pem --tlskey server.pem --host 0.0.0.0:8443