/EspBuddy

Wrapper to easily upload (OTA or Serial), backup, batch query, monitor ESP8266 boards using Esptool.py, Espota.py and Platformio

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Esp Buddy

GitHub release GitHub stars GitHub last commit GitHub license Twitter

  • Tired of typing very long commands to upload your custom firmwares?
  • Bored to manually upload your firmwares in two steps for 1MB devices?
  • Want to batch upload new firmwares to all your devices via OTA or backup all settings in one command?
  • Need a solid tool to discover, control or flash Sonoff DIY devices (ie Sonoff Mini)

This script allows you to easily upload firmwares to remote (ESP8266 based) devices via Wifi (Over The Air) or Serial, in one short command. It also gathers various tool commands to be used in batch mode.

Features

  • OTA upload on 4M devices
  • OTA upload on 1M devices using an intermediate firmware (automatic two steps)
  • Use configuration presets for devices
  • Optional compilation using platformio
  • Optionally pass various -D flags to the compiler, including extracted parameters like IP or hostname
  • Fetch versions of remote devices
  • Archive current firmware & previous firmware per target
  • Backup current settings & previous settings per target
  • Parse Repositories installed versions
  • Git Pull Repositories
  • Ping Remote Host
  • Sonoff DIY: scan network for devices in DIY mode
  • Sonoff DIY: total control using the Ithead factory API.
  • Sonoff DIY: replace the factory firmware with any other one (default to Tasmota) OTA. (see #20 )
  • Sonoff DIY: cross-platform support (Mac, Win, Linux)

Supported Firmwares

Works with :

  • ESPeasy
  • Espurna
  • Tasmota
  • should virtually work with any ESP8266 firmware: just add a small espb_repo_xxx class to describe it.

Requirements

  • Linux or OSX Operating System (+ Windows for some method only)
  • php5 or newer
  • PlatformIO needed only for compiling

Installation

  • Rename config-sample.php to config.php.
  • Fill in some hosts and configurations in config.php

Usage

espbuddy.php ACTION [TARGET] [OPTIONS]

Valid Actions are:

  • upload : Build and/or Upload current repo version to Device(s)
  • build : Build current repo version
  • backup : Backup remote devices' settings
  • monitor : Monitor the serial port
  • version : Show Device(s) Version
  • reboot : Reboot remote devive
  • gpios : Test (On/Off) each GPIOs
  • ping : Ping Device(s)
  • sonodiy : Discover, Control or Flash Sonoff devices in DIY mode
  • repo_version : Show Repo's Current version
  • repo_pull : Git Pull Repo's master version
  • list_hosts : List all available hosts
  • list_configs : List all available configurations
  • list_repos : List all available repositories
  • self : EspBuddy maintenance tools
  • help : Show full help

Examples:

  • espbuddy.php upload select the one to upload to from the list of targets
  • espbuddy.php upload relay1 upload to target 'relay1'
  • espbuddy.php upload all -b upload to all defined targets, while building the firmware first
  • espbuddy.php upload relay1 -w upload using serial to target 'relay1'
  • espbuddy.php upload relay1 -web build 'relay1', then using serial port, erase first and upload
  • espbuddy.php backup all backup settings ofall defined targets
  • espbuddy.php monitor relay1 --rate=9600 serial monitors 'relay1' target at 9600 bauds
  • espbuddy.php version all show versions of all defined targets
  • espbuddy.php ping all ping the all defined targets
  • espbuddy.php sonodiy flash 192.168.1.10 1000abc1ef flashes a (default) Tasmota firmware into a Sonoff Mini in DIY mode

See more command examples ...

Contribute

Whether you are a developer or a regular user, your help is most welcome!

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.