×

INDI Library v1.9.3 Released (11 Nov 2021)

Bimonthly Stable INDI Library release introduces new drivers and fixes for existing ones. Some highlights:

Debugging

  • Posts: 36
  • Thank you received: 1

Debugging was created by Tim

I'm having trouble getting debugging going on my system. I've followed the tutorial video about setting up the environment very closely, but of course some of it has changed. I can't get KStars to connect via the device manager as shown to port 7624. I just get this message
Connection to INDI server at host localhost with port 7624 failed.
. To make sure I'm running the indiserver on 7624 I've tried -p 7624 but with the same result. I know that the driver is running as I can put a breakpoint in the constructor and that get hit.

Any ideas what I might be doing wrong ?

Thanks
Tim

Running KUbuntu 18.04 and downloaded latest git
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic
10 months 3 weeks ago #66028

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 4

Replied by Arnold Graf on topic Debugging

To understand you correctly, you are starting the indiserver with drivers on your local computer in a bash and the you try to connect with kstars ->Device Manager -> Client (not Local/Server) to the local server? The you get the message that connection failed, correct?
KStars 3.5 + astroberry remote
EQMOD, EQ6-R , ASI2600+ ASI178+EAF+ASI120
10 months 2 weeks ago #66044

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Debugging

Not quite. I'm starting in debug mode from within QtCreator as per the video on the driver development page. I can see from qtcreator that the driver has started and Linux System Monitor confirms that. Then I go into KStars | Tools | Device Manager and I've created on the client tab a localhost port 7624 client. When I try to connect from that I get the link failed message.
This is, so far as I can tell exactly what the video tells me to do. I tested using the indi_celestron_gps driver as the video does and put the breakpoint in the same place.
I'm on Kubuntu 18.04 so it seems KDESudo works fine as well.

I just tried starting the server from BASH and it then connects fine in KStars. So it must be something I'm doing wrong within qtCreator
Last edit: 10 months 2 weeks ago by Tim.
10 months 2 weeks ago #66049

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 4

Replied by Arnold Graf on topic Debugging

It seems that he server is interrupted by the debugger but my knowledge of qtCreator is very limited. Sorry
KStars 3.5 + astroberry remote
EQMOD, EQ6-R , ASI2600+ ASI178+EAF+ASI120
The following user(s) said Thank You: Tim
10 months 2 weeks ago #66052

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Debugging

Is no one else having this issue ? At the moment I've just ground to a halt with driver development until it's solved.
Should I maybe just delete everything INDI and QTCreator on the computer and start again ?
10 months 2 weeks ago #66128

Please Log in or Create an account to join the conversation.

  • Posts: 1011
  • Thank you received: 298

Replied by Eric on topic Re:Debugging

You should maybe try to debug your driver with gdb first to validate the procedure, with the follow-fork-mode option. Or you can start your indiserver separately and attach qtcreator to the pid of the driver.

-Eric
HEQ5-Pro - Atik 314E - Orion ED80T - DMK21 on Orion 50mm
DIY 3D-printed Moonlite and FWheel RGB/LPR
KStars and indiserver on two Atom 1.6GHz 1GB RAM Linux, VPN remote access
10 months 2 weeks ago #66156

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0

Replied by Kenneth Binney on topic Debugging

Hi,


This is actually my first post here, so hello everyone...

For me, the issues getting the debugger up and running mainly involved getting qtcreator to set up the relative paths between the indiserver and the INDI driver correctly for GDB.

There seems to be a couple of ways to get debug working - Initially I tried the one involving connecting to the indiserver found under 'usr/bin', but this involves getting from user space to root, which was a bit inconvenient when debugging the device side, (I used the program 'ssh-askpass-gnome' in the end). These days, I connect straight to a user space debug build of the indiserver, it just saves a step.

This is the process I use to get INDI device driver debug working on my Ubuntu 20.04.1 LTS, (gnome) system. I'm using Qt Creator 4.14:


Setup for 'kstars' client side:


From kstars main menu bar:

Tools -> Devices -> Device Manager -> client tab -> Add

Add new 'host':

Name: my_device_name
Host: localhost
Port: 7624


Setup for QtCreator IDE environment:

From top menu Tools -> Options... -> Debugger panel icon -> GDB tab:

In the 'Additional startup commands' window, add the 'follow-fork-mode' GDB command with a parameter of 'child':

follow-fork-mode child

Then on closing this panel, return to the main panel and select the 'Build & Run' panel icon:

Projects -> 'Run' icon -> Run Settings panel -> Run configuration, (with custom Executable selected) ->

Executable: absolute_path_to_debug_indiserver/indiserver
Command-line arguments: -v relative_path_from_indiserver_to_my_device_driver/my_device_driver
Working directory: %{CurrentProject:BuildPath}


All other settings are on defaults, (with the 'debugger settings' set to enable C++, disable QML).


Then to start a debug session:


Build the project, and run the executable, (F5). The 'run' settings should kick off of an instance of the indiserver and attach the driver automatically.

I then start kstars and use the device manager window to connect to the device.


Note: As mentioned above, the indiserver I'm using has already been build using the install script, but I connect to the version in my personal 'indi' build directory, not the final 'installed' location.

I can supply screenshots if that would help.


Ken B.
10 months 2 weeks ago #66384

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Debugging

Thank-you for the reply Ken. I've actually taken the decision to stick with ASCOM for now. Until the whole INDI experience has been improved that is. I had worked pretty hard at INDI for over a month and not even got to the stage I could write a simple driver.
From start to end in ASCOM it took a week and that driver is nice and solid with no issues. GUI could do with tidying up though :)

Regards
Tim
10 months 1 week ago #66468

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0

Replied by Kenneth Binney on topic Debugging

Hi,

Good luck with your project...
10 months 1 week ago #66471

Please Log in or Create an account to join the conversation.

Time to create page: 0.735 seconds