I have successfully deployed Screenly OSE on the Balena platform. I am now hosting the Screenly Asset editing page on a website using a simple HTML5 box. I would like to use a VNC viewer on the opposite side of this for a live preview of the screen the Raspberry Pi 4 is connected to. However, I can’t seem to find a way to enable VNC on this device. Is this a possibility or is there a different route that someone can suggest?
Take a look at Receive Screen Output for external use. That should help point you in the right direction with regards to VNC.
I appreciate the reply. I have VNC loaded with Screenly, but I am getting a black screen. I can’t seem to get the coding right to pull the information from screenly into Vnc. I am not sure if I am pointing to the wrong display or how to fix it. I used the example here: GitHub - balena-io-playground/balena-vnc-example: Example project on how to run a GUI application via VNC
To be honest, I’m a little lost.
Dockerfile:
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch-run
RUN install_packages x11vnc \
x11-utils \
xvfb \
wmctrl \
supervisor \
x11vnc
WORKDIR /usr/src/app
COPY . .
ADD supervisor /etc/supervisor
CMD ["bash", "start.sh"]
Start:
#!/bin/bash
if [ -z ${VNC_PASS} ]; then
echo "STARTING VNC WITHOUT PASSWORD"
supervisord -c /etc/supervisor/supervisord_np.conf
else
echo "STARTING VNC WITH PASSWORD"
supervisord -c /etc/supervisor/supervisord.conf
fi
Supervisor App:
[program:x11vnc]
environment=DISPLAY=:1
command=x11vnc
Supervisornp:
[supervisord]
nodaemon=true
[program:xvfb]
command=Xvfb :1 -screen 0 1280x720x24
[program:x11vnc]
command=x11vnc -shared -display :1 -oa /var/log/x11vnc.log
autostart=true
autorestart=true
startretries=10
[include]
files = /etc/supervisor/app.conf
Docker-compose
version: "2"
services:
vnc-app:
restart: always
build: ./vnc-app
ports:
- "8080:5900"
srly-ose-server:
image: screenly/srly-ose-server
build:
context: .
dockerfile: docker/Dockerfile.server
environment:
- HOME=/data
- LISTEN=0.0.0.0
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
devices:
- "/dev/vchiq:/dev/vchiq"
restart: always
volumes:
- resin-data:/data
labels:
io.balena.features.supervisor-api: '1'
srly-ose-viewer:
image: screenly/srly-ose-viewer
build:
context: .
dockerfile: docker/Dockerfile.viewer
depends_on:
- srly-ose-server
environment:
- HOME=/data
- PORT=80
- NOREFRESH=1
- LISTEN=srly-ose-nginx
privileged: true
restart: always
volumes:
- resin-data:/data
srly-ose-websocket:
image: screenly/srly-ose-websocket
build:
context: .
dockerfile: docker/Dockerfile.websocket
depends_on:
- srly-ose-server
environment:
- HOME=/data
- LISTEN=0.0.0.0
restart: always
volumes:
- resin-data:/data
srly-ose-celery:
image: screenly/srly-ose-celery
build:
context: .
dockerfile: docker/Dockerfile.celery
depends_on:
- srly-ose-server
- redis
environment:
- HOME=/data
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
devices:
- "/dev/vchiq:/dev/vchiq"
restart: always
volumes:
- resin-data:/data
redis:
image: screenly/srly-ose-redis
build:
context: .
dockerfile: docker/Dockerfile.redis
ports:
- 127.0.0.1:6379:6379
restart: always
volumes:
- redis-data:/var/lib/redis
srly-ose-nginx:
image: screenly/srly-ose-nginx
build:
context: .
dockerfile: docker/Dockerfile.nginx
ports:
- 80:80
environment:
- HOME=/data
depends_on:
- srly-ose-server
- srly-ose-websocket
restart: always
volumes:
- resin-data:/data:ro
volumes:
resin-data:
redis-data:
Hope this helps break down the current situation.