Bug 383759 - Kstars cannot connect to Phd2
Summary: Kstars cannot connect to Phd2
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jasem Mutlaq
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-20 16:54 UTC by doma
Modified: 2017-08-21 16:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Typo in the sqlite db field name (33.10 KB, image/png)
2017-08-21 10:24 UTC, doma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doma 2017-08-20 16:54:48 UTC
Kstars-bleeding in ubuntu 17.04. 2017-08-19T17:38:19Z 2.8.1

In the profile editor I tried to set phd2 host and address. Host can be set and saved. However the port remains 0 no matter what I do. 
Editing kstarsrc [Guide] section PHD2Port has no effect. The profile editor shows zero.

Cliking Connect on the guider panel throws "The connection was refuded by the peer. Make sure that PHD2 is running, and check that host name and port are correct".

PHD2 is actually listening on tcp 4300 and 4400. I tried to set both in the kstarsrc with no success.
Comment 1 doma 2017-08-20 20:06:42 UTC
I also modified the sqlite db directly and saved ports both 4300 and 4400 to two different profiles.

After launching kstars I still saw port numbers zero in both profiles.
Comment 2 Jasem Mutlaq 2017-08-21 06:07:45 UTC
This is odd, I cannot reproduce this bug. Are you using English locale?
Comment 3 doma 2017-08-21 07:07:00 UTC
phd@astro2:~$ echo $LC_ALL
en_US.UTF-8
phd@astro2:~$ echo $LANG
en_US.UTF-8
phd@astro2:~$
Comment 4 doma 2017-08-21 07:07:39 UTC
phd@astro2:~$ uname -a
Linux astro2 3.4.39 #1 SMP PREEMPT Mon Oct 12 12:02:29 CEST 2015 armv7l armv7l armv7l GNU/Linux
phd@astro2:~$
Comment 5 Jasem Mutlaq 2017-08-21 07:15:23 UTC
I presume you're using the PPA, can you please update to the latest version and try again?
Comment 6 doma 2017-08-21 10:02:46 UTC
Updated. It still does not work. Port is saved wrong.

Strange, apart from this everything else seems to be working.

I'm using LXDE should this matter. 

Further detail is that I created two profiles, so now I have three. 
Simulators, Doma1 and Doma2. I updated the sqlite file for Doma1 and Doma2 to have 4400 and 4300 as ports. Then I opened kstars and looked at both Doma1 and Doma2 profiles. Both showed 0 in the port field.

The I modified Doma1 and saved the profile. I opened it once again and still saw zero at the port number.

Then I looked at the sqlite db. For the profile I modified the port got updated to NULL, whereas with the unmodified profile I saw the original value of 4300 in the DB although it showed up as zero in the control and when kstars was trying to read it for connecting phd2.
Comment 7 doma 2017-08-21 10:18:53 UTC
I noticed one more thing... The field in the db is called `guidepost`. Everywhere else it is typed correctly. 'indiwebmanagerport' and 'port'. Maybe this has something to do with it...
Comment 8 doma 2017-08-21 10:20:20 UTC
guiderpost :)
Comment 9 Jasem Mutlaq 2017-08-21 10:23:39 UTC
well one thing you could do is to delete userdb but you will lose all settings and DSOs and then start KStars and it will recreate the whole db again.
Comment 10 doma 2017-08-21 10:24:32 UTC
Created attachment 107420 [details]
Typo in the sqlite db field name
Comment 11 Jasem Mutlaq 2017-08-21 10:25:30 UTC
Git commit ac0ca2bd4da72db56f8eabdeefa58f7fa632054d by Jasem Mutlaq.
Committed on 21/08/2017 at 10:24.
Pushed by mutlaqja into branch 'master'.

Fix stupid typo

M  +1    -1    kstars/auxiliary/ksuserdb.cpp

https://commits.kde.org/kstars/ac0ca2bd4da72db56f8eabdeefa58f7fa632054d
Comment 12 doma 2017-08-21 10:29:27 UTC
Deleted user db. Retried. 
Same result. Maybe it could be made NOT NULL and fill it with 0 and see what happens. 

You always get a zero value in the control anyway.
Comment 13 Jasem Mutlaq 2017-08-21 10:30:49 UTC
It was a typo as you found it and it is now fixed. You either compile KStars now from Git or wait until the next release.
Comment 14 doma 2017-08-21 11:50:44 UTC
Thank you. An alter table on the db might do until then as a workaround, right?
Comment 15 doma 2017-08-21 16:53:12 UTC
I can confirm that altering the schema works.

Of course first you need to rename then re-create the table.
Then create the new table with correct column names and then migrate the data if you want a correct fix as sqlite does not support ALTER TABLE.

:)