Search documentation of grizzly

# View Source Grizzly.ZWaveFirmware (grizzly v7.4.2)

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()

Chip series (e.g. 500, 700, 800).

module_reset_fun()

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.

update_status()

The various status of a firmware update of the Z-Wave module

## Functions

find_upgrade_spec(specs, current_version)

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.

maybe_run_zwave_firmware_update(opts)

Update the firmware on the Z-Wave module if an update is available

# Types

Link to this type

# chip_series()

View Source

    @type chip_series() :: pos_integer()

Chip series (e.g. 500, 700, 800).

Link to this type

# module_reset_fun()

View Source

    @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.

Link to this type

# update_status()

View Source

    @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 some `reason`.

# Functions

Link to this function

# find_upgrade_spec(specs, current_version)

View Source

    @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.

Link to this function

# maybe_run_zwave_firmware_update(opts)

View Source

    @spec maybe_run_zwave_firmware_update(Grizzly.Options.t()) :: :ok

Update the firmware on the Z-Wave module if an update is available