RPi4 RuuviCollector stops when display turned off

Hi!

I’ve followed the https://blog.ruuvi.com/rpi-gateway-6e4a5b676510 guide for getting logging with Grafana working. Only problem is that it stops when I disconnect or close my display. As long as the monitor/display is open and HDMI is connected it works, but I can’t get it working without it.

It stops immediately I change input on my monitor.

I have installed VNC and tried remotely starting the service. Adjusted display dimensions and disabled screen blanking but no luck. Has anyone else had this problem?

My analysis was a bit off at the start. The problem seemed to be my bluetooth keyboard, Logitech MX keys 2. RuuviCollector worked when the KB was connected. After few hours of inactivity or when I changed the KB to other device, the RuuviCollector or more specifically the BT stopped working correctly.

I unpaired the keyboard and added user to bluetooth: $ sudo adduser pi bluetooth

Also did the following:
$bluetoothctl

And then in bluetoothctl console:

$power on
$agent on
$scan on

Now it seems to work but need to see a few days.