DrAlexLiu / OctoPrint-PiNozCam

AI model running on RPi for failure detection
GNU Affero General Public License v3.0
39 stars 4 forks source link

Installation error on octo4a #16

Closed Ingegneus closed 5 months ago

Ingegneus commented 5 months ago

hey, when installing this plugin I get this error: ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.15.0 (from octoprint-pinozcam) (from versions: none) ERROR: No matching distribution found for onnxruntime>=1.15.0

which results in the message: "Installed: Unknown"

I have python 3.10 installed, and from what I can tell, onnx is inly supported up to 3.9

I am using a Samusng Galaxy Note 8 as my device using octo4a

DrAlexLiu commented 5 months ago

On the weekend, I will add more python support. I am compiling the new onnx version.

currently,

download the latest version https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/master.zip

Then, for this line, changing all cp39 to cp310? https://github.com/DrAlexLiu/OctoPrint-PiNozCam/blob/master/setup.py#L40 would you mind changing it manually from -cp39-cp39-linux_armv7l.whl to -cp310-cp310-linux_armv7l.whl" re-compress the files, and instill that zip into the octoprint?

Ingegneus commented 5 months ago

I still get the exact same problem. which makes sense, since the repo used for onnx is only for RPi, but I am using an android 9 device

DrAlexLiu commented 5 months ago

it should not be.

I believe as long as it is arm cpu, it should run. Also, if you install android, it should be x64.

could you run "uname -m" to let me know your CPU architecture?

I have oneplus 7 pro, I will test the octo4a on the weekend. Will let you know then.

Ingegneus commented 5 months ago

uname -m returns: aarch64

DrAlexLiu commented 5 months ago

Would you please wait until the weekend? I will take a look at the octo4a on my oneplus 7 pro and see what is going on.

It seems your phone and RPi have the same architecture, it should work somehow.

Thanks.

Ingegneus commented 5 months ago

Yes sure no hurry. Thanks for looking into this!

DrAlexLiu commented 5 months ago

The octo4a is running on alpine linux arm64 version. While RPi OS is based on Debian, which is using glibc. Alpine Linux does not natively support glibc.

Here is the detail related to the root cause. https://github.com/microsoft/onnxruntime/issues/2909

I tried to build the onnxruntime python on Apline Linux. But it failed, because some functions in onnxruntime is not supported by Alpine Linux gcc.

DrAlexLiu commented 5 months ago

After thorough investigation, I have to say running my AI program on Octo4a, which uses Alpine Linux, is impractical because of:

  1. Python Version Conflict: Installing my AI package requires the Alpine "edge" repository, which automatically upgrades Python to version 3.11, breaking Octo4a compatibility.

  2. Pillow Library Issue: The Pillow library, essential for my project, fails to work due to an ImportError related to a missing jpeg12_write_raw_data symbol in /usr/lib/libtiff.so.6.

  3. ONNX Runtime Compilation Failure: Compiling the ONNX Runtime fails because of missing GCC libraries, attributed to Alpine Linux's use of musl libc instead of glibc.

These challenges, particularly the Python version conflict and library compatibility issues, prevent me from proceeding without compromising Octo4a's stability and functionality. I'm open to suggestions or alternative approaches to circumvent these problems.

DrAlexLiu commented 5 months ago

@Ingegneus Today I give more tries, Octo4a uses Alpine Linux 3.17.1. But Apline Linux is using the rolling updates, so it is hard for me to find the latest python packages working with old version Alpine Linux.

As long as the Octo4a updates the latest version 3.19.1 (As of April 2024), my AI will support it.

My Oneplus 7 Pro can inference 60 pictures with Ubuntu running on it, by use of UserLAnd - Linux on Android. https://play.google.com/store/apps/details?id=tech.ula&hl=en_US&gl=US

Ingegneus commented 5 months ago

So you installed octoprint on an android phone with UserLAnd?

DrAlexLiu commented 3 months ago

@Ingegneus

Actually Octo4a is another UserLAnd with optimized with USB connection somehow, and octoprint preinstalled. UserLAnd - Linux on Android, actually has ubuntu on it. It would be easy to install octoprint, but I did not solve the USB connection with printer. I can use virtual printer, and the video feed can be input by Custom URL in my plugin.

You can try UserLAnd - Linux on Android, ubuntu image, as long as you connect your printer through USB, it would be good to run my plugin.

But in my viewpoint, there is no shortage in RPi. There is no need to run on an old phone with a lot of efforts, while buying a Pi is so easy.

Octo4a released 2.0.0, I will take a look. And I will let you know the result. They have updated to Python3.11, I believe it should work.