Sign inSign up

michdo93/crestron-roomview

By michdo93

•Updated over 1 year ago

Remotely control Crestron RoomView using Firefox & Flash Player in a virtual display via Python.

Image
Internet of things
0

262

michdo93/crestron-roomview repository overview

⁠crestron-roomview

A Docker container for the use of Crestron RoomView. This program is remotely controlled with Firefox 52 and Flash Player 32 in a virtual display by a Python script.

Crestron RoomView is an application for controlling projectors.

Crestron RoomView

ā šŸ“¦ Docker Image

The image is available on Docker Hub:

docker pull michdo93/crestron-roomview

⁠🐳 Docker Compose Example

version: '3.8'

volumes:
  x11socket:

services:
  crestron-roomview:
    build: ./crestron-roomview
    container_name: crestron-roomview
    volumes:
      - x11socket:/tmp/.X11-unix
      - /opt/docker/containers/crestron-roomview/config/url.txt:/config/url.txt:ro
      - /opt/docker/containers/crestron-roomview/config/resolution.txt:/config/resolution.txt:ro
      - /opt/docker/containers/crestron-roomview/config/display.txt:/config/display.txt:ro
      - /opt/docker/containers/crestron-roomview/app:/app
    environment:
      DISPLAY: ':99'
    restart: unless-stopped
    network_mode: "host"

ā šŸ“ Required Files and Directories

Before starting the container, make sure the following files and folders exist on your host:

/opt/docker/containers/crestron-roomview/
ā”œā”€ā”€ config/
│   ā”œā”€ā”€ url.txt          # e.g. http://192.168.0.59/
│   ā”œā”€ā”€ resolution.txt   # e.g. 1920x1200x24
│   └── display.txt      # e.g. :99
└── app/                 # optional: custom scripts like crestron_roomview.py

Note: The value in display.txt must match the DISPLAY environment variable defined in the Compose file (recommended: :99). If you choose a different display number, make sure Xvfb is started accordingly and the Python script is updated as well.

Make sure you create it with:

mkdir -p /opt/docker/containers/crestron-roomview/app
mkdir -p /opt/docker/containers/crestron-roomview/config

ā šŸ–„ļø Display Resolution

The default resolution is:

1920x1200x24

You can adjust this by editing the resolution.txt file. At first you have to create it with:

echo "1920x1200x24" >> /opt/docker/containers/crestron-roomview/config/resolution.txt

ā šŸ–„ļø Display

For the DISPLAY we use :99. If you want to use something else, you have to adjust the docker-compose.yml file, as well as the Python script (you can find it in the volumes), and restart Xfvb in the Docker container manually or by using the display.txt file.

At first you have to create it with:

echo ":99" >> /opt/docker/containers/crestron-roomview/config/display.txt

The DISPLAY variable is set via the docker-compose file, the display.txt file only starts services such as Xvfb with the corresponding variable. The Python script must always be adapted manually.

⁠🌐 URL Configuration

The url.txt file must contain the URL to your Crestron RoomView web interface, e.g.:

http://192.168.0.59/

Modify this according to where your RoomView system is hosted.

echo "http://192.168.0.59/" >> /opt/docker/containers/crestron-roomview/config/url.txt

ā šŸ”Œ Toggle Projector/Beamer Power

To toggle the projector or display device on or off, run the following command:

docker exec -it crestron-roomview /usr/bin/python3 /app/crestron_roomview.py togglePower

Make sure the DISPLAY environment inside the container is correctly set to match what's in display.txt (typically :99).

⁠🧠 Available Commands

You can control the projector or display device by executing one of the following Python functions inside the container:

docker exec -it crestron-roomview /usr/bin/python3 /app/crestron_roomview.py <command>
CommandDescription
togglePowerToggles the projector power ON or OFF, depending on the current state.
powerOnTurns the projector ON.
powerOffTurns the projector OFF.
reduceVolumeDecreases the audio volume.
increaseVolumeIncreases the audio volume.
muteVolumeToggles mute ON or OFF.
changeSourceToComputer1Switches the input source to "Computer 1".
changeSourceToComputer2Switches the input source to "Computer 2".
changeSourceToHDMI1Switches the input source to "HDMI 1".
changeSourceToHDMI2Switches the input source to "HDMI 2".
changeSourceToVideoSwitches the input source to "Video".
changeSourceToSVideoSwitches the input source to "S-Video".
sourceOpens the source selection menu.
autoTriggers automatic image adjustment.
blankBlanks (hides) the current display output.
enterSends an Enter key action (usually for menu confirmation).
freezeFreezes the current screen image.
openMenuOpens the projector menu.
menuLeftNavigates the menu to the left.
menuRightNavigates the menu to the right.
menuUpNavigates the menu upwards.
menuDownNavigates the menu downwards.
increaseBrightnessIncreases the screen brightness.
decreaseBrightnessDecreases the screen brightness.
increaseContrastIncreases the contrast of the display.
decreaseContrastDecreases the contrast of the display.
increaseSharpnessIncreases the image sharpness.
decreaseSharpnessDecreases the image sharpness.

šŸ’” All functions simulate button interactions via image recognition and browser control.

ā šŸ› ļø Optional: Manual Build

If you want to build the container locally (without cache), use:

docker compose build --no-cache

ā šŸ“ License

MIT License – see LICENSE⁠.

Tag summary

Content type

Image

Digest

sha256:201e243d2…

Size

795.4 MB

Last updated

over 1 year ago

docker pull michdo93/crestron-roomview