/wanderer-linux-updater

Linux tool to update wanderer astro equipment on linux (https://www.wandererastro.com/en/index.jsp)

Primary LanguagePython

Wanderer Linux Updater

A firmware update tool for Wanderer Astro devices, with manual device selection and firmware synchronization via GitHub.

Lire en français

Features

  • YAML Configuration : Centralized and flexible configuration
  • Manual device selection : User interface to choose device type
  • USB port detection : Automatic detection of available serial ports
  • Automatic synchronization : GitHub Actions to sync firmwares
  • GitHub Pages hosting : Firmwares hosted reliably
  • Multi-device support : All Wanderer devices supported

Installation

  1. Clone the repository :
git clone https://github.com/your-username/wanderer-linux-updater.git
cd wanderer-linux-updater
  1. Install avrdude (required for firmware updates) :

On Ubuntu/Debian :

sudo apt-get install avrdude

On Arch Linux :

sudo pacman -S avrdude
  1. Install dependencies using pipenv :
pipenv install

Usage

Interactive update (recommended)

# Launch the interactive update tool
pipenv run python updater.py

The tool will guide you through the following steps :

  1. Device type selection : Choose from configured devices
  2. Serial port selection : Choose from available USB ports
  3. Connection test : Optional verification of device presence
  4. Firmware selection : Choose the firmware version to install
  5. Update : Execute the update

Automatic device detection

# Automatically detect connected devices and choose which one to update
pipenv run python updater.py -a

This mode will:

  1. Scan all USB ports for connected Wanderer devices
  2. Test each device using handshake commands and responses
  3. Display detected devices with their type and port
  4. Let you choose which device to update
  5. Continue with firmware selection and update process

This is especially useful when you have multiple devices connected or want to quickly identify what's connected.

Additional options

# Use a custom configuration file
pipenv run python updater.py --config my-config.yml

# Automatic detection with custom config
pipenv run python updater.py -a --config my-config.yml

# Dry-run mode (shows the command without executing it)
pipenv run python updater.py --dry-run

# Debug mode
pipenv run python updater.py --debug

Utility scripts

List configured devices

# Display all configured devices with their parameters
pipenv run python list_devices.py

Test USB port detection

# Test detection of available serial ports
pipenv run python test_ports.py

Test automatic detection (optional)

# Test automatic device detection via handshake
pipenv run python test_detection.py

# Test the new automatic detection functionality
pipenv run python test_auto_detection.py

Automatic synchronization

The GitHub Actions workflow automatically synchronizes firmwares :

  1. Activation : The workflow runs every 6 hours
  2. Download : Retrieves firmware list from configured URL
  3. Hosting : Firmwares are hosted on GitHub Pages
  4. Index : A JSON index file is generated with metadata

GitHub Pages configuration

  1. Go to Settings > Pages
  2. Source : "Deploy from a branch"
  3. Branch : main (or your main branch)
  4. Folder : / (root)

File structure

wanderer-linux-updater/
├── .github/workflows/sync-firmware.yml  # GitHub Actions workflow
├── scripts/sync_firmware.py             # Synchronization script
├── config.yml                           # Main configuration
├── config_manager.py                    # Configuration manager
├── device_detector.py                   # Device detection (for testing)
├── updater.py                          # Main interactive script
├── test_detection.py                   # Automatic detection test
├── test_auto_detection.py              # New automatic detection test
├── test_ports.py                       # Port detection test
├── list_devices.py                     # Configured devices list
├── firmware/                           # Firmwares (auto-generated)
├── firmware_index.json                 # Firmware index (auto-generated)
└── README.md

Supported devices

  • WandererBoxPlusV3
  • WandererBoxProV3 (Tested ✔️)
  • WandererCoverV3
  • WandererCover V4/V4Pro (Tested ✔️)
  • WandererDewTerminator
  • WandererEclipse
  • WandererRotatorLiteV1/V2
  • WandererRotatorMini (Tested ✔️)
  • WandererRotatorProV1/V2
  • WandererETA54

Advanced configuration

Adding a new device

Add a new entry in the devices section of config.yml :

devices:
  MyNewDevice:
    avr_device: "m328p"
    programmer: "arduino"
    baud_rate: 115200
    handshake_baud_rate: 19200
    handshake_command: "MyCommand"      # Optional: command to send
    handshake_response: "MyResponse"    # Required: expected response

Handshake configuration

Each device can have specific handshake behavior:

  • handshake_command : Optional command to send to the device
  • handshake_response : Required expected response from the device
  • handshake_baud_rate : Optional baud rate for handshake (defaults to baud_rate)

Device detection configuration

device_detection:
  handshake_timeout: 5        # Timeout for handshake operations (seconds)
  port_detection_timeout: 3   # Timeout for port detection (seconds)

Troubleshooting

No ports detected

  1. Verify that the device is connected via USB
  2. Test with pipenv run python test_ports.py
  3. Check permissions on /dev/tty* (Linux)
  4. Install appropriate USB drivers

Configuration errors

# Validate configuration
pipenv run python -c "from config_manager import ConfigManager; ConfigManager().validate_config()"

Update issues

  1. Verify that the device is in bootloader mode
  2. Ensure avrdude is installed
  3. Check serial port permissions
  4. Test with --dry-run mode first

Firmware download errors

  1. Check internet connectivity
  2. Verify firmware URL in configuration
  3. Verify that GitHub repository is correctly configured

Development

Using pipenv

This project uses pipenv for dependency management. Here are the key commands:

# Install dependencies
pipenv install

# Run a script in the virtual environment
pipenv run python script.py

# Activate the virtual environment
pipenv shell

# Add a new dependency
pipenv install package_name

# Add a development dependency
pipenv install --dev package_name

Contributing

  1. Fork the repository
  2. Create a branch for your feature
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License. See the LICENSE file for details.