ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    VOXL2 unused/repurposed GPIO

    Ask your questions right here!
    5
    12
    751
    Loading More Posts
    • 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
      hmlow @Vinny
      last edited by

      @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 Reply Quote 0
      • VinnyV
        Vinny ModalAI Team @hmlow
        last edited by

        @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 Reply Quote 0
        • Filip SlezakF
          Filip Slezak
          last edited by

          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 Reply Quote 0
          • tomT
            tom admin
            last edited by

            @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 Reply Quote 0
            • Filip SlezakF
              Filip Slezak
              last edited by

              @tom said in VOXL2 unused/repurposed GPIO:

              https://docs.modalai.com/voxl2-linux-user-guide/#gpios

              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 Reply Quote 0
              • Filip SlezakF
                Filip Slezak
                last edited by

                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 Reply Quote 0
                • Jyotish KumarJ
                  Jyotish Kumar @Vinny
                  last edited by

                  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 Reply Quote 0
                  • VinnyV
                    Vinny ModalAI Team @Jyotish Kumar
                    last edited by

                    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 Reply Quote 1
                    • VinnyV
                      Vinny ModalAI Team @Jyotish Kumar
                      last edited by

                      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 Reply Quote 1
                      • Jyotish KumarJ
                        Jyotish Kumar @Vinny
                        last edited by

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

                        Warm regards,
                        Jyothish.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB | Contributors