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. VOXL2 unused/repurposed GPIO

VOXL2 unused/repurposed GPIO

Scheduled Pinned Locked Moved Ask your questions right here!
12 Posts 5 Posters 2.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.
  • H Offline
    H Offline
    hmlow
    Regular
    wrote on last edited by
    #1

    Hi devs

    What could i do if i wish to use a GPIO to turn an external MOSFET switch on/off?

    I've looked thru the docs but i cant seem to find any unused GPIOs on the VOXL2 (including the 5G modem addon).

    The closest i got is pin9 of J19:
    https://docs.modalai.com/voxl2-offboard-sensors/

    Where the note for pin 9 says "*RC power , controllable via GPIO 159"
    I am not using J19 at the moment so how should i go about "controlling" GPIO159?

    Thanks

    VinnyV 1 Reply Last reply
    0
    • H hmlow

      Hi devs

      What could i do if i wish to use a GPIO to turn an external MOSFET switch on/off?

      I've looked thru the docs but i cant seem to find any unused GPIOs on the VOXL2 (including the 5G modem addon).

      The closest i got is pin9 of J19:
      https://docs.modalai.com/voxl2-offboard-sensors/

      Where the note for pin 9 says "*RC power , controllable via GPIO 159"
      I am not using J19 at the moment so how should i go about "controlling" GPIO159?

      Thanks

      VinnyV Offline
      VinnyV Offline
      Vinny
      ModalAI Team
      wrote on last edited by
      #2

      Hi @hmlow
      I would advise against trying to use VREG_3P3V_RC as a FET control signal. It is a power rail, and it will have a slow rise time relative to a GPIO.
      Your best bet is to look into the linux user guide sections to learn how to change SPI or I2C ports into GPIOs.
      https://docs.modalai.com/voxl2-linux-user-guide/
      If that page is not clear, please ask again and we'll need someone from SW to respond.

      On Voxl2, J10 is an SPI port.
      On M0090 5G modem, both J8 and J9 are SPI and UART+I2C respectively. These are the ideal candidates to turn into GPIOs.
      Note, the I2C ports have pull-ups, so if you need fast rise times, try to use the SPI or UART designated ports.

      Second Note: I am also in process of a new design which will expose all GPIOs on J3 + J5 for testing/development uses. It may still be a couple months before we list that for sale, but if it works for you longer term, try to hold off. I will "open" those schematics too to help all users see how to manipulate that design for their use.

      H Jyotish KumarJ 2 Replies Last reply
      0
      • VinnyV Vinny

        Hi @hmlow
        I would advise against trying to use VREG_3P3V_RC as a FET control signal. It is a power rail, and it will have a slow rise time relative to a GPIO.
        Your best bet is to look into the linux user guide sections to learn how to change SPI or I2C ports into GPIOs.
        https://docs.modalai.com/voxl2-linux-user-guide/
        If that page is not clear, please ask again and we'll need someone from SW to respond.

        On Voxl2, J10 is an SPI port.
        On M0090 5G modem, both J8 and J9 are SPI and UART+I2C respectively. These are the ideal candidates to turn into GPIOs.
        Note, the I2C ports have pull-ups, so if you need fast rise times, try to use the SPI or UART designated ports.

        Second Note: I am also in process of a new design which will expose all GPIOs on J3 + J5 for testing/development uses. It may still be a couple months before we list that for sale, but if it works for you longer term, try to hold off. I will "open" those schematics too to help all users see how to manipulate that design for their use.

        H Offline
        H Offline
        hmlow
        Regular
        wrote on last edited by
        #3

        @Vinny actually, I am trying to use Pin 9 to drive a MOSFET switch as a simple on/off.. I won't need it to "switch" quickly.

        Now that you mention that pin 9 is actually a power rail, I would like to explore if it is possible to use this pin directly to drive my load of around 200mA.

        Would that bust the 1A (is this refering to the entire 3V3 load on the board?) limit specified in the docs?

        VinnyV 1 Reply Last reply
        0
        • H hmlow

          @Vinny actually, I am trying to use Pin 9 to drive a MOSFET switch as a simple on/off.. I won't need it to "switch" quickly.

          Now that you mention that pin 9 is actually a power rail, I would like to explore if it is possible to use this pin directly to drive my load of around 200mA.

          Would that bust the 1A (is this refering to the entire 3V3 load on the board?) limit specified in the docs?

          VinnyV Offline
          VinnyV Offline
          Vinny
          ModalAI Team
          wrote on last edited by
          #4

          @hmlow yes 200mA is fine. That amount won't barely stress anything. Keep in mind, that power rail is for RC, so if there are any bind or reset functions executed related to RC, that rail might toggle so be sure you investigate all options before you commit to using that long term.

          If you wanted to explore other GPIO controls as your original plan, our software engineer pointed me to this page about rebuilding the kernel for any permanent changes you need....
          https://docs.modalai.com/voxl2-kernel-build-guide/
          Hope that helps.

          1 Reply Last reply
          0
          • Filip SlezakF Offline
            Filip SlezakF Offline
            Filip Slezak
            Contributor
            wrote on last edited by
            #5

            Hey, trying to do something very similar myself.

            Can't seem to toggle pin 46 on the VOXL2 J10. Following docs.modalai.com/voxl-gpio-io I run into the following:

            voxl2:~$ echo 46 > /sys/class/gpio/export
            -bash: echo write error: Invalid argument
            

            Eventually, I'd like this to match the state of a radio remote control switch to kill another board's power supply. Maybe through ROS
            but preferably not. Can you guide me through it please?

            1 Reply Last reply
            0
            • tomT Offline
              tomT Offline
              tom
              admin
              wrote on last edited by
              #6

              @Filip-Slezak That doc is for VOXL1, see here for info on VOXL2: https://docs.modalai.com/voxl2-linux-user-guide/#gpios

              1 Reply Last reply
              0
              • Filip SlezakF Offline
                Filip SlezakF Offline
                Filip Slezak
                Contributor
                wrote on last edited by
                #7

                @tom said in VOXL2 unused/repurposed GPIO:

                Link Preview Image
                VOXL 2 Linux User Guide

                ModalAI technical documentation for VOXL and VOXL 2 Companion Computers for PX4 and ArduPilot Obstacle Avoidance and GPS-denied navigation, assembled in the USA

                favicon

                ModalAI Technical Docs (docs.modalai.com)

                Indeed, thanks for the fast reply. I also just ran into the bind.c here https://forum.modalai.com/topic/1466/voxl2-gpio-and-serial-interfaces/3 and turns out I didn't account for the chip offset. How do I figure out which one to use? In this case it was 1100. This should now be a permanent setting right?

                To modify those from code I could copy the _gpio_control function above and use it in a ros package, right? I am looking for a clean way to do this. Please tell me if there's a better way to directly toggle based on radio signal.

                Also, I can't find any python code examples, are there any?

                1 Reply Last reply
                0
                • Filip SlezakF Offline
                  Filip SlezakF Offline
                  Filip Slezak
                  Contributor
                  wrote on last edited by
                  #8
                  def gpio_init(pin):
                      with open("/sys/class/gpio/export", "w") as config:
                          config.write(str(pin).encode())
                      return
                  
                  def gpio_exit(pin):
                      with open("/sys/class/gpio/unexport", "w") as config:
                          config.write(str(pin).encode())
                      return
                  
                  def gpio_set_mode(pin, direction):
                      with open("/sys/class/gpio/gpio{}/direction".format(pin), "w") as mode:
                          mode.write(str(direction).encode())
                      return
                  
                  def gpio_set_value(pin, value):     
                      with open("/sys/class/gpio/gpio{}/value".format(pin), "w") as gpio:
                          gpio.write(str(value).encode())
                      return
                       
                  
                  1 Reply Last reply
                  0
                  • VinnyV Vinny

                    Hi @hmlow
                    I would advise against trying to use VREG_3P3V_RC as a FET control signal. It is a power rail, and it will have a slow rise time relative to a GPIO.
                    Your best bet is to look into the linux user guide sections to learn how to change SPI or I2C ports into GPIOs.
                    https://docs.modalai.com/voxl2-linux-user-guide/
                    If that page is not clear, please ask again and we'll need someone from SW to respond.

                    On Voxl2, J10 is an SPI port.
                    On M0090 5G modem, both J8 and J9 are SPI and UART+I2C respectively. These are the ideal candidates to turn into GPIOs.
                    Note, the I2C ports have pull-ups, so if you need fast rise times, try to use the SPI or UART designated ports.

                    Second Note: I am also in process of a new design which will expose all GPIOs on J3 + J5 for testing/development uses. It may still be a couple months before we list that for sale, but if it works for you longer term, try to hold off. I will "open" those schematics too to help all users see how to manipulate that design for their use.

                    Jyotish KumarJ Offline
                    Jyotish KumarJ Offline
                    Jyotish Kumar
                    Contributor
                    wrote on last edited by
                    #9

                    Hi @Vinny
                    An expansion board to access the GPIO pins in J3 and J5 connectors would be extreamly helpful.
                    Are there any updates on the designing front? Really looking forwards to this option.

                    Yours sincerely,
                    Jyothish.

                    VinnyV 2 Replies Last reply
                    0
                    • Jyotish KumarJ Jyotish Kumar

                      Hi @Vinny
                      An expansion board to access the GPIO pins in J3 and J5 connectors would be extreamly helpful.
                      Are there any updates on the designing front? Really looking forwards to this option.

                      Yours sincerely,
                      Jyothish.

                      VinnyV Offline
                      VinnyV Offline
                      Vinny
                      ModalAI Team
                      wrote on last edited by
                      #10

                      Hi @Jyotish-Kumar
                      Yes! We just sent the board for fabrication yesterday!
                      I'm hoping to get a page up soon to explain it and post the schematics and usage.
                      Please give us a month or so enabling us to validate it before making it available.
                      Thanks

                      1 Reply Last reply
                      1
                      • Jyotish KumarJ Jyotish Kumar

                        Hi @Vinny
                        An expansion board to access the GPIO pins in J3 and J5 connectors would be extreamly helpful.
                        Are there any updates on the designing front? Really looking forwards to this option.

                        Yours sincerely,
                        Jyothish.

                        VinnyV Offline
                        VinnyV Offline
                        Vinny
                        ModalAI Team
                        wrote on last edited by
                        #11

                        Hi @Jyotish-Kumar
                        Our design is being assembled and we expect to have it in our hands next week for initial bring-up. Keep an eye out for website purchase links.
                        Hope this helps you out!!!
                        https://docs.modalai.com/voxl2-dev-test-board/

                        Jyotish KumarJ 1 Reply Last reply
                        1
                        • VinnyV Vinny

                          Hi @Jyotish-Kumar
                          Our design is being assembled and we expect to have it in our hands next week for initial bring-up. Keep an eye out for website purchase links.
                          Hope this helps you out!!!
                          https://docs.modalai.com/voxl2-dev-test-board/

                          Jyotish KumarJ Offline
                          Jyotish KumarJ Offline
                          Jyotish Kumar
                          Contributor
                          wrote on last edited by
                          #12

                          @Vinny Great!
                          So happy to hear about that. Looking forwards to its availability on store soon.

                          Warm regards,
                          Jyothish.

                          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

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