View Source Grizzly.ZWaveFirmware (grizzly v8.5.3)
Z-Wave module firmware upgrade support.
Note on zw_programmer
This module includes functionality to attempt to recover from a failed
firmware upgrade that has left the Z-Wave module stuck at the bootloader. This
functionality relies on zw_programmer
's -a
flag, which (as of the 7.18.03
release) does not work with 700- or 800-series modules.
If you are using a 700- or 800-series module, you will need to implement this
functionality yourself. This module invokes zw_programmer
with a -7
flag
along with the -a
flag when a 700/800-series module is specified.
Because Z/IP Gateway is not licensed for distribution, we cannot provide a patch file. The modification is fairly straightforward, but if you need assistance, please open an issue on GitHub.
Summary
Types
Chip series (e.g. 500, 700, 800).
A function that performs a hard reset of the Z-Wave module. Used to detect if the module is stuck at the bootloader due to a previous failed upgrade.
The various status of a firmware update of the Z-Wave module
Functions
Find an upgrade spec that applies to the current version. In case of multiple matches, returns the spec with the highest version. When the current version is nil, returns the spec with the highest version. If no specs match, returns nil.
Update the firmware on the Z-Wave module if an update is available
Types
@type chip_series() :: pos_integer()
Chip series (e.g. 500, 700, 800).
@type module_reset_fun() :: (-> :ok)
A function that performs a hard reset of the Z-Wave module. Used to detect if the module is stuck at the bootloader due to a previous failed upgrade.
@type update_status() :: :started | {:done, :success | :skipped} | {:error, Grizzly.FirmwareError.t()}
The various status of a firmware update of the Z-Wave module
:started
- the firmware update has been initiated and all validation of the firmware update is complete.{:done, :success}
- the firmware update of the Z-Wave module is successful.{:done, :skipped}
- no firmware update was applied.{:error, reason}
- A firmware update of the Z-Wave module was attempted but failed for somereason
.
Functions
@spec find_upgrade_spec([Grizzly.ZWaveFirmware.UpgradeSpec.t()], Version.t() | nil) :: Grizzly.ZWaveFirmware.UpgradeSpec.t() | nil
Find an upgrade spec that applies to the current version. In case of multiple matches, returns the spec with the highest version. When the current version is nil, returns the spec with the highest version. If no specs match, returns nil.
@spec maybe_run_zwave_firmware_update(Grizzly.Options.t()) :: :ok
Update the firmware on the Z-Wave module if an update is available