Balenadash keyboard not responding

Hello, I am running the latest balena-dash repo on my Raspberry Pi 4, Everything is working except when I unplug and plug in they keyboard, then the keyboard doesnt work?

The only change I had to make to the repo to make it work is to add in the –no-sandbox field to chromium browser
Are there any work arounds to get this to work?

Here is my startx log
root@eaef638373db:/usr/src/app# startx /home/chromium/xstart.sh – -nocursor

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
Current Operating System: Linux eaef638373db 4.19.75 #1 SMP PREEMPT Tue May 26 11:06:42 UTC 2020 aarch64
Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=64M cma=256M video=HDMI-A-1:1920x1080M@60,margin_left=0,margin_right=0,margin_top=0,margin_bottom=0 smsc95xx.macaddr=DC:A6:32:60:40:BA vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 rootfstype=ext4 rootwait root=UUID=ba1eadef-bf85-40b0-ac6e-9b3b4b2f9779 rootwait
Build Date: 05 June 2019  12:49:54PM
xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support)
Current version of pixman: 0.36.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jun 23 12:32:07 2020
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
 --disable-quic --enable-tcp-fast-open --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version=
[690:718:0623/123210.991121:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[690:911:0623/123211.382339:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[690:911:0623/123211.426550:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[690:911:0623/123211.426649:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[690:949:0623/123211.633516:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[690:949:0623/123211.635401:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

Hey there
Can I ask you if you use UDEV=1 ?
if you haven’t already done so, I suggest you read this guide: https://www.balena.io/docs/reference/base-images/base-images/#working-with-dynamically-plugged-devices

Thanks @JSReds,

Ive set UDEV to 1 as well as ensured the container is privlaged
This didnt fix the plugging problem

I also tried the ‘Installing your own Initsystem’ but my container gets stuck in an endless loop of stopping and starting, would it be possible for you to take a look?

build tohora from source

FROM balenalib/raspberrypi3-golang as builder

RUN go get -d -v github.com/mozz100/tohora/

WORKDIR /go/src/github.com/mozz100/tohora

RUN go build

use smaller image

FROM balenalib/rpi-raspbian

Install Systemd

RUN apt-get update && apt-get install -y --no-install-recommends
systemd
systemd-sysv
&& rm -rf /var/lib/apt/lists/*

RUN install_packages wget
xserver-xorg-video-fbdev
xserver-xorg xinit
xterm x11-xserver-utils
xterm
xserver-xorg-input-evdev
xserver-xorg-legacy
mesa-vdpau-drivers
chromium-browser
rpi-chromium-mods \
libgles2-mesa
lsb-release
cec-utils

We never want these to run in a container

Feel free to edit the list but this is the one we used

RUN systemctl mask
dev-hugepages.mount
sys-fs-fuse-connections.mount
sys-kernel-config.mount \

 display-manager.service \
 getty@.service \
 systemd-logind.service \
 systemd-remount-fs.service \

 getty.target \
 graphical.target \
 kmod-static-nodes.service

COPY entry.sh /usr/bin/entry.sh
COPY balena.service /etc/systemd/system/balena.service

RUN systemctl enable /etc/systemd/system/balena.service

STOPSIGNAL 37
ENTRYPOINT ["/usr/bin/entry.sh"]

Setting working directory

WORKDIR /usr/src/app

COPY start.sh ./
ENV LAUNCH_URL https://www.instagram.com
ENV UDEV=1

Add chromium user

RUN useradd chromium -m -s /bin/bash -G root &&
groupadd -r -f chromium && id -u chromium
&& chown -R chromium:chromium /home/chromium

udev rule to set specific permissions

RUN echo ‘SUBSYSTEM==“vchiq”,GROUP=“video”,MODE=“0660”’ > /etc/udev/rules.d/10-vchiq-permissions.rules
RUN usermod -a -G audio,video,tty chromium

COPY public_html /home/chromium/public_html

COPY --from=builder /go/src/github.com/mozz100/tohora /home/chromium/tohora

COPY launch.sh /home/chromium/

CMD [“bash”, “start.sh”]

I have granted access to https://dashboard.balena-cloud.com/devices/84d57661ef4896b7245262d56642cf4f/actions

Hello,
Can you please confirm which keyboard you are using?
My colleague has been able to plug in devices like keyboard, mouse, and webcam when using balenaDash without any issues.
Can you please try without installing systemd, and plugging the keyboard in before booting the device?

PS: the device is in local mode, so I cannot access it.

Thanks

Thanks @rahul-thakoor,

I have tried with two separate keyboards and a mouse, the issue is, They all work on boot-up, If I unplug and plug in, they dont respond? Is it not possible to allow for a un-plug/plug during runtime?

Hey patrick,
Can you run, udevadm monitor and try to plug/unplug the device and see it is properly being detected?