Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

The firmware versions for the RuuviTag

Dennis German edited this page Sep 11, 2021 · 15 revisions

This wiki documents the firmware available for the Ruuvi.

Version v3.30.3 2021-09-09!

## See below for 2.5.9 information.

Only RAWv2 mode is supported with the green LED blinking. It reports temperature, humidity, air pressure, instantaneous x-z-y acceleration values, battery voltage, Tx power, MovementCounter, MeasurementSequenceNumber and the MAC address.

Historical data is stored in the RuuviTag and is retrievable via RuuviStation for android and RuuviStationIOS.

Holding the B button invokes a "factory reset" which clears all settings and historical(logged) data.

Internals

To install 2.x firmwares a wired connection (i.e. Ruuvi and Nordic development kit boards and USB cable) are required.

Firmware is no longer compatible with Eddystone and Espruino firmware.

For the service providers and library developers

The Ruuvi Firmware no longer has the RAWv1 data format.

2.5.9 broadcast in the RAWv2 2 format. If your service works with the RuuviTags from Ruuvi Shop, you don’t have to take any action.

If your service would benefit from data logged by the RuuviTag itself, you can now read historical data over GATT. The documentation of the GATT communication protocol can be found at docs.ruuvi.com . The docs are a work in progress and might contain errors.

For an example implementation of log reads See @Rinat’s BTKit

For firmware developers

The firmware has been designed to be modular and with well defined interfaces between modules. This makes it easier to support new boards or board variants as well as add new sensors or actuators to the firmware.

GATT

The firmware supports 2-way communication over BLE GATT, using Nordic UART Service. The GATT protocol also supports reading basic device information using BLE standard Device Information Service and buttonless firmware updates using Nordic UART Service.

The preview documentation of the GATT communication protocol can be found at docs.ruuvi.com.

In future versions the GATT connection will have more extensive options, such as configuring logging intervals etc.

Ruuvi provides "ready-to flash" firmware variants for several use cases without needing to set up the configuration system.

Logging

The firmware logs temperature, humidity and air pressure data to internal flash memory. It can be retrieved via GATT as described above. In future versions more data, such as acceleration events may be logged.

Multiple board support

The board definitions are in their own repository at https://github.com/ruuvi/ruuvi.boards.c. The board definition file has information of the pinout and sensors available. The application has the responsibility of translating the definitions of the board files to different modules to avoid dependencies between modules, for example maximum I2C data rate on boards is translated to drivers with function task_i2c_init

   switch (RUUVI_BOARD_I2C_FREQ)
   {
        case RUUVI_BOARD_I2C_FREQUENCY_100k:
            config.frequency = RUUVI_INTERFACE_I2C_FREQUENCY_100k;
            break;

        case RUUVI_BOARD_I2C_FREQUENCY_250k:
            config.frequency = RUUVI_INTERFACE_I2C_FREQUENCY_250k;
            break;

        case RUUVI_BOARD_I2C_FREQUENCY_400k:
            config.frequency = RUUVI_INTERFACE_I2C_FREQUENCY_400k;
            break;

        default:
            config.frequency = RUUVI_INTERFACE_I2C_FREQUENCY_100k;
            ruuvi_interface_log (RUUVI_INTERFACE_LOG_WARNING,
                                 "Unknown I2C frequency, defaulting to 100k \r\n");
    }

Firmware variants

As of 3.30.3 there’s 4 firmware variants:

Default Test Longlife Longmem
Advertisement interval 1285 ms 211 ms 9900 ms 1285 ms
Logging interval 5 minutes 6 seconds 5 minutes 12 hours
Log period 3.5 days 1.7 hours 3.5 days 1.5 years
Battery on RuuviTag B TBD, medium TBD, short TBD, long TBD, medium
Runs system tests No Yes No No
Prints status to RTT No Yes No No
Each of these variants serve a different need and the individual values might be fine tuned later.

These can be found at github.com/ruuvi/ruuvi.firmware.c/releases

Modularity

The firmware is written with hardware abstractions implemented via interface functions. This enables the same higher level firmware modules to retrieve sensor data regardless of the actual hardware sensor. This also allows the driver modules to import sensor manufacturer’s official drivers and transform the information to a common format of all Ruuvi drivers. Currently sensors from STM, Bosch and Sensirion are supported.

Continuous Integration

We use several Continous Integration tools such as Jenkins for producing firmware builds, Ceedling for unit tests, PVS Studio for static code analysis, Doxygen for building documentation, Travis for running and publishing the results of the previous tools and SonarCloud tracking the CI status.

In the future the power profile of each board will be taken.

Version 3.30.0

  • Tag can be connected to for reading logged(historical) data. This is available in RuuviStation android application and RuuviStation for IOS.
  • DFU service is disabled by default but becomes enabled for the next connection after NFC scan or button press.
  • Future version may require an unlock code to be sent in order to enable the DFU service

Version 2.3x

  • Not connectable by default.
  • Firmware is updatable without physical access as when installed within walls...

Additional discussion is at Ruuvi Forum beginning 2018-10-05


Version 2.5.9 is a stable release since October 31, 2019.

Modes

There are 3 modes: RAWv1, RAWv2, RAWv2_slow. Modes are cycled by a short button press and retained after reboot.

  1. Distributed starting in RAWv2 mode with the green LED blinking. It reports temperature, humidity, air pressure, instantaneous x-z-y acceleration values, battery voltage, Tx power, MovementCounter, MeasurementSequenceNUmber and the MAC address. This has been in use for nearly 2 years and is supported by most of the community libraries.
  2. RAWv2_slow mode advertises at 5 * 1285 ms interval to save battery, in total 6420 ms + 0-10 ms.
  3. RAWv1 with the red LED blinking only reports temperature, humidity, air pressure, instantaneous x-z-y acceleration values and Battery voltage
  4. URL mode is deprecated

NFC responds with FW version MAC and ID and then reboots.

Long press on button "B" enters DeviceFirmwareUpdate mode for OverTheAir updating of the firmware via Nordic nRFconnect or nRFtools.

Default advertisement interval (fast) is 1280 ms + random interval to match Apple guidelines.

Power

  1. RAWv1 consumes 20 uA at 3 volts, expected runtime is 4 years
  2. RAWv2 consumes 20 uA at 3 volts, expected runtime is 4 years
  3. RAWv2_slow consumes 14 uA at 3 volts, expected runtime is 6 years
  4. Power consumption is calculated at 3 V voltage, and life time is estimated at room temperature with a safety factor of 0.8

Version 1x

1.2.12, you can flash the full hex to your tag to restore the tag to original state.

  • Ruuvi firmware 1.2.12 is available in full at GitHub Releases

  • Espruino Javascript interpreter DFU packet can be downloaded from RuuviLab

  • Eddystone beacon format is available at GitHub Releases

You can fork the repository to make your own modifications both for personal and commercial use.