• DepthAI-v2
  • DepthAI app fullscreen mode and Raspberry Pi Zero error.

ramkunchur It's mainly because the script doesn't default to a virtual env when it initiates. So, if you do not have library version interference problems with the default environment, you can install depthai wihtout virtual environment. That should work out.

    Hi dhruvsheth-ai...
    I've not used virtual environment to run my programs, I'm able to run on default system environment...
    Co-incidently, I have tried all ways (4) from a different article from same website except the crontab
    πŸ˜€ --> https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/

    The link you shared is from same website, but article is specific to crontab...
    https://www.dexterindustries.com/howto/auto-run-python-programs-on-the-raspberry-pi/

    I'll give crontab method a shot and update you,,,, probably it should work...

    Thanks & Best Regards,
    Ram

    Hi dhruvsheth-ai ...

    I'm able to run the app in fullscreen mode...it is by making some modifications, if I use inRgb.getCvFrame(), I get output in full-screen mode but this doesn't have my inference results shown, modified the code which I had shared earlier and able to get in full screen....thanks for providing inputs...

    Regarding start up... the crontab solution doesn't work as well, reason is if we use sudo python, we get an error unable to find module import depthai.

    We need to figure this out...it's quite important..

    Thanks & Best Regards,
    Ram

    Hi dhruvsheth-ai ...

    Any update on running Python program on start-up on Raspberry Pi? no luck from my side.

    Thanks & Best Regards,
    Ram

    We have an example to make it start on startup of the pi. We use it on the Pi compute module DepthAI. It was counterintuitive IIRC. so I don’t recall how to do it right away. Will ask.

      Thanks. Asked internally. Worst-case I'll be back in front of one of these Pi CM4 that has the solution in a week (I have all hardware except one of those with me!). But I think we should know sooner.

        Brandon If there's a working solution, you could text me and I'll try it on Pi4 to see if any of that works.

        OK, @GergelySzabolcs found it for us. :-)

        In /etc/xdg/autostart/runai.desktop the following needs to be set:

        [Desktop Entry]
        Encoding=UTF-8
        Name=RunAI
        Exec=lxterminal -e "/home/pi/depthai/autostart/startupdemo"
        Icon=lxterminal
        Type=Application

        Which is a path to this file: https://github.com/luxonis/depthai/blob/main/autostart/startupdemo

        And this is what allowed us to run anything on the Pi after the desktop is loaded and ready. The problem we ran into is that normal bash scripts would run before the OS was fully booted/ready/etc. so would error out on not being able to display OpenCV window/etc.

        So the GPIO stuff can be removed when running on a regular Pi instead of a OAK-D-CM4 or OAK-D-CM3, as on a regular Pi those IO will not go to the OAK-SOM reset lines (they'd just go nowhere).

        Thoughts?

        Thanks,
        Brandon

          Hi Brandon @GergelySzabolcs

          Thanks a lot...
          couple of queries

          what is the extension of file under startupdemo directory which is below script? (shell script? .sh), what is the specific file name or any name would be OK?
          https://github.com/luxonis/depthai/blob/main/autostart/startupdemo

          I'll create a new file with given extension and place it in my local directory

          Next, does this require openvino toolkit to be setup on raspberry pi locally?

          Thanks & Best Regards,
          Ram

            ramkunchur

            No extension, but it's a shell script, the first line in the file tells the caller of the executable text file (startupdemo) which interpreter to use, in this case bash is specified, this is also known as shebang.
            You can add .sh extension if you prefer.

            Openvino is not required, unless you want to do model conversion locally. There is a better alternative for it though, doing conversion online: http://luxonis.com:8080/