I’m trying to run platerecognizer/alpr-raspberry-pi on balenaos (only aarch64 for rpi4).
Their image is linux/arm. They don’t support aarch64 yet but will add support aarch64 in the future. They proposed to use the default 32bit rpi4 image.
On startup, it shows this warning and then it crashes without output.
WARNING: The requested image’s platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Is there a way to run this linux/arm image on balenaos?
PS: their image is using tensorflow and probably contains lots of optimizations
Hello, I seemed to get it running on a Pi 4 with balenaOS using the following docker-compose.yml file. However, I don’t have a license file/token to test with. Perhaps you can use this as a starting point:
@maartenc mine had a warning about a license file, which is why I moved license from a variable to a volume. Since I did not have a license file, it just kept warning about that: alpr License file not found. Request failed with code 404.
@maartenc the various license/token error messages appear to be coming from within the container, so it seems to be running under the 64 bit OS. Have you been able to provide a valid license/token to get past those messages and more towards ones that can provide additional insight about any compatibility issue between 32/64 bit?
@maartenc could you please confirm the device type of the fleet that you created?
Actually if you create a fleet for Raspberry Pi 3 (32 bits), deploy the code there and then add your Raspberry Pi 4? It will run a 32 bit container on the Raspberry Pi 4 (with 64 bit OS).
Reading the thread i’m not sure if you are running under these conditions or not. Could you please clarify? Thanks
I wasn’t aware that a aarch64 RPi4 could run inside a armv7hf fleet.
I’ve create a new fleet and moved the RPi4 into it.
I tried to run PlateRecognizer and uninstall the license on both fleets.
For comparison, I also added the output of the same commands on a working NUC device.
You can see that there is no PlateRecognizer output on the RPi4 beside the arch warning.
If we run the same PlateRecognizer image on RPi 32bit OS, it has the similar output as on the NUC.
RPi4 aarch64 on armv7hf fleet (moved from aarch64 fleet)
Run:
root@dbbe08e:~# balena run --rm -v 1926481_license:/license -e LICENSE_KEY=*** -e TOKEN=*** ac24f15c000f
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Uninstall license:
root@dbbe08e:~# balena run --rm -v 1926481_license:/license -e UNINSTALL=1 -e TOKEN=*** ac24f15c000f
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
RPi4 aarch64 on aarch64 fleet (moved from armv7hf fleet)
Run:
root@dbbe08e:~# balena run --rm -v 1919856_license:/license -e LICENSE_KEY=*** -e TOKEN=*** ac24f15c000f
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Uninstall license:
root@dbbe08e:~# balena run --rm -v 1919856_license:/license -e UNINSTALL=1 -e TOKEN=*** ac24f15c000f
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
NUC amd64 on amd64 fleet
Run:
root@f9e69c0:~# balena run --rm -e LICENSE_KEY=*** -v 1919848_platerecognizerLicense:/license -e TOKEN=*** b2e8fc363fff
PlateRecognizer v1.29.0
Starting online registration
You have used 8/20 license(s).
License Key: ***
Usage since 2022-03-27: 279/2500 calls.
Loading...
Loading detection zones.
[worker-0] Ready!
Closing Down...
Uninstall license:
root@f9e69c0:~# balena run --rm -e UNINSTALL=1 -v 1919848_platerecognizerLicense:/license -e TOKEN=*** b2e8fc363fff
PlateRecognizer v1.29.0
Successfully uninstalled SDK. You may now install it on another machine.
The base image platerecognizer/alpr-raspberry-pi is only available as 32bit.
If I inspect the image, it print arm for architecture.
It’s running fine on amd64 with image platerecognizer/alpr
I tried with the platform argument.
Now, it doesn’t print anything. Also the image platform warning log isn’t printed anymore.
So, I assume the platform is now 32bit.
But for some reason, the platerecognizer still doens’t start.
I tried running this on a 32 bit balenaOS on a Pi 3B+, but without a valid license file I just get “Environment variable TOKEN is missing or invalid. It is a 40 characters long string.” so it’s difficult to know if that works. Are you able to try on such a device to see if that makes a difference?
Hello @maartenc Alan asked internally to the balena team why is this not working. We will keep researching why it’s not working and we will let you know.
Hello @maartenc we have been discussing internally and what is happening here is very strange. We do have other fleets running 32 bit containers on 64 bit OS. However in your case, this is not working.
Do you think you can contact with the PlateRecognizer company to understand what is happening inside the pre-built container? Thank you!