Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i install Pyrealsense2-aarch64 into my Raspberry pi 4 8Gb version #12886

Open
Sharath-MRNoBoDy opened this issue Apr 29, 2024 · 17 comments

Comments

@Sharath-MRNoBoDy
Copy link

Sharath-MRNoBoDy commented Apr 29, 2024

Products that iam using are as follows

Camera | Intel Realsense camera d457
OS | Ubuntu raspberry pi bookworm
Platform | Raspberry pi 4b 8gm version
kernel | 5.15.0-1053-raspi ..... aarch64 GNU/Linux

I was able to follow the IntelRealsense SDK tutorial that is available here .
I am able to view the camera from the realsense Veiwer and SDK.

Now comes the error i get by installing pyrealsense2-aarch64 it throws a error saying

pip install pyrealsense2-aarch64
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement pyrealsense2-aarch64 (from versions: none)
ERROR: No matching distribution found for pyrealsense2-aarch64

I have install
python 3.10.12
PIP 22.0.2

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 29, 2024

Hi @Sharath-MRNoBoDy Until recently the aarch64 Arm version of the pyrealsense2 pip packages only worked for Python 3.7 to 3.9 and you are using Python 3.10. Using an unsupported Python 3 version with pip install would likely cause the message ERROR: No matching distribution found for pyrealsense2-aarch64

Since version 2.55.1 of the SDK was released a week ago (April 21 2024), Python 3.10 has been supported.

image

Have you attempted installation of the SDK and pyrealsense2 wrapper since 2.55.1 and the new aarch64 file were released, please?

@Sharath-MRNoBoDy
Copy link
Author

yes i had tried to install this pyrealsense2 package but it still not able to resolve this issue on the RPI 4B
when i run a program using the import of this library i get this error
Traceback (most recent call last): File "/home/program.py", line 13, in <module> pipe.start(cfg) RuntimeError: Couldn't resolve requests
iam using the usb type c 3.1 cable
but the same cable is able to fetch the camera feed from the SDK but not able to view the feed when running a program

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 29, 2024

RuntimeError: Couldn't resolve requests is not related to the SDK or Python version. It occurs when a stream resolution / FPS combination has been requested that the camera cannot currently provide. If a valid resolution / FPS has been defined in a script then a common reason for it is if the camera's USB connection type is being mis-detected as USB 2.1 instead of 3.1 or 3.2, as the supported configurations are more limited on a 2.1 connection.

A way to test for this possibility would be to set your streams to 640x480 and 30 FPS in your config instructions, as this configuration will work with both USB 2.1 and 3.1 / 3.2. If 640x480 works then it is likely that your camera connection is being detected as USB 2.1 when running the script.

@Sharath-MRNoBoDy
Copy link
Author

Sharath-MRNoBoDy commented Apr 29, 2024

@MartyG-RealSense I have specified to the same frame specs as you have mentioned but iam not able to fetch the live feed

cfg.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30); cfg.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) ; cfg.enable_stream(rs.stream.infrared, 640, 480, rs.format.y8, 30) ;

I am trying to fetch 3 feed from the camera of RBG , Dept and Infrared
i am running the same program in the my PC
but the programs runs with out any for infrared feed but the frame gets stuck in the RGB and Dept feed

@MartyG-RealSense
Copy link
Collaborator

Do you have any other programs running that are using the depth and RGB streams when you run your script?

@Sharath-MRNoBoDy
Copy link
Author

@MartyG-RealSense no , just the program getting the RGB, Dept, and Infrared stream
other than this the RealSense Viewer is closed before running the program

@MartyG-RealSense
Copy link
Collaborator

What happens if you comment out the infrared stream and just access depth and color on your Pi?

@Sharath-MRNoBoDy
Copy link
Author

Even though I comment the NIR(Infrared) feed and other related snips
The code is still giving me the Runtime error

line 13, in <module> pipe.start(cfg) RuntimeError: Couldn't resolve requests

But the same Code Snippet is able to show the RGB and Dept Feed when I connect the camera into the PC and run the code.
This tells the code is error free

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 1, 2024

Does the script run if you remove the word cfg from the brackets of the pipe start line so that the script ignores the cfg lines and applies the camera's default configuration for each stream instead?

If the script does run with cfg removed, does the script work if you put cfg back in the brackets and remove the spaces before the ; semi-colon line end symbol that you have on the depth and infrared instructions?

