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

    "Serial Port Closed!" and other HITL Errors

    Starling & Starling 2
    3
    17
    868
    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.
    • L
      labkit @labkit
      last edited by 31 May 2024, 19:00

      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 31 May 2024, 21:49 Reply Quote 0
      • L
        labkit @labkit
        last edited by labkit 31 May 2024, 21:50 31 May 2024, 21:49

        @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

        V 1 Reply Last reply 31 May 2024, 22:29 Reply Quote 0
        • V
          Vinny ModalAI Team @labkit
          last edited by Vinny 31 May 2024, 22:30 31 May 2024, 22:29

          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 9 Jun 2024, 16:53 Reply Quote 0
          • L
            labkit @Vinny
            last edited by 9 Jun 2024, 16:53

            @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

            V 1 Reply Last reply 10 Jun 2024, 14:41 Reply Quote 0
            • V
              Vinny ModalAI Team @labkit
              last edited by 10 Jun 2024, 14:41

              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 10 Jun 2024, 15:31 Reply Quote 0
              • L
                labkit @Vinny
                last edited by 10 Jun 2024, 15:31

                @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.

                E 1 Reply Last reply 10 Jun 2024, 15:45 Reply Quote 0
                • E
                  Eric Katzfey ModalAI Team @labkit
                  last edited by 10 Jun 2024, 15:45

                  @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 10 Jun 2024, 15:57 Reply Quote 0
                  • L
                    labkit @labkit
                    last edited by labkit 10 Jun 2024, 15:57 10 Jun 2024, 15:55

                    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 Reply Quote 0
                    • L
                      labkit @Eric Katzfey
                      last edited by 10 Jun 2024, 15:57

                      @Eric-Katzfey I will look into trying this.

                      L 1 Reply Last reply 11 Jun 2024, 23:50 Reply Quote 0
                      • A Alexander Saunders referenced this topic on 10 Jun 2024, 21:00
                      • L
                        labkit @labkit
                        last edited by 11 Jun 2024, 23:50

                        @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 Reply Quote 0
                        • R RyanH referenced this topic on 27 Feb 2025, 20:28
                        • First post
                          Last post
                        Powered by NodeBB | Contributors