Skip to content

Commit 834f613

Browse files
V1.7.20 - Updates
- Added :XGM# command to retrieve hardware information about the mount. - Added SSID name and Hostname to the :XGN# command reply.
1 parent 8b27d84 commit 834f613

File tree

6 files changed

+70
-6
lines changed

6 files changed

+70
-6
lines changed

Software/Arduino code/OpenAstroTracker/Globals.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ extern String version;
2020
extern byte PolarisRAHour;
2121
extern byte PolarisRAMinute;
2222
extern byte PolarisRASecond;
23+
extern float RAStepsPerRevolution;
24+
extern int RAPulleyTeeth;
25+
extern float RACircumference;
26+
extern float DECStepsPerRevolution;
27+
extern int DecPulleyTeeth;
28+
2329

2430
// Debugging output control
2531
// Each bit in the debug level specifies a kind of debug to enable.

Software/Arduino code/OpenAstroTracker/MeadeCommandProcessor.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,18 @@
301301
// Get the current HA of the mount.
302302
// Returns: HHMMSS
303303
//
304+
// :XGM#
305+
// Get Mount configuration settings
306+
// Returns: <board>>,<RA Stepper Info>,<DEC Stepper Info>,#
307+
// Where <board> is one of the supported boards (currently Uno, Mega, ESP8266, ESP32)
308+
// <Stepper Info> is a pipe-delimited string of Motor type (NEMA or 28BYJ), Pulley Teeth, Steps per revolution)
309+
// Example: ESP32,28BYJ|16|4096.00,28BYJ|16|4096.00,#
310+
//
304311
// :XGN#
305312
// Get network settings
306313
// Gets the current status of the Wifi connection. Reply only available when running on ESP8266 boards.
307-
// Returns: 1,<stats>,<hostname>,<ip>:<port># - if Wifi is enabled
308-
// Returns: 0,# - if Wifi is not enabled
314+
// Returns: 1,<stats>,<hostname>,<ip>:<port>,<SSID>,<OATHostname># - if Wifi is enabled
315+
// Returns: 0,# - if Wifi is not enabled
309316
//
310317
// :XGL#
311318
// Get LST
@@ -721,6 +728,9 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) {
721728
else if (inCmd[1] == 'B') {
722729
return String(_mount->getBacklashCorrection()) + "#";
723730
}
731+
else if (inCmd[1] == 'M') {
732+
return String(_mount->getMountHardwareInfo()) + "#";
733+
}
724734
else if (inCmd[1] == 'H') {
725735
char scratchBuffer[10];
726736
sprintf(scratchBuffer, "%02d%02d%02d#", _mount->HA().getHours(), _mount->HA().getMinutes(), _mount->HA().getSeconds());

Software/Arduino code/OpenAstroTracker/Mount.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,50 @@ int Mount::getBacklashCorrection()
408408
{
409409
return _backlashCorrectionSteps;
410410
}
411+
412+
/////////////////////////////////
413+
//
414+
// getMountHardwareInfo
415+
//
416+
/////////////////////////////////
417+
String Mount::getMountHardwareInfo()
418+
{
419+
String ret = "Unknown";
420+
#if defined(ESP8266)
421+
ret = "ESP8266,";
422+
#elif defined(ESP32)
423+
ret = "ESP32,";
424+
#elif defined(__AVR_ATmega2560__)
425+
ret = "Mega,";
426+
#elif defined (__AVR_ATmega328P__)
427+
ret = "Uno,";
428+
#endif
429+
430+
#if RA_Stepper_TYPE == 0 // 28BYJ
431+
ret += "28BYJ|";
432+
#elif RA_Stepper_TYPE == 1 // NEMA
433+
ret += "NEMA|";
434+
#else
435+
ret += "?|";
436+
#endif
437+
ret += String(RAPulleyTeeth)+"|";
438+
ret += String(RAStepsPerRevolution)+",";
439+
440+
#if DEC_Stepper_TYPE == 0 // 28BYJ
441+
ret += "28BYJ|";
442+
#elif DEC_Stepper_TYPE == 1 // NEMA
443+
ret += "NEMA|";
444+
#else
445+
ret += "?|";
446+
#endif
447+
448+
ret += String(DecPulleyTeeth)+"|";
449+
ret += String(DECStepsPerRevolution)+",";
450+
451+
return ret;
452+
}
453+
454+
411455
/////////////////////////////////
412456
//
413457
// setBacklashCorrection

Software/Arduino code/OpenAstroTracker/Mount.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ class Mount {
191191
// Read the saved configuration from persistent storage
192192
void readConfiguration();
193193

194+
// Get Mount configuration data
195+
String getMountHardwareInfo();
196+
194197
private:
195198

196199
// Reads values from EEPROM that configure the mount (if previously stored)

Software/Arduino code/OpenAstroTracker/OpenAstroTracker.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "Globals.hpp"
2020

21-
String version = "V1.7.19";
21+
String version = "V1.7.20";
2222

2323
///////////////////////////////////////////////////////////////////////////
2424
// Please see the Globals.h file for configuration of the firmware.
@@ -43,12 +43,12 @@ float RAStepsPerRevolution = 4096;
4343
// Theoretically correct RA tracking speed is 1.246586 (300 x 14.95903 / 3600) (V2 : 1.333800 (322 x 14.95903 / 3600) steps/sec (this is for 20T)
4444

4545
// Your drive pulley tooth count:
46-
#define RAPulleyTeeth 16
46+
int RAPulleyTeeth = 16;
4747

4848
// the Circumference of the RA wheel
4949
// V1: 1057.1
5050
// V2: 1131
51-
#define RACircumference 1131
51+
float RACircumference = 1131.0;
5252

5353
int RAStepsPerDegree = (RACircumference / (RAPulleyTeeth * 2.0) * RAStepsPerRevolution / 360.0); // V2 Ring has belt in a groove and belt runs on bearings
5454
int RAspeed = 400; // You can change the speed and acceleration of the steppers here. Max. Speed = 600.
@@ -66,7 +66,7 @@ float DECStepsPerRevolution = 4096;
6666
// One DEC revolution needs 14.13 (565.5mm/40mm) stepper revolutions
6767
// Which means 57907 steps (14.14 x 4096) moves 360 degrees
6868
// So there are 160.85 steps/degree (57907/360) (this is for 20T)
69-
#define DecPulleyTeeth 16
69+
int DecPulleyTeeth = 16;
7070

7171
int DECStepsPerDegree = (565.5 / (DecPulleyTeeth * 2.0) * DECStepsPerRevolution / 360.0);
7272
int DECspeed = 600; // You can change the speed and acceleration of the steppers here. Max. Speed = 600.

Software/Arduino code/OpenAstroTracker/WifiControl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ String WifiControl::getStatus()
8585
#endif
8686

8787
result += "," + WiFi.localIP().toString() + ":" + PORT;
88+
result += "," + String(INFRA_SSID) + "," + String(HOSTNAME);
8889
return result;
8990
}
9091

0 commit comments

Comments
 (0)