stellarium icon indicating copy to clipboard operation
stellarium copied to clipboard

Az.Alt.: LMX200 with arduino.

Open 303055 opened this issue 5 years ago • 9 comments

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 :)

303055 avatar Jun 27 '19 12:06 303055

Because you have not sent your patches yet :-)

gzotti avatar Jun 27 '19 14:06 gzotti

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

303055 avatar Jun 27 '19 15:06 303055

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?

gzotti avatar Jun 27 '19 15:06 gzotti

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

303055 avatar Jun 27 '19 17:06 303055

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.

sferixx avatar Oct 16 '19 20:10 sferixx

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?

gzotti avatar Oct 16 '19 22:10 gzotti

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

alex-w avatar Aug 02 '22 16:08 alex-w

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.

huntflex avatar Aug 06 '22 18:08 huntflex

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.

gzotti avatar Aug 06 '22 20:08 gzotti