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. Looking for Help Understanding the GPIO mapping on the QRB5165

Looking for Help Understanding the GPIO mapping on the QRB5165

Scheduled Pinned Locked Moved Ask your questions right here!
11 Posts 4 Posters 1.6k Views 3 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.
  • Jeremy FrederickJ Jeremy Frederick

    I'm using the FPV ESC and noticed the feature for switching VTX power on/off. I see in the documentation that the pin is labeled as CH0 PF0, and am struggling to figure out which pin in sys/class/gpio this refers too. Some clarity on this would be very helpful.

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

    @Jeremy-Frederick ,

    If you are interested in information about GPIO / PWM functionality on ESC specifically, this information should help : https://docs.modalai.com/voxl-fpv-esc-datasheet/ . The control of GPIO / PWM works by sending a special message to the ESC using UART and we have some support for this in PX4 as well as our tests scripts.

    If you wanted to control GPIO that is physically connected to the VOXL2 chip, then you should look at the following documentation: https://docs.modalai.com/voxl2-linux-user-guide/#gpios and we also have a tool voxl-gpio which is part of the SDK, also source here : https://gitlab.com/voxl-public/voxl-sdk/core-libs/libqrb5165-io/-/blob/master/apps/examples/voxl-gpio.c

    If you need more help, please let me know which direction you want to go.

    Alex

    Jeremy FrederickJ 1 Reply Last reply
    0
    • Alex KushleyevA Alex Kushleyev

      @Jeremy-Frederick ,

      If you are interested in information about GPIO / PWM functionality on ESC specifically, this information should help : https://docs.modalai.com/voxl-fpv-esc-datasheet/ . The control of GPIO / PWM works by sending a special message to the ESC using UART and we have some support for this in PX4 as well as our tests scripts.

      If you wanted to control GPIO that is physically connected to the VOXL2 chip, then you should look at the following documentation: https://docs.modalai.com/voxl2-linux-user-guide/#gpios and we also have a tool voxl-gpio which is part of the SDK, also source here : https://gitlab.com/voxl-public/voxl-sdk/core-libs/libqrb5165-io/-/blob/master/apps/examples/voxl-gpio.c

      If you need more help, please let me know which direction you want to go.

      Alex

      Jeremy FrederickJ Offline
      Jeremy FrederickJ Offline
      Jeremy Frederick
      Regular
      wrote on last edited by
      #3

      @Alex-Kushleyev I'm specifically interested in toggling the VTX on/off GPIO on the ESC as described in the attached image.

      93b9fa39-3fec-4ad0-ba59-048c6ad58682-image.png

      Alex KushleyevA 1 Reply Last reply
      0
      • Jeremy FrederickJ Jeremy Frederick

        @Alex-Kushleyev I'm specifically interested in toggling the VTX on/off GPIO on the ESC as described in the attached image.

        93b9fa39-3fec-4ad0-ba59-048c6ad58682-image.png

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

        @Jeremy-Frederick , got it. one more question, are you looking for a way to toggle it while PX4 is running or not running?

        The reason why i ask is that the command message for this action has to go through the serial port connecting to the ESC and if PX4 is running, then it opens the port and the command has to go through px4.

        Here is how you can test:

        • first make sure that the function works without px4:
          • run this script https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/master/voxl-esc-tools/voxl-esc-gpio.py with --val 0 or --val 1 options and check to see if the aux power is turning on / off. currently this script is only set up to toggle this pin on M0138 FPV ESC, but in future we will expand support to other GPIO on ESCs if needed
          • for example, python3 voxl-esc-gpio.py --val 0
          • you should have this script on voxl already in /usr/share/modalai/voxl-esc-tools or you can clone the repo to voxl2.

        I will need to double check with the team how this can be triggered via PX4.

        Alex

        Jeremy FrederickJ 1 Reply Last reply
        0
        • Alex KushleyevA Alex Kushleyev

          @Jeremy-Frederick , got it. one more question, are you looking for a way to toggle it while PX4 is running or not running?

          The reason why i ask is that the command message for this action has to go through the serial port connecting to the ESC and if PX4 is running, then it opens the port and the command has to go through px4.

          Here is how you can test:

          • first make sure that the function works without px4:
            • run this script https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/master/voxl-esc-tools/voxl-esc-gpio.py with --val 0 or --val 1 options and check to see if the aux power is turning on / off. currently this script is only set up to toggle this pin on M0138 FPV ESC, but in future we will expand support to other GPIO on ESCs if needed
            • for example, python3 voxl-esc-gpio.py --val 0
            • you should have this script on voxl already in /usr/share/modalai/voxl-esc-tools or you can clone the repo to voxl2.

          I will need to double check with the team how this can be triggered via PX4.

          Alex

          Jeremy FrederickJ Offline
          Jeremy FrederickJ Offline
          Jeremy Frederick
          Regular
          wrote on last edited by
          #5

          @Alex-Kushleyev Yeah, even if we can't trigger it through PX4, having to stop voxl-px4 will not work

          tomT 1 Reply Last reply
          0
          • Jeremy FrederickJ Jeremy Frederick

            @Alex-Kushleyev Yeah, even if we can't trigger it through PX4, having to stop voxl-px4 will not work

            tomT Offline
            tomT Offline
            tom
            admin
            wrote on last edited by
            #6

            @Jeremy-Frederick To enable the feature, set the px4 paramster GPIO_CTL_CH to a value between 1-6 and set the corresponding RC_MAP_AUX# to the button/switch you want to use.

            Jeremy FrederickJ 1 Reply Last reply
            0
            • tomT tom

              @Jeremy-Frederick To enable the feature, set the px4 paramster GPIO_CTL_CH to a value between 1-6 and set the corresponding RC_MAP_AUX# to the button/switch you want to use.

              Jeremy FrederickJ Offline
              Jeremy FrederickJ Offline
              Jeremy Frederick
              Regular
              wrote on last edited by
              #7

              @tom Seems like neither the voxl-esc-gpio.py test script or the PX4 triggering via RC_AUX seems to be having an effect on the PF0 GPIO on the ESC. Currently, I am using SDK 1.3.5. I did notice that the voxl-esc-gpio.py has the packet = wrap_data(ESC_PACKET_TYPE_GPIO_CMD,req_data) line commented out, is there anything else that I should check? Perhaps a different ESC firmware?

              tomT Alex KushleyevA 2 Replies Last reply
              0
              • Jeremy FrederickJ Jeremy Frederick

                @tom Seems like neither the voxl-esc-gpio.py test script or the PX4 triggering via RC_AUX seems to be having an effect on the PF0 GPIO on the ESC. Currently, I am using SDK 1.3.5. I did notice that the voxl-esc-gpio.py has the packet = wrap_data(ESC_PACKET_TYPE_GPIO_CMD,req_data) line commented out, is there anything else that I should check? Perhaps a different ESC firmware?

                tomT Offline
                tomT Offline
                tom
                admin
                wrote on last edited by
                #8

                @Jeremy-Frederick The feature should be supported on that release and ESC firmware as long as you have run voxl-configure-mpa in order to load the ESC firmware contained in the release.

                To confirm, you have something similar setup:

                GPIO_CTL_CH = 2
                RC_MAP_AUX2 = 10
                

                where 10 is the channel of the button or switch on your transmitter that you'd like to use to toggle?

                There was another bug that was fixed later where if VOXL_ESC_MODE is set to 1 (turtle mode) this would not work, can you check that as well

                Jeremy FrederickJ 1 Reply Last reply
                0
                • Jeremy FrederickJ Jeremy Frederick

                  @tom Seems like neither the voxl-esc-gpio.py test script or the PX4 triggering via RC_AUX seems to be having an effect on the PF0 GPIO on the ESC. Currently, I am using SDK 1.3.5. I did notice that the voxl-esc-gpio.py has the packet = wrap_data(ESC_PACKET_TYPE_GPIO_CMD,req_data) line commented out, is there anything else that I should check? Perhaps a different ESC firmware?

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

                  @Jeremy-Frederick , the python test script works, you may have an older version of it, we had commented out something by accident (the line you mentioned), but it is fixed now : https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/master/voxl-esc-tools/voxl-esc-gpio.py

                  Double check that you have ESC firmware 39.18 and should be good to test with python script while px4 is not running (as a first step). then you can set up your channel mapping as Tom suggested..

                  Hopefully that works for you!

                  Alex

                  1 Reply Last reply
                  0
                  • tomT tom

                    @Jeremy-Frederick The feature should be supported on that release and ESC firmware as long as you have run voxl-configure-mpa in order to load the ESC firmware contained in the release.

                    To confirm, you have something similar setup:

                    GPIO_CTL_CH = 2
                    RC_MAP_AUX2 = 10
                    

                    where 10 is the channel of the button or switch on your transmitter that you'd like to use to toggle?

                    There was another bug that was fixed later where if VOXL_ESC_MODE is set to 1 (turtle mode) this would not work, can you check that as well

                    Jeremy FrederickJ Offline
                    Jeremy FrederickJ Offline
                    Jeremy Frederick
                    Regular
                    wrote on last edited by
                    #10

                    @tom Looks like I just needed to update the ESC firmware to the latest variant, that got the python script to work, still working on PX4 though, I'm using Joystick controls through QGC rather than an RC radio so I cannot Map an RC channel, using the actuator testing panel instead and set GPIO_CTL_CH = 3 and RC AUX 3 to one of the outputs, doesn't seem to be triggering the LED yet but I'm not sure if RC AUX 3 sends the same message as with a RC Controller, going to try going through the VOXL IO functionality instead of the ESC output next. In the end, we'll just be integrating it into our custom QGC fork, however want to test it before going through the effort.

                    Eric KatzfeyE 1 Reply Last reply
                    0
                    • Jeremy FrederickJ Jeremy Frederick

                      @tom Looks like I just needed to update the ESC firmware to the latest variant, that got the python script to work, still working on PX4 though, I'm using Joystick controls through QGC rather than an RC radio so I cannot Map an RC channel, using the actuator testing panel instead and set GPIO_CTL_CH = 3 and RC AUX 3 to one of the outputs, doesn't seem to be triggering the LED yet but I'm not sure if RC AUX 3 sends the same message as with a RC Controller, going to try going through the VOXL IO functionality instead of the ESC output next. In the end, we'll just be integrating it into our custom QGC fork, however want to test it before going through the effort.

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

                      @Jeremy-Frederick Those aux channels are implemented differently when getting manual control messages from QGC. The only one that is mapped is aux1 that comes from the "buttons" field of the corresponding MANUAL CONTROL Mavlink message.

                      1 Reply Last reply
                      0
                      • P PatkirkMartin referenced this topic

                      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