Running a CLI Application on Device Display

Hello!

I’m currently working on moving a project that is using a CLI interface on Raspbian Lite to balenaCloud. The Dockerfile is currently working correctly and I can interact with the CLI using the Terminal on the balenaCloud Dashboard.

I need to configure the Raspberry Pi to use the connected display and keyboard for displaying and receiving input, however I’ve only been able to get the standard BalenaOS screen to be displayed. Are there any tutorials on how to display and receive input using a terminal on the device?

Thanks,
Duncan

@lowderd yeah that might be an issue since getty is waiting on TTY1. You could run an Xorg session though and bring up a full screen Xterm?

I think we have someone putting together a blog post for starting Xorg from a container, so look out for that one.

@lowderd yeah that might be an issue since getty is waiting on TTY1. You could run an Xorg session though and bring up a full screen Xterm?
I think we have someone putting together a blog post for starting Xorg from a container, so look out for that one.

I’d also be interested in this blog post. I can definitely get xterm to start up but so far it just won’t respond to the keyboard despite a number of different approaches.

Is there any information your team could provide in advance of the blog post? Any idea when that might come out? Thanks!

To get input from the attached keyboard I needed to set UDEV=1, I was use to using the resin base images and hadn’t read about the change in the balenalib base images that sets UDEV off by default. Here’s an example Dockerfile that will run a script titled ‘script.sh’ in xterm on startup.

FROM balenalib/raspberrypi3-python:latest

ENV UDEV=1

RUN apt-get update && apt-get install -y \
    xorg \
    xserver-xorg \
    xserver-xorg-core \
    xserver-xorg-input-evdev \
    xserver-xorg-input-kbd \
    xinit \
    xterm

COPY ./script.sh ./

CMD xinit -geometry 1024x600 -e "./script.sh"

Hey @lowderd, just a quick update on this. I have the sample project working, I will just finish a few detail and I will send you the git-repo link once I push everything to github.

The blog post should go live next week or so.

Thank you :slight_smile:

@lowderd here you go: https://github.com/balena-io-playground/balena-x11-example

Keep in mind that it is still WIP.

Cheers

Hi all, we have today published a blog post that covers running an x11 GUI application with a mouse and keyboard on balenaCloud. Here’s the link: https://www.balena.io/blog/running-a-desktop-manager-with-balena/

1 Like

Thanks! This is an awesome example and exactly what we were looking for.

2 Likes