Arduino code made to work with abserver_rpi project
Original project board - Arduino nano (Atmega328P)
Drivers - DRV8825/A4988
Soldered on breadboard, but PCB Coming Soon!
Commands are sent over serial port at 115200
baud rate.
You can change baud rate by your preference, but 115200
is the fastest baud rate with 30cm cable that is stable, and is not slow enough to be noticeable.
API is made using ArduinoJson library.
Sample message:
{"n" : *action_name*, "p": *action_params*}
action_name
- name from list of possible actionsaction_params
- params for a certain action also from list of possible actions
Developement stages:
- 🌑 - not implemented, but planned
- 🌗 - implemented, but not finalized and tested
- 🌕 - implemented and tested
Command | Description | Impl. status | Params |
---|---|---|---|
ping |
Returns pong and firmware version |
🌕 | None |
moveto |
Aims telescope at given cordinates | 🌗 | ->🌌<- |
move |
Aims telescope at relative cordinates | 🌕 | ->🌌<- |
track |
Starts compensating for earth rotation at set position | 🌗 | ->🌌<- |
config |
Used for parameters configuration | 🌗 | ->🌌<- |
stop |
Stops all steppers | 🌕 | None |
- Returns arduino firmware version to check the compitability of APIs
Response:
{"type": "pong", "vesrion": *firmware version*}
Params:
"ha"
- Hour Angle of an object"dec"
- Declination of an nedeed object
Example:
{"n": "moveTo", "p": {"dec": 35.5}}
Params:
"decDiff"
- the declination angle you you want to move your telescope on"haDiff"
- the hour angle you want to move your telescope on
Example:
{"n": "move", "p": {"decDiff": 10}}
Params:
"t"
- Time to automatically stop tracking
Example:
{"n": "track", "p": {"t": 500}}
Params:
"reportFrequency": float
- Report frequency for the status message. High frequencies can interrupt tracking. Will be fixed in future updates.
Example:
{"n": "config", "p": {"reportFrequency": 0.25}} //Every 4 seconds