Skip to content

rowelld/device-updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Device Updater

This project is a Python-based MQTT device updater designed to manage firmware updates and status monitoring for IoT devices. It communicates with devices over MQTT, checks their firmware versions, and triggers over-the-air (OTA) updates when necessary.

Features

  • Connects to an MQTT broker and subscribes to device response topics.
  • Publishes commands to devices to query their firmware version.
  • Compares device firmware versions to the latest version and initiates OTA updates if outdated.
  • Maintains JSON records for each device, including update status.
  • Logs all operations to updater.log for traceability.

File Structure

  • update.py: Main script containing all logic for MQTT communication, device version checking, and update management.
  • requirements.txt: List of required Python packages.
  • devices/: Directory where per-device JSON files are stored (created at runtime).
  • data/devices.json: JSON file containing the list of device serial numbers to manage (must be present at runtime).

Requirements

  • Python 3.x
  • paho-mqtt library

Install dependencies with:

pip install -r requirements.txt

Usage

  1. Ensure your MQTT broker is running and accessible (default: 127.0.0.1:1883).
  2. Place a devices.json file in a data/ directory, listing the serial numbers of devices to manage (as a JSON array).
  3. Run the updater:
python update.py

Logging

All actions and warnings are logged to updater.log in the project directory.

Customization

  • Update the broker and port variables in update.py to match your MQTT broker settings.
  • Adjust the latestVer variable to set the required firmware version.

License

MIT License (add your license details here)

About

Aware FOTA updater

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages