Having trouble getting the focus driver installed on my IMX477 motorized focus camera. I’m following the quick start guide on the Arducam docs site. The problem is the build_and_install.sh file won’t run as a script. When I run ./build_and_install.sh I just get ‘Exec format error’. What’s odd is the file shows up as a binary tar file, not a script, even after I decompress the archive. Running it on a Raspberry Pi 4.
Can you share a bit more detail? Which exact camera module and Pi you’re using, which archive file you downloaded, and the exact command plus the full output. That’ll help narrow this down.
It’s the IMX477 Motorized Focus Camera on a Raspberry Pi 4. I’m following this guide: For 12MP IMX477 Motorized Focus Camera - Arducam Wiki. The archive is imx477_rpi_dtoverlay.tar.gz. The command is just:
./build_and_install.sh
And the only output I get is:
Exec format error
That archive (imx477_rpi_dtoverlay.tar.gz) is a compressed tarball, not an executable, so you can’t run it directly. The ‘Exec format error’ is exactly what happens when you try to execute a compressed/archived file. What you need to do is:
- Unzip the archive first (tar -xzf imx477_rpi_dtoverlay.tar.gz)
- cd into the folder it extracts
- Run ./build_and_install.sh from inside that folder
Give that a shot and let me know what you get.
I did unzip it though. The archive extracts fine and I’m inside the extracted folder when I run ./build_and_install.sh. The issue is the .sh file itself is being identified as a binary tar file, not as a script, even after decompression. I’ve attached a screenshot of what I’m seeing. I followed the quick start guide step by step, so I don’t think it’s an extraction problem on my end.
Thanks for the screenshot, that’s helpful. I checked on our side and it looks like the file that was on the download server had a problem - it wasn’t packaged correctly, so the .sh inside was actually a tar/binary payload instead of the real script. We’ve updated the file just now. Can you delete the copy you have, download imx477_rpi_dtoverlay.tar.gz again, and try the extract + run steps once more?
Tried that - deleted everything, re-downloaded the archive, decompressed it again. The build_and_install.sh inside still gets identified as a binary tar file and still throws ‘Exec format error’. Same behavior as before.
Right, so what was happening is the file you originally grabbed was mislabeled - the script content itself was wrong (a tar/binary blob instead of the actual shell script), which is why even a correct extraction gave you a non-executable file. The updated version is now live on the server. Please make sure you’re not getting a cached copy - delete the old file completely and grab the fresh updated imx477_rpi_dtoverlay.tar.gz. After extracting, build_and_install.sh should show up as a proper shell script and run without the Exec format error. If a fresh download still behaves the same way, let me know and we’ll keep digging.
Thanks - after deleting the old copy and grabbing a fresh one, it finally extracts to a proper script and runs. Appreciate the help.