thibmaek / wled-backup

Simple CLI tool to backup presets & configuration from a WLED device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WLED Backup (wled-backup)

standard-readme compliant .github/workflows/ci.yaml Go version Go Report

Simple CLI tool to backup presets & configuration from a WLED device.

Table of Contents

Background

I put a lot of effort in getting my presets right for all of my WLED devices. The cheap ESP8266's I buy from AliExpress aren't resistant to failure however and reflashing WLED on a new ESP means that I would have to recreate my presets from scratch. Luckily WLED's JSON API exposes an endpoint to retrieve your presets & configuration as JSON files.

This tool does nothing more than calling that endpoint and writing it to a file on the system in parallel. This way you can backup your files via e.g a cronjob.

It's also possible to reupload these files across host and syncing the presets if you'd want that. This tool however does not currently support that.

Install

Download the latest release binary for your platform from the releases page. Optionally rename it if you want but this is not required.

Usage

Run the export command and pass a host or a list of (comma separated) hosts.

# A single host
$ ./wled-backup_linux_x64 export --hosts=192.168.1.12

# Multiple hosts
$ ./wled-backup_linux_x64 export --hosts=192.168.1.12,192.168.1.177

# mDNS works too, you can mix and match
$ ./wled-backup_linux_x64 export --hosts=wled-tv.local,192.168.1.177

By default this will output the backup files in the current folder. You can optionally specify an output directory with the --outputDir flag:

$ ./wled-backup_linux_x64 export --hosts=192.168.1.12,192.168.1.177 --outputDir=/home/user/wled_backups

Development

To build from source make sure you have the following dependencies installed:

  • GNU Make 3.81+
  • asdf

The version of Go is determined by .tool-versions, the configuration file for asdf. To install the correct version determined by the repository run the following command:

$ asdf install

You can then use the provided Make targets to build for all or specific architectures:

# Build for 64 bit (Linux, macOS Intel, Windows)
$ make build_x64

# Build for ARM (Linux, Raspberry Pi, macOS M1)
$ make build_x64

# Build all artifacts
$ make build

The built artifacts will then be available in the ./bin/ folder:

bin
├── wled-backup_linux_armv6
├── wled-backup_linux_armv7
├── wled-backup_linux_x64
├── wled-backup_mac_arm64
├── wled-backup_mac_x64
└── wled-backup_win_x64.exe

License

Unlicense

For more info, see LICENSE file

About

Simple CLI tool to backup presets & configuration from a WLED device

License:The Unlicense


Languages

Language:Go 88.0%Language:Makefile 12.0%