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

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Dev Drones
  3. Starling & Starling 2
  4. "Serial Port Closed!" and other HITL Errors

"Serial Port Closed!" and other HITL Errors

Scheduled Pinned Locked Moved Starling & Starling 2
17 Posts 3 Posters 3.4k 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.
  • L labkit

    I have been attempting to follow this HITL guide in order to perform simulations on my Starling 2 drone. The tutorial requires a USB to JST cable, which I received yesterday. It also uses Modal AI's voxl-gazebo-docker Docker image, which I installed a few weeks ago. Some specifics about the hardware and software I'm using are as follows.

    Drone:
    SKU: MRB-D0005-4-V3-C6-T8
    voxl-suite 1.2.0
    system-image: 1.7.6-M0054-14.1a-perf

    Cable:
    MCBL-00091-1

    On PC:
    Ubuntu: 22.04
    Docker Engine - Community: 26.1.3
    voxl-gazebo-docker: 1.2

    And here is the output of voxl-inspect-services as requested by the forum guidelines.
    8007a7a2-d6de-4ff0-ac0b-16164f4dbc6e-image.png

    I have plugged the JST end of the HITL connection cable to this point on the VOXL2 circuit board, which I believe to be J18. It is the only JST connector on the VOXL2 board. To insert the HITL connection cable, I had to remove another cable that previously connected J18 on VOXL2 to the 4-in-1 ESC.
    f4faf38a-4615-4f34-bcf5-8c658129b53d-image.png

    When I try to follow the instructions in the HITL guide to run Gazebo in headless mode, I experience the following messages, which continue to repeat "Serial Port Closed!" until I use Ctrl-C. This occurs after I enter "docker run --rm -it --net=host --privileged -v /dev/input:/dev/input:rw voxl-gazebo-docker ./run_headless.bash"
    3c5490e9-5525-426d-b311-59c91970404b-image.png

    I receive a different error when trying to run without headless mode.
    eabe93c3-ad17-45bd-ba9d-d83bec5e6772-image.png

    The error when running without headless mode has been present since I first starting trying to use HITL, but the error when running headless mode only occurred persistently after I restarted the computer and also allowed the system to update software. Instead, I used to be able to get to the part of the simulation where I ran "voxl-px4-hitl." I received quite a bit of terminal output after running that command including these errors.
    2d64ba02-5b90-4cd4-9ca0-fca9e1338925-image.png

    The qshell commands did not work properly after HITL had been set up in this way, malfunctioning in various ways. For example, qshell commander arm returned INFO [muorb] SLPI: Takeoff detected and then ceased to respond.

    To troubleshoot the serial port error, I have checked the /dev/input directory.
    d1f4ddeb-b931-42c0-a1d2-79e9960bf3e6-image.png
    The contents of this directory do not change when the drone is plugged into the computer or unplugged.
    In the /dev directory however, ttyUSB0 does appear when the drone is plugged in.

    I tried to use the ttyUSB0 instead of input with the command "docker run --rm -it --net=host --privileged -v /dev/input:/dev/input:rw -v /dev/ttyUSB0:/dev/ttyUSB0 voxl-gazebo-docker ./run_headless.bash"

    I got a slightly different error this time.
    cd35e68a-2e50-4bc8-b15b-20fbf5e23d40-image.png

    I also ran a simple script to test whether it was able to access the serial port.
    dbd84aae-2e29-4af8-ba4a-6b2f77ff5bc1-image.png
    It was able to successfully access the port. So the issue does not appear to be that the serial port is inaccessible to all apps.

    Thanks in advance if you're able to provide any insight on how to get the HITL simulation up and running.

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

    @labkit For GUI mode you can do something similar. Start with xhost + and then launch the docker with docker run --rm -it --net=host --privileged -e DISPLAY=$DISPLAY -v /dev/input:/dev/input:rw -v /tmp/.X11-unix:/tmp/.X11-unix:ro voxl-gazebo-docker. Check for /dev/ttyUSB0. Then run gazebo with ./run_gazebo.bash. Then, on VOXL 2, check qshell dsp_hitl status. You are starting px4 with the voxl-px4-hitl command, correct?

    L 1 Reply Last reply
    0
    • Eric KatzfeyE Eric Katzfey

      @labkit For GUI mode you can do something similar. Start with xhost + and then launch the docker with docker run --rm -it --net=host --privileged -e DISPLAY=$DISPLAY -v /dev/input:/dev/input:rw -v /tmp/.X11-unix:/tmp/.X11-unix:ro voxl-gazebo-docker. Check for /dev/ttyUSB0. Then run gazebo with ./run_gazebo.bash. Then, on VOXL 2, check qshell dsp_hitl status. You are starting px4 with the voxl-px4-hitl command, correct?

      L Offline
      L Offline
      labkit
      Contributor
      wrote on last edited by
      #4

      @Eric-Katzfey Yes, I start px4 with voxl-px4-hitl. Here's the results of the qshell dsp_hitl status command called on the PX4 command prompt after SSHing to the Starling. I assume all the values are set to 0 because the "Serial port closed!" error is preventing Gazebo from sending it data.
      648ca809-0c96-4685-aea4-9608e9482c86-image.png
      On the laptop, I used Docker's virtual file sharing to share /tmp/.X11-unix with docker, so the original GUI mode error seems to be resolved. (The one in which it couldn't acess that directory.)
      4184bf49-8064-47c0-b913-3b83b18771c5-image.png
      By using your instructions, I can get to the docker command prompt in both GUI and headless modes. However, /dev/ttyUSB0 is not present here, although it can still be found from the Linux command line. Running Gazebo from the Docker command line still results in the serial port closed error.

      Here's the attempt to run in GUI mode. Headless mode has the same issue.
      f62ae7fa-7f3e-46fb-9128-1e42f037f8e5-image.png

      Eric KatzfeyE 2 Replies Last reply
      0
      • L labkit

        @Eric-Katzfey Yes, I start px4 with voxl-px4-hitl. Here's the results of the qshell dsp_hitl status command called on the PX4 command prompt after SSHing to the Starling. I assume all the values are set to 0 because the "Serial port closed!" error is preventing Gazebo from sending it data.
        648ca809-0c96-4685-aea4-9608e9482c86-image.png
        On the laptop, I used Docker's virtual file sharing to share /tmp/.X11-unix with docker, so the original GUI mode error seems to be resolved. (The one in which it couldn't acess that directory.)
        4184bf49-8064-47c0-b913-3b83b18771c5-image.png
        By using your instructions, I can get to the docker command prompt in both GUI and headless modes. However, /dev/ttyUSB0 is not present here, although it can still be found from the Linux command line. Running Gazebo from the Docker command line still results in the serial port closed error.

        Here's the attempt to run in GUI mode. Headless mode has the same issue.
        f62ae7fa-7f3e-46fb-9128-1e42f037f8e5-image.png

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

        @labkit Okay, interesting. Here's what I get on my machine:

        modalai@modalai-XPS-15-9570:~$ ls /dev/ttyUSB0 
        /dev/ttyUSB0
        modalai@modalai-XPS-15-9570:~$ docker run --rm -it --net=host --privileged -v /dev/input:/dev/input:rw voxl-gazebo-docker
        root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# ls /dev/ttyUSB0 
        /dev/ttyUSB0
        
        1 Reply Last reply
        0
        • L labkit

          @Eric-Katzfey Yes, I start px4 with voxl-px4-hitl. Here's the results of the qshell dsp_hitl status command called on the PX4 command prompt after SSHing to the Starling. I assume all the values are set to 0 because the "Serial port closed!" error is preventing Gazebo from sending it data.
          648ca809-0c96-4685-aea4-9608e9482c86-image.png
          On the laptop, I used Docker's virtual file sharing to share /tmp/.X11-unix with docker, so the original GUI mode error seems to be resolved. (The one in which it couldn't acess that directory.)
          4184bf49-8064-47c0-b913-3b83b18771c5-image.png
          By using your instructions, I can get to the docker command prompt in both GUI and headless modes. However, /dev/ttyUSB0 is not present here, although it can still be found from the Linux command line. Running Gazebo from the Docker command line still results in the serial port closed error.

          Here's the attempt to run in GUI mode. Headless mode has the same issue.
          f62ae7fa-7f3e-46fb-9128-1e42f037f8e5-image.png

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

          @labkit Maybe a groups / permission issue? Here's some more information from my setup:

          root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# ls -l /dev/ttyUSB0
          crw-rw---- 1 root dialout 188, 0 May 31 16:01 /dev/ttyUSB0
          root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# groups
          root
          root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# exit
          exit
          modalai@modalai-XPS-15-9570:~$ ls -l /dev/ttyUSB0
          crw-rw---- 1 root dialout 188, 0 May 31 09:00 /dev/ttyUSB0
          modalai@modalai-XPS-15-9570:~$ groups
          modalai adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare docker
          modalai@modalai-XPS-15-9570:~$ 
          

          Perhaps you need to be in dialout group?

          L 1 Reply Last reply
          0
          • Eric KatzfeyE Eric Katzfey

            @labkit Maybe a groups / permission issue? Here's some more information from my setup:

            root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# ls -l /dev/ttyUSB0
            crw-rw---- 1 root dialout 188, 0 May 31 16:01 /dev/ttyUSB0
            root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# groups
            root
            root@modalai-XPS-15-9570:/usr/workspace/voxl2_hitl_gazebo# exit
            exit
            modalai@modalai-XPS-15-9570:~$ ls -l /dev/ttyUSB0
            crw-rw---- 1 root dialout 188, 0 May 31 09:00 /dev/ttyUSB0
            modalai@modalai-XPS-15-9570:~$ groups
            modalai adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare docker
            modalai@modalai-XPS-15-9570:~$ 
            

            Perhaps you need to be in dialout group?

            L Offline
            L Offline
            labkit
            Contributor
            wrote on last edited by
            #7

            @Eric-Katzfey Here are my results with the same commands.
            3813ac9f-e1a7-4cf5-b0ad-676ba54ddae4-image.png
            I ran docker in the dialout group but it didn't seem to make a difference. I was already in root.
            afc14ddb-b217-4e86-a6b5-65ea8a3edcab-image.png
            As you can see, much of the contents of /dev is missing in docker compared to what's available from the linux command line. It's not only ttyUSB0.

            L 1 Reply Last reply
            0
            • L labkit

              @Eric-Katzfey Here are my results with the same commands.
              3813ac9f-e1a7-4cf5-b0ad-676ba54ddae4-image.png
              I ran docker in the dialout group but it didn't seem to make a difference. I was already in root.
              afc14ddb-b217-4e86-a6b5-65ea8a3edcab-image.png
              As you can see, much of the contents of /dev is missing in docker compared to what's available from the linux command line. It's not only ttyUSB0.

              L Offline
              L Offline
              labkit
              Contributor
              wrote on last edited by
              #8

              I got Docker to avoid the error by doing the steps in the tutorial in a different order with setup on the drone coming first. This must have been why I didn't receive the "serial port closed" error when I first tried to set up the simulation two days ago. However, I don't think the simulation is in shape to run yet, all I've managed is to get back to where I was originally....

              L 2 Replies Last reply
              0
              • L labkit

                I got Docker to avoid the error by doing the steps in the tutorial in a different order with setup on the drone coming first. This must have been why I didn't receive the "serial port closed" error when I first tried to set up the simulation two days ago. However, I don't think the simulation is in shape to run yet, all I've managed is to get back to where I was originally....

                L Offline
                L Offline
                labkit
                Contributor
                wrote on last edited by labkit
                #9

                @Eric-Katzfey I have figured out why I thought that the drone wasn't giving me a "Serial port closed!" error a couple of days ago but has been doing so yesterday and today. When the gazebo docker container has not been created, the first attempt to create it will result in a "Serial port closed!" error. However, when the container is already running, future attempts to create it will not display the error, they will simply show the following message rather than creating a new container. At first I thought that this message meant that the connection to the drone had successfully avoided the "serial port closed" message.
                708d8de9-27a5-40fb-993a-bb68b0248fff-image.png

                The bad news is that this means that there may never have been a successful connection between the laptop and drone at all. A hardware misconfiguration can't be ruled out in this case. As I said, I had to remove a connection to the ESC 4 in 1 in order to connect the cable to the JST port on the VOXL2. If the connection's in the right place, it might be a permissions issue like you mentioned, although docker was run as privileged and I'm already in dialout.

                7d80004c-f34b-41fb-8e3f-3a17e6194dcb-image.png

                VinnyV 1 Reply Last reply
                0
                • L labkit

                  @Eric-Katzfey I have figured out why I thought that the drone wasn't giving me a "Serial port closed!" error a couple of days ago but has been doing so yesterday and today. When the gazebo docker container has not been created, the first attempt to create it will result in a "Serial port closed!" error. However, when the container is already running, future attempts to create it will not display the error, they will simply show the following message rather than creating a new container. At first I thought that this message meant that the connection to the drone had successfully avoided the "serial port closed" message.
                  708d8de9-27a5-40fb-993a-bb68b0248fff-image.png

                  The bad news is that this means that there may never have been a successful connection between the laptop and drone at all. A hardware misconfiguration can't be ruled out in this case. As I said, I had to remove a connection to the ESC 4 in 1 in order to connect the cable to the JST port on the VOXL2. If the connection's in the right place, it might be a permissions issue like you mentioned, although docker was run as privileged and I'm already in dialout.

                  7d80004c-f34b-41fb-8e3f-3a17e6194dcb-image.png

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

                  Hi @labkit
                  MCBL-00091-1 is by default meant for ESC tools...i.e.: it will plug into the ESC side of that cable you removed, not the VOXL 2 side:
                  https://docs.modalai.com/cable-datasheets/#mcbl-00091
                  To use it for HWIL, pins 2&3 need to be swapped as noted: https://docs.modalai.com/cable-userguides/#m0163-4-pin-jst-to-4-pin-jst-cross-over-example
                  You do not need to have the M0163 if you are comfortable re-pinning JSTs:
                  https://docs.modalai.com/cable-userguides/#flightcore-v2-conversion-cables-info

                  5f5ba346-20e1-4428-8a0d-afbcd7f4187b-image.png
                  Hope this helps.
                  If you have already determined that and made the swap, then please ignore my message.
                  Thanks!

                  L 1 Reply Last reply
                  0
                  • VinnyV Vinny

                    Hi @labkit
                    MCBL-00091-1 is by default meant for ESC tools...i.e.: it will plug into the ESC side of that cable you removed, not the VOXL 2 side:
                    https://docs.modalai.com/cable-datasheets/#mcbl-00091
                    To use it for HWIL, pins 2&3 need to be swapped as noted: https://docs.modalai.com/cable-userguides/#m0163-4-pin-jst-to-4-pin-jst-cross-over-example
                    You do not need to have the M0163 if you are comfortable re-pinning JSTs:
                    https://docs.modalai.com/cable-userguides/#flightcore-v2-conversion-cables-info

                    5f5ba346-20e1-4428-8a0d-afbcd7f4187b-image.png
                    Hope this helps.
                    If you have already determined that and made the swap, then please ignore my message.
                    Thanks!

                    L Offline
                    L Offline
                    labkit
                    Contributor
                    wrote on last edited by
                    #11

                    @Vinny I swapped pins 2&3 so that the former pin 2 is now pin 3 and vice versa. The swap occurred with no damage to the pins as far as I am aware, but the "Serial port closed" issue is still present. This image shows the correct rewiring, right? The RX and TX wires (white and green) are switched and the USB to JST is in J18 on the VOXL 2. The ESC is unplugged from VOXL 2.

                    9232cc3f-40c4-4b01-9af2-7f714c5f9b26-image.png

                    VinnyV 1 Reply Last reply
                    0
                    • L labkit

                      @Vinny I swapped pins 2&3 so that the former pin 2 is now pin 3 and vice versa. The swap occurred with no damage to the pins as far as I am aware, but the "Serial port closed" issue is still present. This image shows the correct rewiring, right? The RX and TX wires (white and green) are switched and the USB to JST is in J18 on the VOXL 2. The ESC is unplugged from VOXL 2.

                      9232cc3f-40c4-4b01-9af2-7f714c5f9b26-image.png

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

                      Hi @labkit
                      Looks good! At least now the efforts with Eric and team are not in vain since that is the correct MCBL-00091 config for HWIL.
                      You are in good hands with them now

                      L 1 Reply Last reply
                      0
                      • VinnyV Vinny

                        Hi @labkit
                        Looks good! At least now the efforts with Eric and team are not in vain since that is the correct MCBL-00091 config for HWIL.
                        You are in good hands with them now

                        L Offline
                        L Offline
                        labkit
                        Contributor
                        wrote on last edited by
                        #13

                        @Eric-Katzfey I rewired the cable but the issue hasn't changed at all. It's still reporting "Serial port not found!" and the /dev/ttyUSB0 that you mentioned still isn't available from the Gazebo Docker command line.

                        Eric KatzfeyE 1 Reply Last reply
                        0
                        • L labkit

                          @Eric-Katzfey I rewired the cable but the issue hasn't changed at all. It's still reporting "Serial port not found!" and the /dev/ttyUSB0 that you mentioned still isn't available from the Gazebo Docker command line.

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

                          @labkit Is there another Linux computer that you can try? Many people use HITL and no one has reported any issues like this so I am suspecting that there is something about the environment on your machine that is causing the problem.

                          L 1 Reply Last reply
                          0
                          • L labkit

                            I got Docker to avoid the error by doing the steps in the tutorial in a different order with setup on the drone coming first. This must have been why I didn't receive the "serial port closed" error when I first tried to set up the simulation two days ago. However, I don't think the simulation is in shape to run yet, all I've managed is to get back to where I was originally....

                            L Offline
                            L Offline
                            labkit
                            Contributor
                            wrote on last edited by labkit
                            #15

                            Also, ignore my earlier post that said I had fixed things by performing the tutorial steps in a different order. I was mistaken in thinking I had resolved the original issue. The next message explained why I made that mistake.

                            1 Reply Last reply
                            0
                            • Eric KatzfeyE Eric Katzfey

                              @labkit Is there another Linux computer that you can try? Many people use HITL and no one has reported any issues like this so I am suspecting that there is something about the environment on your machine that is causing the problem.

                              L Offline
                              L Offline
                              labkit
                              Contributor
                              wrote on last edited by
                              #16

                              @Eric-Katzfey I will look into trying this.

                              L 1 Reply Last reply
                              0
                              • Alexander SaundersA Alexander Saunders referenced this topic on
                              • L labkit

                                @Eric-Katzfey I will look into trying this.

                                L Offline
                                L Offline
                                labkit
                                Contributor
                                wrote on last edited by
                                #17

                                @Eric-Katzfey Issue is mostly resolved. There were two main errors to fix. The first was that the cable that I was using needed to have its RX and TX wires swapped as Vinny pointed out. The second was that Docker Desktop needed to be uninstalled and replaced with only the core Docker CE Engine. After doing this, the HITL seems to be up and running on the alternate Linux computer I tested with. On the original computer, the "Serial port closed error" is no longer present although there does seem to be a graphics issue when attempting to run the Gazebo image with graphics.

                                8d0e6ab0-9969-4fb4-853c-4879b46992bf-image.png

                                Once this is fixed I think it should be all ready to perform simulations.

                                1 Reply Last reply
                                0
                                • R RyanH referenced this topic on

                                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