Moonlite-compatible focuser firmware built on Zephyr RTOS.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
OpenAstroFocuser is built for astrophotographers and observatory tinkerers who want reliable, scriptable focusing on DIY hardware. Plug it into any Moonlite-compatible controller (real hardware or software clients such as NINA, Ekos, or ASCOM drivers) and you get:
- Preset-aware autofocus – store and recall absolute positions, then let your capture suite step through autofocus routines without losing calibration.
- Live telemetry – query current/new positions, motion state, temperature, and speed over the Moonlite serial link to feed dashboards or automation scripts.
- Manual and automated motion – stage moves, cancel in-flight slews, or flip between half/full-step microstepping directly from your control software.
- Configurable speed profiles – adjust the Moonlite delay multiplier on the fly to trade speed for torque when heavy imaging trains are attached.
- Hardware flexibility – run on ESP32-S3 reference hardware, custom shields, or any board with Zephyr support and a UART interface.
- Ready-to-use documentation & tests – follow the included docs, CI, and ztest suites to adapt the firmware to your rig with confidence.
Every release follows Zephyr main, so you always know which toolchain and modules were used to build the shipped firmware.
Set up the Zephyr toolchain per the Getting Started Guide. The commands below assume a Linux host and Zephyr SDK.
- West (installed via
pip install west) - Zephyr SDK or an equivalent toolchain
- Python 3.10+
- Initialise a workspace pointing at this manifest:
west init -m https://github.com/OpenAstroTech/OpenAstroFocuser --mr main OpenAstroFocuser-workspace
cd OpenAstroFocuser-workspace
west update-
Export the Zephyr environment (optional but handy):
source zephyr/zephyr-env.sh -
(Optional) Install Python requirements for documentation:
pip install -r OpenAstroFocuser/doc/requirements.txt
west build -b esp32s3_devkitc/esp32s3/procpu OpenAstroFocuser/app
west flashPass -DEXTRA_CONF_FILE=debug.conf for verbose logging or switch -b to any supported board/overlay.
west build -b qemu_x86 OpenAstroFocuser/tests/lib/moonlite --build-dir build/moonlite_test --pristine auto
west build -t run --build-dir build/moonlite_testwest twister -T OpenAstroFocuser/tests --integration- Automatic homing / end stop detection.
- Saving of last known position in EEPROM
See the open issues for the full backlog.
Contributions keep this firmware evolving. If you have ideas or fixes:
- Fork the repo
- Create your feature branch (
git checkout -b feature/AmazingFocuserBoost) - Commit (
git commit -m 'Add some AmazingFocuserBoost') - Push (
git push origin feature/AmazingFocuserBoost) - Open a Pull Request
Please run the formatter (west clang-format) and the applicable tests before sending PRs.
Distributed under the Apache License 2.0. See LICENSE for details.
Project Link: https://github.com/OpenAstroTech/OpenAstroFocuser