cfg.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30); 
cfg.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) ; 
cfg.enable_stream(rs.stream.infrared, 640, 480, rs.format.y8, 30) ;

@Sharath-MRNoBoDy
Copy link
Author

If I do that change then it shows this error
AttributeError: module 'pyrealsense2' has no attribute 'pipeline'
since there is not attribute of Pipeline in pyrealsense2 package it is showing me the above error
And if i add the (cfg) in the pipeline then it wont run and shows Runtime error for the same line

@MartyG-RealSense
Copy link
Collaborator

When removing cfg from the brackets, does the AttributeError still occur if you change the import pyrealsense2 as rs line to the one below?

import pyrealsense2.pyrealsense2 as rs

@Sharath-MRNoBoDy
Copy link
Author

Sharath-MRNoBoDy commented May 8, 2024

When doing all this iam back to ground zero with a fresh boot to raspberry pi os i tried to build the wrapper from the here but getting all types of error from proxy server(connecting with the network team) to

sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package librealsense2-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package librealsense2-dev

I followed the guide from here

echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \
sudo tee /etc/apt/sources.list.d/librealsense.list
sudo apt-get update
deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo bookworm main
Ign:1 https://librealsense.intel.com/Debian/apt-repo bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease               
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Hit:5 http://archive.raspberrypi.com/debian bookworm InRelease
Get:6 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Ign:1 https://librealsense.intel.com/Debian/apt-repo bookworm InRelease
Err:6 http://archive.ubuntu.com/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Ign:1 https://librealsense.intel.com/Debian/apt-repo bookworm InRelease
Err:1 https://librealsense.intel.com/Debian/apt-repo bookworm InRelease
  Could not handshake: An unexpected TLS packet was received. [IP: 14.139.134.20 3128]
Reading package lists... Done
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-bookworm.list:1 and /etc/apt/sources.list.d/librealsense.list:1
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-bookworm.list:1 and /etc/apt/sources.list.d/librealsense.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-bookworm.list:1 and /etc/apt/sources.list.d/librealsense.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-bookworm.list:1 and /etc/apt/sources.list.d/librealsense.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-bookworm.list:1 and /etc/apt/sources.list.d/librealsense.list:1

Why am I seeing the warnings for GPG error and E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
I checked for the other warnings but the files are empty
I feel like my proxy is blocking Upgrades from happening

@MartyG-RealSense
Copy link
Collaborator

The distribution_linux.md package installation instructions should not be used with computers with an Arm architecture such as Raspberry Pi as they are designed for use with x86 / x64 architecture computers such as desktop and laptop PCs.

A method of installing librealsense on Raspberry Pi that historically works well for Pi is libuvc backend. This method can be performed with a simple build script at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md

@Sharath-MRNoBoDy
Copy link
Author

Hi @MartyG-RealSense
I iam not able to install pyrealsense2 in the same RPI 4B
I am able to install numpy and other packages in to the same device but the pyrealsense2 package is not able to be found iam getting this error is i try to install the same

root@ubuntu:/home/ubuntu/Desktop# source testpip/bin/activate
(testpip) root@ubuntu:/home/ubuntu/Desktop# pip3 install numpy
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting numpy
  Downloading numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.2/14.2 MB 11.0 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-1.26.4
(testpip) root@ubuntu:/home/ubuntu/Desktop# pip3 install pyrealsense2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement pyrealsense2 (from versions: none)
ERROR: No matching distribution found for pyrealsense2
(testpip) root@ubuntu:/home/ubuntu/Desktop# pip3 install pyrealsense2-aarch64
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement pyrealsense2-aarch64 (from versions: none)
ERROR: No matching distribution found for pyrealsense2-aarch64

@MartyG-RealSense
Copy link
Collaborator

Hi @Sharath-MRNoBoDy The pip install pyrealsense2 command does not work on Raspberry Pi, unfortunately. The wrapper must be built from source code instead.

The easiest way to do this on Pi may be to edit the libuvc backend procedure's build script to add commands to build the pyrealsense2 wrapper at the same time that librealsense is built.

Change line 46 from this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release

to this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true

@Sharath-MRNoBoDy
Copy link
Author

I tried the command u have mentioned and its still not able to install the same

@MartyG-RealSense
Copy link
Collaborator

A RealSense user at #11506 (comment) provided a detailed guide about how they set up librealsense and pyrealsense2 on a Pi 4 with Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants