Skip to main content

Event-driven asynchronous USB flasher for SMHUB

Project description

SMHUB USB Flasher

A simple, automated tool for flashing and recovering the SMHUB operating system over a direct USB connection.

Whether you are getting a fresh start or recovering a completely unbootable hub, this tool handles the entire process for you automatically.

🖥️ 1. Graphical Interface (GUI) - Recommended

For most users, we highly recommend our standalone graphical flasher. It is supported on Windows, macOS, and Linux.

You can download the latest installer directly from the Releases page. The GUI provides a native, one-click experience without requiring terminal commands, python dependencies, or manual environment setups.

Key GUI Features

  • One-Click Flashing: Automatically downloads, verifies, and flashes the latest stable/beta firmware, or allows you to select a local directory.
  • Automated Driver Setup: On Windows, it automatically prompts to install and bind the required WinUSB driver under User Account Control (UAC) if missing.
  • Real-time Output: Provides live status tracking, progress indicators, and visual logs throughout the flashing cycle.
  • 🔌 USB-to-Serial Recovery Console: Provides direct command-line access from within the flasher app for recovery and diagnostics if device won't fully boot:
    • Auto-Discovery: Automatically scans COM ports / USB TTY nodes to locate the SMHUB runtime composite serial interface.
    • Auto-Login: Automatically logs into the board shell using default credentials (only works if still using the default password).
    • 📤 Upload Files: Push any local file from your computer directly into the active directory of the SMHUB filesystem via ZMODEM.
    • 📋 Download Logs (One-Click): Compress all system logs from /var/log and automatically transfer them to a folder of your choice on your host.
    • 💾 Download Backups (One-Click): Packages active and user configuration and transfers the full backup archive securely back to your PC.

🛠️ 2. CLI Setup (Cross-Platform)

The Python CLI tool smhub-flasher is fully cross-platform and works natively on Linux, macOS, and Windows. If this is your first time using this tool, you need to install its dependencies. On Linux, you also need to grant your terminal the correct permissions to talk to the raw USB ports.

Install Software

You will need to install fastboot using your system's package manager, and then install the Python flasher using pipx (or pip).

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install fastboot

# Fedora/RHEL
# sudo dnf install android-tools

# macOS
# brew install android-platform-tools


# 2. Install the flasher package
pipx install smhub-flasher
# or
pip install smhub-flasher

Grant USB Permissions

By default, Linux forbids regular user accounts from modifying low-level USB devices for security. Rather than running the flashing tool as sudo (which is dangerous), we can install a permanent "rule" allowing your account safe access.

Simply copy and paste these exact commands into your terminal one-by-one:

# 1. Download the permission rules directly from the repository
sudo curl -Lo /etc/udev/rules.d/99-smhub-flasher.rules https://raw.githubusercontent.com/smlight-tech/smhub-flasher/main/99-smhub-flasher.rules

# 2. Tell Linux to reload these newly installed rules
sudo udevadm control --reload-rules
sudo udevadm trigger

# 3. Add your current user account to the 'dialout' allowed group
sudo usermod -a -G dialout $USER

Important: If you had to run step #3, you must completely log out of your computer and log back in, or restart your computer, for Linux to recognize your new group permissions!


⚡ 3. CLI Usage

Once the setup is complete, you are ready to flash your SMHUB board. The easiest way is to let the tool automatically download the latest official firmware release using the --online flag.

Basic Flashing

Run the flasher tool from your terminal:

# Automatically download and flash the latest stable release (Recommended)
smhub-flasher --online

# Or, if you have your own local firmware directory (containing fip.bin and emmc.img)
smhub-flasher --image-dir /path/to/my/firmware/

# Or explicitly defining specific local files
smhub-flasher --fastboot --fip /path/to/fip.bin --image /path/to/emmc.img

The Flashing Process

Once you hit enter, the tool will sit quietly and wait:

  1. Press the Reset button on your SMHUB board (or plug it in if it's currently disconnected).
  2. The terminal will instantly detect it and begin the ROM Handshake.
  3. You will see the board disconnect and reconnect automatically as it transitions out of hardware-mode into U-Boot. Do not unplug it!
  4. It will smoothly transition into sending your emmc.img payload.
  5. Once flashing is complete, the board will reboot automatically and it is safe to unplug.

Command Line Options

SMHUB USB Flasher

options:
  -h, --help            show this help message and exit
  --image-dir IMAGE_DIR
                        Path to directory containing fip.bin and emmc.img
  --fip FIP             Explicit path to fip.bin
  --image IMAGE         Explicit path to emmc combined image
  --list                List available online OS images
  --online [ONLINE]     Download and flash an online OS image (default: latest)
  -v, --verbose         increase output verbosity (-v: debug, -vv: packet trace)
  --fastboot            Flash the device using Fastboot mode
  --expert-help         Show help for advanced / expert-only options

Advanced & Technical Details

For developers and power users, the flasher contains several advanced capabilities. See the Advanced & Technical Details page for full details on slot-based flashing, bootloader testing, running from source, and deep-dive architectural documentation on the internal state machine.

🔧 Troubleshooting

  • Permission Denied / USBError: If it immediately crashes claiming it has no access, your Linux user permissions aren't set correctly. Ensure you followed the First-Time Setup completely and have logged out/in.
  • I want to see what is failing: Add the -v flag to the end of your command for verbose output (including standard Fastboot activity logs). For deeper debugging, use the -vv flag instead, which dumps the raw hexadecimal USB traffic onto the screen so developers can see what the hardware is complaining about at the transport layer.

License

License: GPL v3

Copyright © 2026 SMLIGHT

This project is licensed under the GNU General Public License v3.0. You are free to use, modify, and distribute this software under the terms of that license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smhub_flasher-1.0.4.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smhub_flasher-1.0.4-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

Details for the file smhub_flasher-1.0.4.tar.gz.

File metadata

  • Download URL: smhub_flasher-1.0.4.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for smhub_flasher-1.0.4.tar.gz
Algorithm Hash digest
SHA256 754b0035e289430e1145a53b19ded9f75fd5ee40825453fe273c7d28a80db36a
MD5 45e7a7801a5ab17c9317728098f49ef8
BLAKE2b-256 71de54c8405ade544c4d71f99c59c25a8fd19569a94184fe49cc61f68d797e5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for smhub_flasher-1.0.4.tar.gz:

Publisher: publish.yaml on smlight-tech/smhub-flasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smhub_flasher-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: smhub_flasher-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 55.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for smhub_flasher-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32f30db75ea25cba31014fce1205038637d5778f82c36022fcac3db8022b3c33
MD5 6f4b52a67df6dd411bd5cf0ac278a5a9
BLAKE2b-256 7816f2fefebcb2644fb2555495846cf1e75ac72ba9b1b54aedcbe21b19e878e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for smhub_flasher-1.0.4-py3-none-any.whl:

Publisher: publish.yaml on smlight-tech/smhub-flasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page