I was able to install Gen1 and run many of the examples on RPi Zero W connected to either Oak-D or Oak-1. The installation and test runs are done in a RPi terminal on the RealVNC screen share RPi over WiFi and MacOS 11. To install Gen2, I followed the most recent instructions on API docs (still in RPi terminal):

sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
sudo pip install virtualenv
mkdir depthai2 && cd depthai
virtualenv venv
source venv/bin/activate (after this it's in venv)
python3 -m pip install -U pip
python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/ depthai==2.1.0.0.dev+536addb2118cf67961d0d4d6bdad4eb46d711a08

At the end, it said "Successfully installed depthai-2.1.0.0". Then cd depthai-python/examples to install requirements:
python3 install_requirements.py
python3 01_rgb_previews.py

It reported "Illegal instruction".

I also ran under depthai2/ the following according to the Installation section:
git clone https://github.com/luxonis/depthai-python.git
Then python3 install_requirements.py under examples. Result is the same.

The venv folder only has python2.7. The python3.7 is in .local/lib/. Online search found the most recent RPi OS doesn't have python3.9. I'm not sure why Gen2 doesn't work.

Please help. Thanks.

Hi Jason,

This might help... but I too had a problem when I tried to explicitly install the snapshot version (my install also reported 'Successfully installed depthai-2.1.0.0') and so I just went back to the default install instructions and the issue automagically went away...

(pip uninstall depthai)
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
python3 install_requirements.py
git clone https://github.com/luxonis/depthai-python.git

I have since been able to successfully run the example scripts.

I am running RPi4 using VNC (and also sometimes directly via bluetooth keyboard and HDMI). I too am using virtual environments.

FWIW - interestingly - VNC so far works perfectly... but I have experienced 'weird issues' when trying to do the same work using my bluetooth keyboard and HDMI.

Hope this is helpful.
Cheers

    ryan Thanks Ryan for sharing your experience. Looks like we followed very similar steps, except that I didn't do the 'pip uninstall depthai' and did the git clone before install_requirements.py in /examples folder which is available only after the clone.

    Earlier I re-imaged the RPi OS. Instead of installing Gen1, I went straight to Gen2 using the git clone method. Here is the sequence:
    sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
    git clone https://github.com/luxonis/depthai-python.git
    cd depthai-python && create and activate venv
    cd examples && python3 install_requirements.py

    This way is free of Gen1 interference. Unfortunated, I got the same "Illegal Instruction" message running the example.

    Ryan, can you look under your venv/bin for python3 or python3.9? My macOS venv/bin has them, but the RPi only showed python2.7. I saw python3.7 mentioned in the log of install_dependencies.sh in RPi don't know why it didn't get in venv folder. I don't have a RPi4 to test out.
    -Jason

    ryan I also really likes the vnc screen sharing. I didn't have any issue when using a usb keyboard and hdmi monitor, while having a vnc session from mac side. The bluetooth part of RPi may have some bugs. Cheers, -Jason

    Jason. Apologies. I was mistaken. I take detailed notes, and should have checked them before responding. (I must have been thinking of something else that resulted in "Illegal instruction".)

    My error message was:

    (lux_only) pi@oak1b:~/depthai-python/examples $ python3 01_rgb_preview.py 
    Traceback (most recent call last):
      File "01_rgb_preview.py", line 23, in <module>
        with dai.Device(pipeline) as device:
    RuntimeError: Failed to find device (ma2480), error message: X_LINK_DEVICE_NOT_FOUND

    Most likely due to trying to run Gen2 examples with Gen1 depthai, I would think.

    My venv/bin is :

    (lux_only) pi@oak1b:~/.virtualenvs/lux_only/bin $ ls -al | grep python
    lrwxrwxrwx 1 pi pi   16 Apr  1 11:34 python -> /usr/bin/python3
    lrwxrwxrwx 1 pi pi    6 Apr  1 11:34 python3 -> python
    lrwxrwxrwx 1 pi pi    6 Apr  1 11:34 python3.7 -> python

    And in the hope that it might be helpful, I will include my entire install notes below:

    Downloaded 32 bit via Raspberry Pi Imager
    Set time/loc/passwd/connected to WLAN/ran upddates / rebooted
    Renamed host to 'oak1b'
    
    >Preferences>Raspberry Pi Configuration
        Renamed to 'oak1b'
        Enabled camera, VNC, SSH
        Increased GPU to 128
        rebooted / checked settings
    
    set static wifi ip / disabled IPv6 / rebooted
    
    connected to vnc 
    sudo rpi-eeprom-update checked
    right click on Task Bar and Add/Remove Panel items.
        added CPU temp
        added CPU usage
    
    sudo apt update
    sudo apt full-upgrade
    sudo apt install python3 python3-pip
    
    sudo apt install build-essential cmake pkg-config
    sudo apt install libatlas-base-dev gfortran
    sudo apt install libhdf5-serial-dev hdf5-tools
    mkdir python-envs && cd python-envs
    
    pip3 install virtualenvwrapper
    
    sudo nano ~/.bashrc
    
    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=./python-envs
    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
    export VIRTUALENVWRAPPER_VIRTUALENV=~/.local/bin/virtualenv
    source ~/.local/bin/virtualenvwrapper.sh
    export VIRTUALENVWRAPPER_ENV_BIN_DIR=bin
    
    exit
    
    mkvirtualenv lux_only
    
    [my notes are not clear at this point - but essentially - within the lux_only env, I followed the basic steps of dependencies.sh, install_reqs and then I wasn't sure which depth-ai to install, and ended up trying to install Gen1, and I think the snapshot (though maybe I am mistaken and am remembering a previous occasion...); 
    but the end result was that I ended up running: pip uninstall depthai]
    
    //then my notes start again...
    
    python3 install_requirements.py
    ...Installing collected packages: depthai
    Successfully installed depthai-2.1.0.0

    After that I was successfully able to execute the scripts in the examples folder.

    I hope this is helpful, and apologies for my initial incorrect response.

      Thanks, Ryan! And let us know if this doesn't solve it, Jason.

        4 days later

        ryan Somehow I missed your reply. I'll give a shot tonight. -Jason

        ryan I followed your notes:
        #rpi-eeprom-update is specific to Pi4
        sudo apt update
        sudo apt full-upgrade
        sudo apt install python3 python3-pip
        sudo apt install build-essential cmake pkg-config
        sudo apt install libatlas-base-dev gfortran
        sudo apt install libhdf5-serial-dev hdf5-tools

        I'm using virtualenv, which is on the path and I didn't find any env settings related to venv

        so I skipped those related to virtualenvwrapper

        cd depthai-python && activate its venv
        cd examples && python3 install_requirements.py # which uninstall depthai then install depthai-2.1.0.0 successfully.

        Run the 01_ example again. Same error "Illegal Instructions"

        Clearly, your venv contains python3.7. Mine didn't have it. I found python3 and python3.7 under usr/bin which is on the sys path. So it should not have caused the problem.

        Brandon Do you guys have any suggestions to install Gen2 on Pi Zero? You mentioned in one of the videos that you got a Pi Zero working with Oak-1.

          Hi @Jason ,

          Sorry about the delay. So I'm not sure if it's related, but when we upgraded our Pi's recently, based on a tip from a local company here, we discovered that on the latest Pi OS we have some sort of issue that was not there at all on the previous versions. Here is the summary so far:

          https://github.com/luxonis/depthai/issues/354

          I do not know if this is related though. We had indeed gotten OAK-1 (and other depthai models working) on Pi Zero, but there may be some regression related to the above, or perhaps some other regression.

          Will test it out and report back. We have @themarpe and @GergelySzabolcs in parallel investigating what is going wrong here.

          Sorry about the issue/delays here.

          -Brandon

            Jason
            We don't have prebuilt wheels for pi zero (armv6).
            You need to compile and install wheels manually, according to the instructions from here.

            sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
            git clone https://github.com/luxonis/depthai-python.git --recursive
            cd depthai-python
            python3 -m pip install .

            Will take up to 1 hour.

              Jason

              Here is a wheel for pi zero based on latest release:

              install as python3 -m pip install depthai-2.2.0.0.dev0+f9b3c48b2e32937811e3c94261abf1864ebf92f8-cp37-cp37m-linux_armv6l.whl

                Brandon The discussion didn't can you get a link to the RPi OS download/install version that worked with pi zero?

                GergelySzabolcs Thanks. I followed the process. After 1.5 hr while building the wheels, the RPi Z started blinking and frozen (lost all connections). I had experienced this at least once during Gen2 installs (only some process build wheels, perhaps including the link listed below).

                  Jason Thanks and sorry for the pain. I'm asking internally about pre-building the Pi Zero wheels as well automatically.

                  I just responded to the Github issue on which version does work - but TLDR unfortunately I don't know yet as I didn't write down the version I was on when I did a dist-upgrade. But we have logs of this so @Brian is looking into it and we'll circle back.

                  GergelySzabolcs Is there a link to the wheel shown? It replied with an OSError about not finding the local file.

                  Our forum software is confusing. It makes the link look like an image because it has Google Docs integration. So the above is actually a link to the Google Drive folder. Below is the same thing written as code so that our forum software doesn't show it looking like an image:

                  https://drive.google.com/file/d/1pEb0_OCA3eYZAncolTHy8hSlQiK2S0KX/view

                  Here is the link with our forum software allowed to show it as embedded content:

                    Brandon Thanks. I downloaded and installed the wheel. When cd examples to run the 01_ example, it reported:
                    Unable to init server: Could not connect: Connection refused
                    Traceback (most recent call last):
                    File "01_rgb_preview.py", line 34, in <module>
                    cv2.imshow("bgr", inRgb.getCvFrame())
                    cv2.error: OpenCV(4.5.1) /tmp/pip-wheel-qd18ncao/opencv-python/opencv/modules/highgui/src/window_gtk.cpp:624: error: (-2:Unspecified error) Can't initialize GTK backend in function 'cvInitSystem'

                    I then did a 'python3 -m pip install opencv-python --force-reinstall', successfully, but still had the same error when running the example.

                      GergelySzabolcs Brandon
                      My bad. I should have remembered opencv window doesn't know where to imshow in ssh session. The X forwading still has the same problem. Are there more steps to set it properly? It works in vnc terminal now.

                      I always forget how to properly get XForwarding working. I ended up getting a mini-HDMI to HDMI adapter cable (here) and then a micro USB adapter (here) which I hooked to a USB hub (here) for doing all the initial testing on the Pi. That way I could get everything working first before fighting XForwarding