Skip to content

Alternative hand controller using a Rasp pi zero for the WandererAstro WandererCover, for those practicing astrophotography without a WIndows computer

License

Notifications You must be signed in to change notification settings

TomyCesaille/poto-wanderercover

Repository files navigation

poto-wanderercover

Embedded solution to control a WandererAstro WandererCover hardware without a computer or ZWO ASIAIR.

It's especially designed for older WandererCover versions that do not include an IR remote, but it also works with newer versions!

Getting started

The minimal bill of materials for this project is:

  • a WandererCover device ¯_(ツ)_/¯
  • a Raspberry Pi (Raspberry Pi Zero W recommended; version 1 is sufficient)
  • an 8GB microSD card
  • three 3-position switches (ON-OFF-ON)
  • a USB-A to micro USB-B cable (for data)

For the full version, you will also need:

  • a 3D printed case (see Hardware section)
  • four M3 bolts
  • two 12V DC cables (2.1/5.5mm)
  • a DC/DC step-down converter to power the 5V Raspberry Pi board from your 12V supply

Software

  1. Install the latest Raspberry Pi OS Lite on the microSD card, then boot it up and connect to your Wi-Fi network. Connect via SSH and verify that Python is installed:
python --version
# > 3.11.2
  1. Setup the python virtual environment:
sudo apt-get install python3-pip python3-venv

git clone https://github.com/TomyCesaille/poto-wanderercover.git
cd poto-wanderercover
python -m venv poto-wanderercover
source poto-wanderercover/bin/activate

 # Install the requirements
pip install -r requirements.txt
  1. Create a systemd service file:

This allows the program to run automatically at boot.

sudo nano /etc/systemd/system/poto-wanderercover.service
  1. Add the following content to the file:
[Unit]
Description=Poto-WandererCover Control Service
After=network.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/poto-wanderercover
ExecStart=/bin/bash -c 'source /home/pi/poto-wanderercover/poto-wanderercover/bin/activate && python main.py'
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=poto-wanderercover

[Install]
WantedBy=multi-user.target

The Restart=always option ensures that the script will automatically restart if it crashes, and the RestartSec=10 option sets a 10-second delay before restarting.

  1. Enable and start the service:
sudo systemctl enable poto-wanderercover.service
sudo systemctl start poto-wanderercover.service

# Check the status of the service
sudo systemctl status poto-wanderercover.service

# If you make changes to the service file, reload the daemon
sudo systemctl daemon-reload
  • To start the service: sudo systemctl start poto-wanderercover.service
  • To stop the service: sudo systemctl stop poto-wanderercover.service
  • To restart the service: sudo systemctl restart poto-wanderercover.service
  • To disable autostart: sudo systemctl disable poto-wanderercover.service
  • To view logs: sudo journalctl -u poto-wanderercover.service -f

Hardware

A 3D printable box is available in the ./hardware directory as follows:

  • The scad file contains the FreeCAD source code, available for customization.
  • The stl file contains the generic 3D model.
  • The 3mf file contains BambuLab Studio 3D print preferences; use this ideally if you print with this software.

The case fits a Raspberry Pi Zero W board and a standard DC-DC step-down converter.

Installation

  • Prepare the software
  • Install the three switches into the box
  • Solder the wires as follows
Switch Function Left Pin Middle Pin Right Pin
Switch 1 Cover Lid GPIO 17 3.3V GPIO 27
Switch 2 Brightness GPIO 22 3.3V GPIO 23
Switch 3 Dew Heater GPIO 24 3.3V GPIO 25
  • Configure the DC-DC step-down converter to output 5V from a 12V input
  • Solder the 12V input to the DC-DC step-down converter
  • Connect the 5V output from the DC-DC step-down converter to the Raspberry Pi
  • Connect the USB data cable to the Raspberry Pi.

Contributing

Remote coding (with the Raspberry Pi Zero W)

Since we can't code remotely with VS Code on the Raspberry Pi Zero, use the following method:

  • Write code on your development computer
  • Sync the project to the Pi using rsync or git push/pull
# rsync command (adapt the IP and remove --dry-run when ready)
# The `--exclude='/poto-wanderercover/'` flag prevents syncing the virtual environment folder to the Pi.
# NOTE: Windows users, please use WSL to run the rsync command.
rsync -avzcu --delete --exclude='/poto-wanderercover/' --exclude='/__pycache__/' --exclude='/.mypy_cache/' --dry-run ./ pi@192.168.0.100:/home/pi/poto-wanderercover/

Run the code (from the Raspberry Pi Zero W)

source poto-wanderercover/bin/activate
pip install -r requirements.txt

python main.py

Type checking & Linter (from the development computer)

On Ubuntu (WSL or native), run the following commands to check types:

apt install python3-venv
python3 -m venv poto-wanderercover

# Activate the virtual environment
source poto-wanderercover/bin/activate

# Install dependencies
pip install -r requirements-dev.txt

# Run type checking
mypy .

# Run linter
ruff check .

About

Alternative hand controller using a Rasp pi zero for the WandererAstro WandererCover, for those practicing astrophotography without a WIndows computer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published