Package org.emrick.project.dev
Class Esptool
java.lang.Object
org.emrick.project.dev.Esptool
Locates (or downloads once) Espressif's esptool and uses it to flash receivers.
Order of preference: the esptool bundled with an existing PlatformIO install (no download), then a
standalone esptool previously downloaded into the Emrick Designer folder, then a one-time download of the
standalone build from Espressif's GitHub releases. Downloads are pinned to a version and checked against
Espressif's published SHA-256 digests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordStandalone esptool builds for each platform: asset name and its published SHA-256. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Esptool.Assetprivate static final Esptool.Assetprivate static final Esptool.Assetprivate static final Esptool.Assetprivate static final Patternprivate static final Stringprivate static final Stringprivate static final Esptool.Asset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Esptool.Assetprivate static voidprivate static FilefindExecutable(File dir) static booleanflash(String systemPortName, FirmwareRelease release, Consumer<Integer> progress, Consumer<String> log) Flashes a release to one receiver.static booleanprivate static Stringesptool wants a device path on macOS/Linux (e.g.private static void
-
Field Details
-
VERSION
- See Also:
-
RELEASE_URL
- See Also:
-
WINDOWS
-
LINUX_AMD64
-
LINUX_ARM64
-
MAC_ARM64
-
MAC_AMD64
-
PROGRESS
-
cachedCommand
-
-
Constructor Details
-
Esptool
private Esptool()
-
-
Method Details
-
isWindows
public static boolean isWindows() -
command
- Parameters:
status- receives short progress messages (e.g. while downloading)- Returns:
- the command prefix that runs esptool (e.g. [path/esptool.exe] or [python, esptool.py])
- Throws:
IOException
-
fromPlatformIO
- Returns:
- the esptool that ships with PlatformIO, if PlatformIO is installed
-
findExecutable
-
assetForPlatform
- Throws:
IOException
-
download
- Throws:
IOException
-
unzip
- Throws:
IOException
-
flash
public static boolean flash(String systemPortName, FirmwareRelease release, Consumer<Integer> progress, Consumer<String> log) throws IOException Flashes a release to one receiver. Only the app, bootloader, and partition table regions are written, so the unit's stored data (board ID, label, show) is kept.- Parameters:
progress- receives 0-100 for the firmware imagelog- receives every line esptool prints- Returns:
- true if esptool reported success
- Throws:
IOException
-
portPath
esptool wants a device path on macOS/Linux (e.g. /dev/cu.usbserial-0001) and the plain name on Windows.
-