In order to deploy the firmware to the Arduino, you will need to download the software, configure the settings specific to your setup (board, steppers, addons) and then compile the project and flash it to the Arduino. This is all relatively easy to do with the Arduino tools (either Arduino IDE or Visual Studio with PlatformIO).
There are two main ways to get the Arduino firmware, depending on your level of comfort working with cutting edge code vs. older but tried and true code.
If you're interested in the changes between firmware versions in the latest code, checkout the Changelog. Note that we do strive to release stable development releases and fix bugs pretty quickly.
Get the latest stable release of the firmware from the Github releases page. The Arduino firmware will be located in a ZIP file called "V1.10.xx.zip". Extract the contents of this file into a folder where you want to keep the software.
There are other software packages like the ASCOM driver and OATcontrol too, see Software for a explanation on them and how to get them.
We all use Visual Studio Code with the PlatformIO addon and we suggest you get this if you intend to do any software work at all on the OAT firmware. But the Arduino IDE will also build and upload the firmware to your OAT.
Download and install Visual Studio Code. Then install Platform IO from the Extensions Tab in VSCode. Once you open the OpenAstroTracker folder (File > Open Folder), the rest happens automatically.
You can download the Arduino IDE from here and install it. Navigate to where you extracted the OpenAstroTracker firmware, rename that folder to OpenAstroTracker, and open the "OpenAstroTracker.ino" file with the IDE.
You will first need to install a few libraries. Do this by opening Tools
> Manage Libraries
or by clicking CTRL+SHIFT+i. Use the Search bar to find these libraries:
accelstepper
" and install the one by Mike McCauley.TMCstepper
" by teemuatlut.TinyGPSPlus
" by mikalhart.For other addons, see their pages for install instructions on the Addons page
Refer to the Arduino IDE page for additional help if needed.
To get started, use the OAT Firmware Configurator.
For more details and instructions on how to configure your firmware, go to the Firmware configuration page.
You should build the version for your board after making the edits described above.
Visual Studio Code with PlatformIO:
PlatformIO
(the little alien head) in the left sidebar.Project Tasks
.General
> Build
.Arduino IDE:
Sketch
> Compile/Verify
to build or hit CTRL+R.After the above Build step has succeeded, you'll need to send the built firmware to your board. This is called Flashing.
Visual Studio Code with PlatformIO:
Upload
command (right below to the Build
command used above)Arduino IDE:
Tools
> Board
) as well as the port it is on (Tools
> Port
).Sketch
> Upload
or press CTRL+U.The MKS GenL boards are all based on the Mega2560, in Arduino IDE that is the board to select under
Tools
>Board
.
Note that if you are using the ESP32, you have to press and hold the reset button on the board until the programming starts.
If you have the capacitor mod, you need to remove it in order to flash the board.
Linux users that cannot select the port might have to disable or delete bltty as this has priority over The arduino IDE
The system does not allow very high level debugging (like stepping through code with a debugger). The firmware does have a number of logging output flags to aid you in determining what the mount is doing. But, and it's a big but, this logging is output on the serial port and thus breaks the Meade protocol (since instead of the command response that an app might be expecting, it gets debug spew).
This means that realistically, the only way to debug something is to connect the OAT to a monitor (terminal) and issue Meade commands manually. The Arduino IDE actually has a pretty easy to use and reliable monitor, you just hit CTRL+SHIFT+M and it will open a window that you can use to issue commands and see the logging output. You do have to configure the port and board before opening it, though.
The debugging is controlled in the firmware through a compile-time flag (so that the large number of debug strings and the formatting calls are not in the release/non-debug build) called DEBUG_LEVEL
and it is defined in your local configuration file (the config generator puts it at the bottom). By default, it is set to DEBUG_NONE
, which means no logging will be created and apps can use the OAT via the Meade protocol.
There are a number of flags that can be used to control the level and category of debug output. Take a look at the bottom of Constants.hpp
for details.
You'll need to re-compile and re-flash the board before you can view the debug log in the monitor.
The firmware implements a (large) subset of the Meade LX200 GPS protocol. Additionally, it adds a lot of extension functions that can query and control aspects specific to the OAT.
The Meade Command Index is a page that lists all available command. That page is autogenerated.