Getting a Neato XV-11 Lidar Working on the Q

OK, great. This is the root cause of the error. The other errors, which were shown in the arduino-app-cli app logs output you shared, are only side effects of this. This "Permission denied" error that was thrown by the spi.open call caused the Flask-based web application to fail to start, so the subsequent HTTP requests to the application's endpoint failed.

The problem is that the user account does not have write permission for /dev/spidev0.0. The modern way to manage these permissions is through udev rules:

The arduino user is automatically included in the gpiod user group:

$ groups
arduino adm dialout sudo audio video users netdev bluetooth docker sysupgrade render input gpiod

For the sake of simplicity, I'll use that existing group in a udev rule. Run the following command from the shell on the UNO Q's standard Linux machine (not inside the container) to install the udev rule:

$ echo \
'# See: https://github.com/doceme/py-spidev/blob/v3.8/99-local-spi-example-udev.rules#L31
KERNEL=="spidev*", GROUP="gpiod", MODE="0660"' \
| \
  sudo \
    tee \
      "/etc/udev/rules.d/60-spi.rules" \
&& \
sudo \
  udevadm control \
    --reload-rules \
&& \
sudo \
  udevadm trigger

I didn't mention this step previously because I thought you had probably already taken action to configure the permissions (e.g., per the previous discussion), but maybe you have just been relying on sudo for your experiments with SPI outside the container.

After that, rebuild the container. Hopefully this time the App will work as expected and you will see the SPI data printed in the arduino-app-cli app logs output.