Cannot get Balena to show *any* usb devices - trying to get usb printer with CUPS on balenaCloud

Hi, I’m trying to get an Epson TM-T20 series USB thermal printer working via Docker container with balenaCloud on Raspberry Pi 4.

Unfortunately, I’m having a strange experience where balenaOS and the containers are not seeing any USB devices. Currently for testing purposes, I have the printer, a keyboard, a mouse, and a USB drive plugged in (and have tried in various combinations) and none of them are recognized. I’ve poured over the documentation, tried every “docker cups” I can find on GitHub including the semi-official one (willswire/balenaPrint), and I cannot get CUPS, the container, or balenaOS itself to see any USB devices.

I have confirmed that everything works just fine with Raspbian - a brand new unconfigured installation correctly has all devices listed with lsusb and the printer appears sym linked at /dev/usb/lp0 and under /dev/bus/usb/002/.... It is only when used via container with balenaOS that no USB devices work. Network printers appear fine in CUPS, as expected.

balenaOS:

balena ssh <UUID>.local
root@UUID:~# lsusb
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 001: ID 1d6b:0002

Container:

balena ssh <UUID>.local main
root@UUID:/# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Things that I have tried singularly and in combination:

  1. Variations of ENV UDEV=1, ENV UDEV=on, ENV UDEV 1
  2. Overriding ENTRYPOINT and manually copying and pasting the default entry.sh file to ensure udevd is set up
  3. Setting privileged: true and/or devices: <many forms> in docker-compose.yml
  4. Setting balena push ... --env UDEV=on and variants
  5. Deriving FROM various balenalib base containers - buster, ubuntu, alpine, etc.
  6. Pushing to a “local mode” device
  7. deploying to a cloud-managed device
  8. All of the docker cups example I can find on GitHub: didrip/cups-docker, unixorn/docker-cupsd, olbat/dockerfiles, willswire/balenaPrint, jacobalberty/cups-docker, and maybe some others.
  9. Lots of different ideas from threads on this forum

For example, pushing this minimal Dockerfile does not appear have any USB devices attached:

# Dockerfile.template
FROM balenalib/%%BALENA_MACHINE_NAME%%:build

ENV UDEV=on

CMD ["sleep", "7d"]

I’m banging my head against this for quite some time now, and nothing seems to be working. Any ideas or support would be greatly appreciated.

Dear @asdf10489 - I am sorry, its not you - its us.
If you’re having an RPi 4 B, Rev. 1.4 - thats probably your problem (RPi changed how the USB controller gets intialized):

I guess the guys are working on a fix - however, the most easy way for you would be to downgrade to balenaOS 2.75.0+rev1 - this is reported to be working.

Sorry for the inconvenience!

1 Like

@nmaas87 thank you for the prompt response. I spent so much time thinking I was doing something wrong! 🤦🏻

According to this recent thread the OS can’t be downgraded without physically accessing the device - is this still correct? Presumably we’d need to use etcher again with the new image?

If anyone else finds this in the future, you can download the old OS with:

balena os download raspberrypi4-64 --version 2.75.0+rev1 -o balena_raspberrypi4-64_2.75.0+rev1.img

And the GitHub tracking issue for Pi 4 USB is https://github.com/balena-os/balena-raspberrypi/issues/710

Sorry @asdf10489 - my gut feeling would be that no downgrade is supported.
I guess you got two options right now, depending on your schedule:
Either physically reflash your OS with the old one, or wait until the next release comes and upgrade - which would be without having to reflash.

Its always a bit tricky, you said you do you it with balenaCloud - so “online” in a fleet, is that correct? Because this would simplify your upgrade. (instead of using it offline with just flashing balenaOS and using it on local network without balenaCloud).

Maybe @chrisys or @floion (who made the changes / fix) could tell us when the next RPi4 release is coming out with the USB fix :slight_smile:

Cheers!

This issue was resolved with version v2.85.2+rev2! Thank you for the help.

2 Likes

Sorry I missed this thread @asdf10489 – glad to hear it worked out with v2.85 though! :slight_smile: