Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. Modal Pipe Architecture (MPA)
  4. Custom Server in VOXL MPA

Custom Server in VOXL MPA

Scheduled Pinned Locked Moved Modal Pipe Architecture (MPA)
13 Posts 3 Posters 5.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Alex KushleyevA Alex Kushleyev

    @Jetson-Nano , it looks like your server will also be a mpa client - it will need to subscribe to the data from voxl-qvio-server. After processing the data, will you need to publish something from your server?

    You can get started by using the following tool / example (voxl-inspect-vio) : https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-tools/-/blob/master/tools/voxl-inspect-vio.c which you may have already used on VOXL2. The example subscribes to the vio output and prints out some data to the terminal. You can extend this example to achieve what you need. In terms of building the application, you can see how the tools are built in this repo and follow the same structure to add your application to a separate project or to your own copy of the voxl-mpa-tools project.

    Alex

    Jetson NanoJ Offline
    Jetson NanoJ Offline
    Jetson Nano
    Veteran
    wrote on last edited by Jetson Nano
    #3

    @Alex-Kushleyev thank you for reverting,
    I would like to subscribe data from the MPA pipe(features detected, no. of points detected) and give a condition , and if the condition is true run voxl-send-neopixel-cmd.
    so i would like to know.

    1. How to subscribe data inside or outside a server.
    2. Can I run the voxl-send-neopixel-cmd command inside a c++ file, if yes how, could you help me with the approach. Can a custom client get the data and start the command.
      @tom
    Alex KushleyevA 1 Reply Last reply
    0
    • Jetson NanoJ Jetson Nano

      @Alex-Kushleyev thank you for reverting,
      I would like to subscribe data from the MPA pipe(features detected, no. of points detected) and give a condition , and if the condition is true run voxl-send-neopixel-cmd.
      so i would like to know.

      1. How to subscribe data inside or outside a server.
      2. Can I run the voxl-send-neopixel-cmd command inside a c++ file, if yes how, could you help me with the approach. Can a custom client get the data and start the command.
        @tom
      Alex KushleyevA Offline
      Alex KushleyevA Offline
      Alex Kushleyev
      ModalAI Team
      wrote on last edited by
      #4

      @Jetson-Nano , I believe you should be able to prototype something by using the voxl-inspect-vio tool, as I mentioned above. You can build a custom version of it and modify the code to send out the following command, when you are ready, to control the neopixels. Please double check the code to make sure it does not have any issues (buffer overflow, etc.. it should not..), I am providing it just for reference 🙂

      std::string cmd = "voxl-send-neopixel-cmd"; //modify as needed
      std::string response;
      
      char temp_buf[512];
      
      FILE *fp = popen(cmd.c_str(), "r");
      
      if (fp == NULL){
          printf("Failed to run command\n");
      }
      else{  //read response from the process
          while (fgets(temp_buf, sizeof(temp_buf), fp))
          {
              response += temp_buf;
          }
          pclose(fp);
      
          printf("got response:\n");
          printf("%s\n",response.c_str());
      }
      
      Jetson NanoJ 1 Reply Last reply
      0
      • Alex KushleyevA Alex Kushleyev

        @Jetson-Nano , I believe you should be able to prototype something by using the voxl-inspect-vio tool, as I mentioned above. You can build a custom version of it and modify the code to send out the following command, when you are ready, to control the neopixels. Please double check the code to make sure it does not have any issues (buffer overflow, etc.. it should not..), I am providing it just for reference 🙂

        std::string cmd = "voxl-send-neopixel-cmd"; //modify as needed
        std::string response;
        
        char temp_buf[512];
        
        FILE *fp = popen(cmd.c_str(), "r");
        
        if (fp == NULL){
            printf("Failed to run command\n");
        }
        else{  //read response from the process
            while (fgets(temp_buf, sizeof(temp_buf), fp))
            {
                response += temp_buf;
            }
            pclose(fp);
        
            printf("got response:\n");
            printf("%s\n",response.c_str());
        }
        
        Jetson NanoJ Offline
        Jetson NanoJ Offline
        Jetson Nano
        Veteran
        wrote on last edited by Jetson Nano
        #5

        @Alex-Kushleyev thank you for reverting back.
        I made the changes in the voxl-inspect-qvio tool since voxl-inspect-vio is not visible on the latest version of sdk. will it work.
        due to a error from my end, I mentioned c++ file instead of c file, and since voxl-inspect-qvio is c file i had convert the code to c file.
        I also want to know can I automate the custom voxl-inspect-qvio tool when once the board is powered the tool will start without running the custom voxl-inspect-qvio command.

        Alex KushleyevA 1 Reply Last reply
        0
        • Jetson NanoJ Jetson Nano

          @Alex-Kushleyev thank you for reverting back.
          I made the changes in the voxl-inspect-qvio tool since voxl-inspect-vio is not visible on the latest version of sdk. will it work.
          due to a error from my end, I mentioned c++ file instead of c file, and since voxl-inspect-qvio is c file i had convert the code to c file.
          I also want to know can I automate the custom voxl-inspect-qvio tool when once the board is powered the tool will start without running the custom voxl-inspect-qvio command.

          Alex KushleyevA Offline
          Alex KushleyevA Offline
          Alex Kushleyev
          ModalAI Team
          wrote on last edited by
          #6

          @Jetson-Nano,

          You could convert C to C++ easily if you need to, often for simple code it is just renaming .c to .cpp should do it and update Cmake to use the new source. In any case, it looks like you have it working.

          In order to auto start your application on boot, you should write a systemd service as we do for all modalai services on voxl2.

          Here is an example service file for voxl-camera-server : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-camera-server/-/blob/master/services/voxl-camera-server.service

          Systemd is standard on ubuntu linux, so you should be able to find plenty of documentation if you need help with writing service files.

          Alex

          Jetson NanoJ 1 Reply Last reply
          0
          • Alex KushleyevA Alex Kushleyev

            @Jetson-Nano,

            You could convert C to C++ easily if you need to, often for simple code it is just renaming .c to .cpp should do it and update Cmake to use the new source. In any case, it looks like you have it working.

            In order to auto start your application on boot, you should write a systemd service as we do for all modalai services on voxl2.

            Here is an example service file for voxl-camera-server : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-camera-server/-/blob/master/services/voxl-camera-server.service

            Systemd is standard on ubuntu linux, so you should be able to find plenty of documentation if you need help with writing service files.

            Alex

            Jetson NanoJ Offline
            Jetson NanoJ Offline
            Jetson Nano
            Veteran
            wrote on last edited by
            #7

            @Alex-Kushleyev thanks for reverting .
            I got the code working.
            I created a custom voxl-inspect-qvio file. the code is able to turn ON the LEDs.

            1. Since we are not giving any command for turning OFF the LEDs is still ON even after regaining the QVIO overlay.
            2. Another question I had was regarding the same approach while using an external FC. Is it possible.
            3. Can you please mention the directory of the voxl-send -neopixel.cmd. I want to understand the code make necessary changes. Majorly with respect to the colors of the LEDs
            Alex KushleyevA 1 Reply Last reply
            0
            • Jetson NanoJ Jetson Nano

              @Alex-Kushleyev thanks for reverting .
              I got the code working.
              I created a custom voxl-inspect-qvio file. the code is able to turn ON the LEDs.

              1. Since we are not giving any command for turning OFF the LEDs is still ON even after regaining the QVIO overlay.
              2. Another question I had was regarding the same approach while using an external FC. Is it possible.
              3. Can you please mention the directory of the voxl-send -neopixel.cmd. I want to understand the code make necessary changes. Majorly with respect to the colors of the LEDs
              Alex KushleyevA Offline
              Alex KushleyevA Offline
              Alex Kushleyev
              ModalAI Team
              wrote on last edited by
              #8

              @Jetson-Nano ,

              The voxl-send-neopixel-cmd source code is here : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server/-/blob/master/tools/voxl-send-neopixel-cmd.c . I was planning on adding some functionality to extend the use cases. If you let me know what commands you might need, i can add those.

              Currently, to turn off the LED, you should be able to do it by setting the brightness value to 0 (-b argument).

              For using external FC, can you please clarify the connections between VOXL2, Modalai ESC and external FC? is external FC connected to ESC directly?

              Alex

              Jetson NanoJ 2 Replies Last reply
              0
              • Alex KushleyevA Alex Kushleyev

                @Jetson-Nano ,

                The voxl-send-neopixel-cmd source code is here : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server/-/blob/master/tools/voxl-send-neopixel-cmd.c . I was planning on adding some functionality to extend the use cases. If you let me know what commands you might need, i can add those.

                Currently, to turn off the LED, you should be able to do it by setting the brightness value to 0 (-b argument).

                For using external FC, can you please clarify the connections between VOXL2, Modalai ESC and external FC? is external FC connected to ESC directly?

                Alex

                Jetson NanoJ Offline
                Jetson NanoJ Offline
                Jetson Nano
                Veteran
                wrote on last edited by
                #9

                @Alex-Kushleyev thank you for reverting .
                I will try out the approach you mentioned.

                The VOXL2 board is connected to Flight Core V2 (FC) and the FC connected to modalai FPV ESC .

                1 Reply Last reply
                0
                • Alex KushleyevA Alex Kushleyev

                  @Jetson-Nano ,

                  The voxl-send-neopixel-cmd source code is here : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server/-/blob/master/tools/voxl-send-neopixel-cmd.c . I was planning on adding some functionality to extend the use cases. If you let me know what commands you might need, i can add those.

                  Currently, to turn off the LED, you should be able to do it by setting the brightness value to 0 (-b argument).

                  For using external FC, can you please clarify the connections between VOXL2, Modalai ESC and external FC? is external FC connected to ESC directly?

                  Alex

                  Jetson NanoJ Offline
                  Jetson NanoJ Offline
                  Jetson Nano
                  Veteran
                  wrote on last edited by
                  #10
                  This post is deleted!
                  Eric KatzfeyE 1 Reply Last reply
                  0
                  • Jetson NanoJ Jetson Nano

                    This post is deleted!

                    Eric KatzfeyE Offline
                    Eric KatzfeyE Offline
                    Eric Katzfey
                    ModalAI Team
                    wrote on last edited by
                    #11

                    @Jetson-Nano Can you try with the -o option when calling voxl-send-neopixel-cmd? Otherwise, it just sits in a loop sending out commands.

                    Jetson NanoJ 1 Reply Last reply
                    0
                    • Eric KatzfeyE Eric Katzfey

                      @Jetson-Nano Can you try with the -o option when calling voxl-send-neopixel-cmd? Otherwise, it just sits in a loop sending out commands.

                      Jetson NanoJ Offline
                      Jetson NanoJ Offline
                      Jetson Nano
                      Veteran
                      wrote on last edited by
                      #12

                      @Eric-Katzfey thank you for reverting.
                      I was able to run the code in loop and it is working good. now i want to automate this client file. start the file when the system is booted.

                      I have provided the External FC details in the above posts. @Alex-Kushleyev , can you verify the approach and help me out with the implementation.

                      Jetson NanoJ 1 Reply Last reply
                      0
                      • Jetson NanoJ Jetson Nano

                        @Eric-Katzfey thank you for reverting.
                        I was able to run the code in loop and it is working good. now i want to automate this client file. start the file when the system is booted.

                        I have provided the External FC details in the above posts. @Alex-Kushleyev , can you verify the approach and help me out with the implementation.

                        Jetson NanoJ Offline
                        Jetson NanoJ Offline
                        Jetson Nano
                        Veteran
                        wrote on last edited by Jetson Nano
                        #13

                        @Alex-Kushleyev @Eric-Katzfey can you check it out and help with the code.

                        I am also interested what kind of signal is send to the neopixel LEDs to turn it ON.
                        And with addition to that what is the command to turn ON only blue lights.

                        1 Reply Last reply
                        0
                        • Jetson NanoJ Jetson Nano referenced this topic on

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        ModalAI
                        Categories Recent Tags ModalAI.com Docs
                        © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups