How to set-up Qt Creator to debug on ssh /dev/ttyUSB0 ?
-
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?
-
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?
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
-
@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
androute
of you host PC so we could have a look. -
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
-
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
-
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.
-
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.
@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...
-
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.