Skip to content

Commit 095cb59

Browse files
committed
Minor changes for ESP8266 support
1 parent 083c1c1 commit 095cb59

File tree

4 files changed

+29
-31
lines changed

4 files changed

+29
-31
lines changed

Software/Arduino code/OpenAstroTracker/Globals.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,46 @@ extern int PolarisRASecond;
4646
// useful if you are always going to run the mount from a laptop anyway.
4747
// #define HEADLESS_CLIENT
4848

49+
#ifdef ESP8266
50+
#define HEADLESS_CLIENT
51+
#define WIFI_ENABLED
52+
#define INFRA_SSID "yourSSID"
53+
#define INFRA_WPAKEY "yourWPAKey"
54+
#define OAT_WPAKEY "superSecret"
55+
#define HOSTNAME "OATerScope"
56+
// 0 - Infrastructure Only - Connecting to a Router
57+
// 1 - AP Mode Only - Acting as a Router
58+
// 2 - Attempt Infrastructure, Fail over to AP Mode.
59+
#define WIFI_MODE 0
60+
#endif
61+
62+
4963
// Uncomment this to enable the heating menu
5064
// NOTE: Heating is currently not supported!
5165
// #define SUPPORT_HEATING
5266

53-
// Uncomment to support Guided Startup
54-
#define SUPPORT_GUIDED_STARTUP
67+
#ifndef HEADLESS_CLIENT
68+
69+
// Uncomment to support Guided Startup
70+
#define SUPPORT_GUIDED_STARTUP
5571

56-
// Uncomment to support full GO (was POI) menu.
57-
// If this is commented out you still have a GO menu that has Home and Park.
58-
#define SUPPORT_POINTS_OF_INTEREST
72+
// Uncomment to support full GO (was POI) menu.
73+
// If this is commented out you still have a GO menu that has Home and Park.
74+
#define SUPPORT_POINTS_OF_INTEREST
5975

60-
// Uncomment to support CTRL menu, allowing you to manually slew the mount with the buttons.
61-
#define SUPPORT_MANUAL_CONTROL
76+
// Uncomment to support CTRL menu, allowing you to manually slew the mount with the buttons.
77+
#define SUPPORT_MANUAL_CONTROL
6278

63-
// Uncomment to support CAL menu, allowing you to calibrate various things
64-
#define SUPPORT_CALIBRATION
79+
// Uncomment to support CAL menu, allowing you to calibrate various things
80+
#define SUPPORT_CALIBRATION
6581

82+
#endif
6683
// Uncomment to support INFO menu that displays various pieces of information about the mount.
6784
// #define SUPPORT_INFO_DISPLAY
6885

6986
// Uncomment to support Serial Meade LX200 protocol support
7087
// #define SUPPORT_SERIAL_CONTROL
7188

72-
#ifdef ESP8266
73-
#define HEADLESS_CLIENT
74-
#define WIFI_ENABLED
75-
#define INFRA_SSID "yourSSID"
76-
#define INFRA_WPAKEY "yourWPAKey"
77-
#define OAT_WPAKEY "superSecret"
78-
#define HOSTNAME "OATerScope"
79-
// 0 - Infrastructure Only - Connecting to a Router
80-
// 1 - AP Mode Only - Acting as a Router
81-
// 2 - Attempt Infrastructure, Fail over to AP Mode.
82-
#define WIFI_MODE 0
83-
#endif
84-
8589
// If we are making a headleass (no screen, no keyboard) client, always enable Serial.
8690
#ifdef HEADLESS_CLIENT
8791
#define SUPPORT_SERIAL_CONTROL

Software/Arduino code/OpenAstroTracker/WifiControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WifiControl::WifiControl(Mount* mount, LcdMenu* lcdMenu)
1818
}
1919
}
2020

21-
void WifiControl::setup() {}
21+
void WifiControl::setup() {
2222
_cmdProcessor = MeadeCommandProcessor::instance();
2323
}
2424

@@ -68,7 +68,7 @@ void WifiControl::tcpLoop() {
6868
#ifdef DEBUG_MODE
6969
Serial.printf("<-- %s#\n", cmd.c_str());
7070
#endif
71-
auto retVal = _cmdProcessor.processCommand(cmd);
71+
auto retVal = _cmdProcessor->processCommand(cmd);
7272

7373
if (retVal != "") {
7474
client.write(retVal.c_str());

Software/Arduino code/OpenAstroTracker/a_inits.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
//SoftwareSerial BT(10,11);
1717

18-
#ifdef USE_ESP8266_PINS
18+
#ifdef ESP8266
1919
// RA Motor pins
2020
#define RAmotorPin1 D0 // IN1 auf ULN2003 driver 1 // 2 / 22
2121
#define RAmotorPin3 D1 // IN2 auf ULN2003 driver 1 // 3 / 24d

Software/Arduino code/OpenAstroTracker/b_setup.ino

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ void setup() {
3333
wifiControl.setup();
3434
#endif
3535

36-
// Not sure if this is neeeded
37-
pinMode(A1, OUTPUT);
38-
pinMode(A2, OUTPUT);
39-
pinMode(A3, OUTPUT);
40-
pinMode(A4, OUTPUT);
41-
4236
// Configure the mount
4337
// Set the global HA correction
4438
DayTime polaris = DayTime(24, 0, 0);

0 commit comments

Comments
 (0)