Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Az.Alt.: LMX200 with arduino. #705

Open
303055 opened this issue Jun 27, 2019 · 9 comments · May be fixed by #3626
Open

Az.Alt.: LMX200 with arduino. #705

303055 opened this issue Jun 27, 2019 · 9 comments · May be fixed by #3626
Assignees
Labels
enhancement Improve existing functionality good first issue Get involved in development! help wanted We may not have the hardware or expertise

Comments

@303055
Copy link

303055 commented Jun 27, 2019

Hi guys,

I tried then search on the telescope plugins the commands: GA # and: GZ # for the altitude coordinates and Azimuth of an object, but they do not seem present. I use a telescope Dobson type, and have to do the math to pass in equatorial and vice versa is counter productive knowing that stellarium calculates..

Why are these orders not present?

thx :)

@gzotti
Copy link
Member

gzotti commented Jun 27, 2019

Because you have not sent your patches yet :-)

@303055
Copy link
Author

303055 commented Jun 27, 2019

I'll try to do it ^^
But I'm not a coding pro: p

it is enough that I modify this file?
https://github.com/Stellarium/stellarium/blob/master/plugins/TelescopeControl/src/Lx200/Lx200Command.cpp

thx

@gzotti
Copy link
Member

gzotti commented Jun 27, 2019

I think you should extend the protocol for all instruments. The original developer of the telescope plugin has unfortunately left the project, and I don't know who could test your development.

Maybe somebody else can answer this?

@303055
Copy link
Author

303055 commented Jun 27, 2019

Ah, if anyone can show me, I want to :)
I saw for example:


bool Lx200CommandGetRa::writeCommandToBuffer(char *&p, char *end)
{
if (end-p < 5)
return false;

  // get RA:
*p++ = '#';
*p++ = ':';
*p++ = 'G';
*p++ = 'R';
*p++ = '#';
has_been_written_to_buffer = true;
return true;

}

int Lx200CommandGetRa::readAnswerFromBuffer(const char *&buff,
const char *end)
{
if (buff < end && *buff=='#')
buff++; // ignore silly byte

if (end-buff < 8)
	return 0;

bool long_format = true;
int ra;
const char *p = buff;
ra = ((*p++) - '0');
ra *= 10;
ra += ((*p++) - '0');
if (*p++ != ':')
{
	#ifdef DEBUG4
	*log_file << Now()
	          << "Lx200CommandGetRa::readAnswerFromBuffer: "
	             "error: ':' expected"
	          << endl;
	#endif
	return -1;
}

ra *=  6; ra += ((*p++) - '0');
ra *= 10; ra += ((*p++) - '0');
switch (*p++)
{
	case ':':
		ra *=  6; ra += ((*p++) - '0');
		ra *= 10; ra += ((*p++) - '0');
		if (end-buff < 9)
			return 0;
		break;
	
	case '.':
		ra *= 10; ra += ((*p++) - '0');
		ra *= 6;
		long_format = false;
		break;
	
	default:
		*log_file << Now()
		          << "Lx200CommandGetRa::readAnswerFromBuffer: "
		             "error: '.' or ':' expected"
		          << endl;
		return -1;
}

if (*p++ != '#')
{
	*log_file << Now()
	          << "Lx200CommandGetRa::readAnswerFromBuffer: "
	             "error: '#' expected"
	          << endl;
	return -1;
}

#ifdef DEBUG4
*log_file << Now()
          << "Lx200CommandGetRa::readAnswerFromBuffer: "
          << "RA = "
          << qSetPadChar('0')
          << qSetFieldWidth(2)  << (ra/3600)
          << qSetFieldWidth(0) << ':'
          << qSetFieldWidth(2) << ((ra/60)%60)
          << qSetFieldWidth(0) << ':'
          << qSetFieldWidth(2) << (ra%60)
          << qSetFieldWidth(0) << qSetPadChar(' ')
          << endl;
#endif

buff = p;
server.longFormatUsedReceived(long_format);
server.raReceived((unsigned int)floor(ra * (4294967296.0/86400.0)));
return 1;

}

void Lx200CommandGetRa::print(QTextStream &o) const
{
o << "Lx200CommandGetRa";
}


I can copy it and replace in GA?
and change the code after?


bool Lx200CommandGetRa::writeCommandToBuffer(char *&p, char *end)
{
if (end-p < 5)
return false;

  // get RA:
*p++ = '#';
*p++ = ':';
*p++ = 'G';
*p++ = 'A';
*p++ = '#';
has_been_written_to_buffer = true;
return true;
 .....

thx

@alex-w alex-w added this to To do in Plugin: Telescope Control via automation Jun 30, 2019
@alex-w alex-w added the enhancement Improve existing functionality label Jun 30, 2019
@sferixx
Copy link

sferixx commented Oct 16, 2019

303055 Hello! Could You tell me did You make it (the plugin ehacement) and is it working or not i need it in the same purpose as you im building arduino scope and i would be very gratefull if i could skip the math.

@gzotti gzotti added good first issue Get involved in development! help wanted We may not have the hardware or expertise labels Oct 16, 2019
@gzotti
Copy link
Member

gzotti commented Oct 16, 2019

It seems some extensions to the telescope control protocols could be implemented for and by somebody with alt-azimuthal telescopes like Dobsons modified with Arduino-based control devices. Now, who wants to do sferixx's homework and develop support for some reference DIY kit?

@alex-w
Copy link
Member

alex-w commented Aug 2, 2022

This is a good task for the community to participate in the contribution into Stellarium. Who wants to help us?

@alex-w alex-w removed the community label Aug 2, 2022
@huntflex
Copy link

huntflex commented Aug 6, 2022

Hi!
Very new to this codebase (actually just cloned the repo today) but I'd like to try to tackle this issue if that's ok. It might take some time.

@gzotti
Copy link
Member

gzotti commented Aug 6, 2022

Sure, go ahead. You will only have to extend the TelescopeControl plugin. If possible, all telescope models will have to support the protocol. I cannot test any, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality good first issue Get involved in development! help wanted We may not have the hardware or expertise
Projects
5 participants