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

ModalAI Forum

  1. ModalAI Support Forum
  2. Ask your questions right here!
  3. Acessing modal pipe using bash (or python)

Acessing modal pipe using bash (or python)

Scheduled Pinned Locked Moved Ask your questions right here!
4 Posts 3 Posters 640 Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    For context, I was trying to use the instructions from docs/voxl-vision-px4-nuttx-shell to interface with the newer voxl-px4-shell which uses the modal pipe architecture instead of raw pipes.

    Previously, you could do

    echo "command" > /tmp/to_px4_shell
    

    and read the response with

    cat /tmp/from_px4_shell
    

    Creating a pipe by echoing a name to /run/mpa/vvpx4_shell then echoing commands to that newly created pipe seems to work fine, but it seems there is no way to access the data without first setting up a callback.

    From libmodal, client.c,

    static void* _helper_func(void* context) {
    ...
        if(is_simple_helper){
            if(c[ch].simple_cb){
                c[ch].simple_cb(ch, c[ch].buf, bytes_read, c[ch].cb_context_simple);
            }
            continue;
        }
    }
    

    Am I missing some way to get this output without having to compile a new client program? Python bindings would also be very convenient for making a simple callback function, but I understand it would be less trivial for non-text data, especially if custom classes are supported.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      We have a command line utility "voxl-px4-shell" which will should have the interactions that you want. If you call it without any args it will open up an interactive shell that lets you put commands through stdin, but you can also run it with an argument which puts that command to px4 and send the output to stdout such as:
      fdd0fcf0-3782-4a51-9dff-9ce5c94b6154-image.png

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        The original thing I was trying to accomplish was getting logs from the PX4 to the voxl just using cat but this doesn't work because I can't redirect the output in interactive mode and in single command mode multiple characters match the terminating character so the stream is truncated.

        But really I'm more looking for a general method of interacting with the modal pipe architecture without needing to compile something. The ability to create a pipe without specifying a callback would Make quick scripting or even more complicated python scripts possible. Is there currently any plans to expand the extensibility around the mpa?

        1 Reply Last reply
        0
        • James StrawsonJ Offline
          James StrawsonJ Offline
          James Strawson
          ModalAI Team
          wrote on last edited by
          #4

          Hi Zach,

          I just updated libmodal_pipe to 2.0.8 with a fix to cleanup the trailing characters from echoing a pipe name to the request pipe. Now you can run modal-hello-server in one window and see the output in another:

          yocto:/run/mpa/hello$ echo  "test" > request  && cat test
          hello160hello161hello162hello163hello164hello165hello166
          

          Let me know if this is along the right path. I have no immediate intention for making a python library.

          Best,
          James

          1 Reply Last reply
          0

          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

          • Don't have an account? Register

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