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

    PX4 -> QGC connection through USB for VOXL2

    Ask your questions right here!
    5
    8
    511
    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.
    • R
      rohitpillai
      last edited by

      Is there a way to connect VOXL2 PX4 to QGC via USB? On the VOXL Flight this was done through the J1006 connector.

      In addition to this, is there a J1003 (Connector on the VOXL Flight) equivalent on the VOXL2. This would allow me to connect a Crossfire Nano RX to it.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • modaltbM
        modaltb ModalAI Team
        last edited by

        Not at this time.... but it's something I'm wanting to try out!!

        I'm not clear if it's possible, but what I'm thinking of trying is UDP tunneling over ADB.

        ADB supports TCP port forwarding, but our traffic from vehicle to QGC is UDP.... so I believe we can try a tunnel?

        Here's the two links I was looking at trying:

        https://developer.android.com/studio/command-line/adb#forwardports
        http://www1.cs.columbia.edu/~lennox/udptunnel/

        Throwing it out here in case someone already knows if this is possible or not! If it is, I think it's an easy way to get the connection going....

        S 1 Reply Last reply Reply Quote 0
        • tomT
          tom admin
          last edited by

          @rohitpillai Not exactly what you're looking for but you could also use one of the supported ethernet dongles attached via. USB to JST to a VOXL2 add-on board and route PX4 traffic through there to your ground station. As seen here: https://docs.modalai.com/voxl2-hardware-setup/#ethernet-connectivity

          1 Reply Last reply Reply Quote 0
          • R
            rohitpillai
            last edited by

            Thank you for your replies! I will check these links out.

            1 Reply Last reply Reply Quote 0
            • S
              Sarika Sharma @modaltb
              last edited by

              @modaltb Hii, is there any update on this?

              tomT 1 Reply Last reply Reply Quote 0
              • tomT
                tom admin @Sarika Sharma
                last edited by

                @Sarika-Sharma It's not something we currently support

                Alex KushleyevA 1 Reply Last reply Reply Quote 0
                • Alex KushleyevA
                  Alex Kushleyev ModalAI Team @tom
                  last edited by Alex Kushleyev

                  @Sarika-Sharma ,

                  We discussed this internally and we will make an effort to formalize enabling the instructions (in a script) in the near future, but there is a relatively short way of enabling TCP/IP communication between VOXL2 and a QGC host. Please try these instructions and let us know if that works for you or what issue you run in to.

                  Basically, there is a command to enable the usb gadget in the kernel and this creates the network interface which you then have to configure on both sides. You can change the IP range if necessary.

                  Alex

                  # VOXL2 Setup
                  # Begin by configuring the usb gadget
                  sed -i '/ln -s functions\/ffs.adb configs\/c.1\/f2/a \ ln -s functions\/ncm.0 configs\/c.1\/f3 2>\/dev\/null | true' /sbin/usb/compositions/901D
                  
                  # Next setup a udev rule to give our NCM device a static IP (192.168.7.2)
                  echo 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="usb0", RUN+="/bin/sh -c '"'"'sleep 2; /sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.0 up'"'"'"' > /etc/udev/rules.d/80-usb-ncm.rules
                  
                  # Reboot VOXL2
                  
                  # Check usb0 network device
                  voxl2:/$ ifconfig usb0
                  usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
                          inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255
                          inet6 fe80::935f:1a09:ab1d:d2fb  prefixlen 64  scopeid 0x20<link>
                          ether 56:77:2d:6c:84:9b  txqueuelen 1000  (Ethernet)
                          RX packets 0  bytes 0 (0.0 B)
                          RX errors 0  dropped 0  overruns 0  frame 0
                          TX packets 0  bytes 0 (0.0 B)
                          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
                  
                  
                  # Host Side Configuration
                  - note that a network manager may rename the device from usb0 to something else..
                  
                  ifconfig usb0
                  usb0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
                          ether fa:74:5a:f3:2b:88  txqueuelen 1000  (Ethernet)
                          RX packets 0  bytes 0 (0.0 B)
                          RX errors 0  dropped 0  overruns 0  frame 0
                          TX packets 0  bytes 0 (0.0 B)
                          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
                  
                  #bring up the interface and set it to static ip
                  sudo ip addr add 192.168.7.1/24 dev usb0 
                  sudo ip link set usb0 up
                  
                  # Can also use Network manager to configure the network interface for a static configuration
                  - address 192.168.7.1
                  - netmask 255.255.255.0
                  - gateway 192.168.7.1
                  
                  # ping VOXL2 from linux host
                  - ping 192.168.7.2
                  
                  #set up QGC
                  - use ip address:port : 192.168.7.2:14550
                  
                  You can also use other network tools like ssh, etc, to communicate to the host, but this setup does not enable you to communicate from VOXL2 to outside world (using NAT to enable internet access via the host)
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Sarika Sharma @Alex Kushleyev
                    last edited by

                    Thankyou so much @Alex-Kushleyev
                    This setup solves my use case where Wi-Fi is not available. Thanks for the support — looking forward to the scripted version in the future.

                    Best regards,
                    Sarika

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