Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set-up Qt Creator to debug on ssh /dev/ttyUSB0 ?
Forum Updated to NodeBB v4.3 + New Features

How to set-up Qt Creator to debug on ssh /dev/ttyUSB0 ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 1.7k 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    Presently I have Qt Creator set-up and can remotely debug device using the ethernet connection. The software I'm trying to debug is on the WiFi link, there is no hard wired ethernet link. I do have a serial connection to the device and I have it configured so I can ssh into the device using the serial link.

    I would like to debug the application via the serial link as when I'm trying to fault find the WiFi connection, adding and removing WiFi networks I obviously loose he link and can no longer debug it.

    Is there anyway to set-up Qt Creator / Debugger to use the serial link for debugging?

    Kind Regards,
    Sy

    aha_1980A 1 Reply Last reply
    0
    • SPlattenS SPlatten

      Presently I have Qt Creator set-up and can remotely debug device using the ethernet connection. The software I'm trying to debug is on the WiFi link, there is no hard wired ethernet link. I do have a serial connection to the device and I have it configured so I can ssh into the device using the serial link.

      I would like to debug the application via the serial link as when I'm trying to fault find the WiFi connection, adding and removing WiFi networks I obviously loose he link and can no longer debug it.

      Is there anyway to set-up Qt Creator / Debugger to use the serial link for debugging?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @SPlatten

      I think GDB/gdbserver can talk over a serial line, but as you wrote:

      I have it configured so I can ssh into the device using the serial link

      It sounds as if the serial line acts as network connection (SLIP?), so the setup would have to be outside Creator, in your network setup. So make sure the route to gdbserver is only possible over the serial network link and it will work.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        Thank you, how do I do that?

        Kind Regards,
        Sy

        aha_1980A 1 Reply Last reply
        0
        • SPlattenS SPlatten

          Thank you, how do I do that?

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SPlatten Well, you specify the IP address for gdbserver in Creator. Now you just have to make sure that the only way to that IP address is over the SLIP connection.

          You can post the output of ifconfig and route of you host PC so we could have a look.

          Qt has to stay free or it will die.

          1 Reply Last reply
          1
          • SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by SPlatten
            #5

            Thanks again, from the target device, ifconfig:

                lo        link encapsulated:local loopback
                          init adds:127.0.0.1  Mask:255.0.0.0
                          UP LOOPBACK RUNNING  MTU:16436  Metric:1
                          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                          collisions:0 txqueuelen:0
                          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
            
                wlan0     link encap:Ethernet  HWaddr 44:39:C4:9E:05:58
                          inet addr:192.168.1.226  Bcast:192.168.1.255  Mask:255.255.255.0
                          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                          RX packets:833 errors:0 dropped:183 overruns:0 frame:0
                          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
                          collisions:0 txqueuelen:1000
                          RX bytes:32259 (31.5 KiB)  TX bytes:1647 (1.6 KiB)
            

            From the target device, route:

                Kernal IP routing table
                Destination   Gateway     Genmask        Flags  Metric Ref    Use Iface
                192.168.1.0   *           255.255.255.0  U      0      0      0   wlan0
                default       192.168.1.1 0.0.0.0        UG     0      0      0   wlan0
            

            On the development PC running Ubuntu 14.04.6 LTS the serial device is /dev/ttyUSB0

            Kind Regards,
            Sy

            aha_1980A 1 Reply Last reply
            0
            • SPlattenS SPlatten

              Thanks again, from the target device, ifconfig:

                  lo        link encapsulated:local loopback
                            init adds:127.0.0.1  Mask:255.0.0.0
                            UP LOOPBACK RUNNING  MTU:16436  Metric:1
                            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                            collisions:0 txqueuelen:0
                            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              
                  wlan0     link encap:Ethernet  HWaddr 44:39:C4:9E:05:58
                            inet addr:192.168.1.226  Bcast:192.168.1.255  Mask:255.255.255.0
                            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                            RX packets:833 errors:0 dropped:183 overruns:0 frame:0
                            TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
                            collisions:0 txqueuelen:1000
                            RX bytes:32259 (31.5 KiB)  TX bytes:1647 (1.6 KiB)
              

              From the target device, route:

                  Kernal IP routing table
                  Destination   Gateway     Genmask        Flags  Metric Ref    Use Iface
                  192.168.1.0   *           255.255.255.0  U      0      0      0   wlan0
                  default       192.168.1.1 0.0.0.0        UG     0      0      0   wlan0
              

              On the development PC running Ubuntu 14.04.6 LTS the serial device is /dev/ttyUSB0

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi @SPlatten,

              I'm confused. Your target only has WiFi and local loopback interfaces.

              How do you ssh to the device then? I thought you had setup SLIP to connect to your device?

              Regards

              Qt has to stay free or it will die.

              1 Reply Last reply
              0
              • SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #7

                The device is an ACR890 All-In-One Mobile Smart Card Terminal. I have a USB to Serial cable connected to my laptop with a serial to micro USB cable connected from the USB interface to the ACR890.

                The ACR890 has a sample application that scans for the WiFi networks and connects, after I've connected and have an IP address I then SSH into the device and kill the demo process then launch the debugger from Qt Creator on the development system.

                Kind Regards,
                Sy

                aha_1980A 1 Reply Last reply
                0
                • SPlattenS SPlatten

                  The device is an ACR890 All-In-One Mobile Smart Card Terminal. I have a USB to Serial cable connected to my laptop with a serial to micro USB cable connected from the USB interface to the ACR890.

                  The ACR890 has a sample application that scans for the WiFi networks and connects, after I've connected and have an IP address I then SSH into the device and kill the demo process then launch the debugger from Qt Creator on the development system.

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @SPlatten So you are ssh'ing to your device over WiFi, correct?

                  I was misleaded by your sentence:

                  I do have a serial connection to the device and I have it configured so I can ssh into the device using the serial link.

                  But in that case you probably cannot use network connection between gdb and gdbserver. You will have to find out first, how to connect over the serial line. https://doc.qt.io/qtcreator/creator-debugger-operating-modes.html states that it should be possible.

                  However, I've never done such thing...

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  0
                  • SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #9

                    I started using ssh as so:

                        ssh root@192.168.1.226
                    

                    This is over the WiFi, debugging with Qt Creator always using the remote connection which must be via IP.

                    I recently received a serial adapter and now connect in the terminal with:

                        sudo chown root.root /dev/ttyUSB0
                        sudo cu -l /dev/ttyUSB0 -s 115200 -e
                    

                    Sorry if I mislead you, I don't use ssh at all to connect via serial, but I would like to connect the debugger via serial if possible because no matter what happens with the WiFi the serial terminal stays open, even rebooting the device I can see exactly what is happening.

                    Kind Regards,
                    Sy

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved