Introduction

This manual provides technical guidance for integrating the W-Modbus PRO module into your own product. The W-Modbus OEM module is a surface-mounted radio module that adds wireless Modbus RTU communication to a host product, replacing the Modbus control cable with a wireless mesh network.

The manual describes the module's features, specifications, pin assignments and mechanical dimensions, guidelines for hardware integration, PCB layout and antenna selection, the SPI and UART management interfaces, commissioning, firmware updates and regulatory compliance.

Product Overview

W-Modbus simplifies Modbus RTU installations by replacing the control cable with a wireless connection. This significantly reduces the downsides of running control cables, such as daisy-chaining, installation planning and troubleshooting.

The W-Modbus module is built on LumenRadio's MiraOS, which runs the MiraMesh network stack. MiraMesh is a self-stabilizing mesh network technology that uses patented technology to ensure highly reliable, long-range wireless communication in noisy environments. W-Modbus uses the international license-free ISM band at 2.4 GHz, the same band used by Wi-Fi and Bluetooth. Thanks to Cognitive Coexistence, LumenRadio's patented technology, the modules communicate reliably despite the noise generated by nearby devices.

A W-Modbus module can be configured either as a Gateway that is connected to a Modbus Client, or as a mesh node that is connected to one or more Modbus Servers. A W-Modbus network can consist of up to 100 mesh nodes.

W-Modbus OEM module system overview

Features

Key Specifications

See Specifications for the complete electrical and RF specifications.

Ordering Information

Product Packaging Order code
W-Modbus module Reel, 400 pcs 840-2111
W-Modbus PRO module Reel, 400 pcs 840-2115

The W-Modbus Development Kit is available for evaluation and prototyping.

Contact

For technical questions, see When to Contact Support.

Functional Description

The W-Modbus module is designed to be simple to use and requires little intervention from an external CPU. This section describes the RS485 interface, how a network of W-Modbus modules is commissioned and decommissioned, how the module detects connected Modbus devices, and what to consider about latency in the wireless mesh network.

The module is configured and monitored through the SPI or UART management interface. Both interfaces have the same capabilities.

RS485 Interface

The RS485 interface of the W-Modbus module consists of 4 digital signals: UART_TXD, UART_RXD, RS485_RE and RS485_DE. Use them to connect an RS485 driver. For the pins, see Pin Assignments, and for an example circuit, see RS485 Reference Design.

{{#warning}} Signals on the UART_RXD pin must not exceed VDD. For 5 V logic, use a level-shifting circuit, such as a resistor divider. {{/warning}}

RS485 Bus Configuration

The RS485 configuration can be written to a W-Modbus module regardless of its current app mode.

An RS485 configuration written to a W-Modbus gateway applies to the gateway itself, and also acts as the default for the W-Modbus nodes in the same network. The default can be overridden by writing an RS485 configuration to individual mesh nodes. Mesh nodes other than the one being written are not affected. This allows Modbus devices with different RS485 configurations to communicate in the same Modbus network.

{{#note}} RS485 configurations written to individual mesh nodes, called local configurations, are lost when the module restarts. The node then uses the default RS485 configuration from the gateway. {{/note}}

The RS485 configuration is set with RS485_CONFIG in the SPI or UART management interface.

Commissioning

Commission a W-Modbus system in the following steps:

  1. Put the W-Modbus module connected to the Modbus Client (Master) into Commissioning Gateway mode with APP_MODE in the SPI or UART management interface.
  2. Put the W-Modbus modules connected to the Modbus Server (Slave) devices into Commissioning Mesh mode with APP_MODE in the SPI or UART management interface.
  3. Modules in Commissioning Mesh mode join the gateway and receive network credentials. To find out when this has happened, read COMMISSIONING in the SPI or UART management interface. When COMMISSIONING is 1, the mesh node is ready. A mesh node usually takes about one minute to join the network, but it can take longer depending on the physical environment, such as walls and radio interference.
  4. Optional: configure the RS485 bus communication parameters with RS485_CONFIG in the SPI or UART management interface. An RS485 configuration written to the gateway is the default for all mesh nodes in the network. Mesh nodes with a locally set RS485 configuration ignore this default. An RS485 configuration written to a mesh node only affects that mesh node. The RS485 configuration can be written both during commissioning and in a secure network.
  5. Optional: when all mesh nodes are ready, as indicated by COMMISSIONING, validate the system by letting the Modbus Client poll the Modbus Server devices as if they were connected by a cable.
  6. Set the W-Modbus module connected to the Modbus Client to Secure Gateway mode with APP_MODE in the SPI or UART management interface.

When the gateway is set to Secure Gateway mode, it broadcasts a message to all mesh nodes in the network, instructing all modules to perform a synchronized restart after 10 seconds. After the restart, the gateway is in Secure Gateway mode, and all connected nodes are in Secure Mesh mode. The commissioning is now complete. After the synchronized restart, the mesh nodes search for the gateway again, and communicate securely using encryption until they are explicitly decommissioned.

Decommissioning

To decommission a single mesh node from a network, write 1 to DEVICE_RESET in the SPI or UART management interface. The module restarts automatically, and can then be commissioned again.

To decommission an entire mesh network at once, switch the Secure Gateway to any other app mode with APP_MODE in the SPI or UART management interface. The gateway broadcasts a message that instructs the connected nodes to decommission. As described in Commissioning, this broadcast makes the connected mesh nodes perform a synchronized restart 10 seconds after they receive it. After the synchronized restart, each connected mesh node is in Commissioning Mesh mode.

Detection of Connected Devices

After booting, a W-Modbus mesh node scans for connected devices on addresses 1 through 247. A W-Modbus mesh node in Solar mode scans addresses 1 through 255. Devices that respond are added to a list at the end of a scan cycle. A maximum of 16 devices is supported with the current firmware version.

Scanning repeats as long as the module has power, so devices are automatically added or removed depending on their connectivity. The first repeat is done after a minute. As long as the list of addresses is not empty and unchanged, the repeat interval is doubled until it reaches 16 minutes. If the list of addresses changes or is empty, the repeat interval is reset to 1 minute.

To scan for a Server (Slave) device, the W-Modbus module sends read commands on the RS485 bus, requesting the value of the holding register (function code 3) at register address 0. This command is repeated for all possible Modbus addresses. Any Modbus device of class 0 or higher is expected to respond to this read command, either with a register value or with a Modbus exception.

To find which devices the W-Modbus module has found so far, read SERVER_ADDRESSES in the SPI or UART management interface. SERVER_ADDRESSES is not updated until a full scan cycle is completed.

To bridge only specific addresses and stop scanning, write the addresses to SERVER_ADDRESSES. To start a new scan, use RESCAN in the SPI management interface or MODBUS_RESCAN in the UART management interface.

Networking and Latency

W-Modbus is based on MiraMesh. For information on how the networking stack works, see the MiraMesh documentation.

MiraMesh is designed for robustness and power efficiency in radio environments with a lot of interference. This can come at a cost to throughput and latency. While throughput limitations are usually negligible for Modbus, latency requirements can be an issue.

As a general rule, allow 50 ms of round-trip time (RTT) latency per network hop from the root node. For example, a node that is 3 hops away may add 150 ms of latency compared to a cabled solution. Consider this when you configure the timeout parameters of the Modbus Client (Master).

We recommend setting the communication timeout parameters of any Modbus Client (Master) to at least 1000 ms.

Specifications

This section lists the electrical and RF specifications of the W-Modbus PRO module.

Absolute Maximum Ratings

Symbol Parameter Min. Typ. Max. Unit
VDD Supply voltage -0.3 3.9 V
TA Operating temperature -40 +85 °C
VIO IO input voltage, VDD below 3.6 V VDD + 0.3 V
VIO IO input voltage, VDD above 3.6 V 3.9 V
VSS Ground pad voltage 0.0 V
TS Storage temperature -40 +125 °C
RFin RF input power +10 dBm
ESD ESD all pins, Human Body Model 1 kV

Recommended Operating Conditions

Symbol Parameter Min. Typ. Max. Unit
VDD Supply voltage 3.0 3.3 3.6 V
Vrise Supply rise time (0 V to 3.7 V) 60 ms
IDD Supply peak current capability 150 250 mA

See Power Supply Recommendations for guidelines on the power supply design.

Digital I/O Pins

Symbol Parameter Min. Typ. Max. Unit
VIL Input voltage logic low 0 0.3 × VDD V
VIH Input voltage logic high 0.7 × VDD VDD V
VOL Output voltage logic low 0 0.4 V
VOH Output voltage logic high VDD - 0.4 VDD V

RF Performance

Symbol Parameter Min. Typ. Max. Unit
frange Operating frequency range 2402 2480 MHz
RXsens Receiver sensitivity (0.1% BER) -94 dBm
TXpout TX output power 17.5 dBm

Pin Assignments

W-Modbus module pin assignments, seen from the top

The W-Modbus module seen from the top.

Pin Functions

Pin number Pin name Pin type Description nRF52840 pin name
P1 VSS Power Ground (0 V) GND
P2 MOSI Digital input SPI Master Out, Slave In P0.04/AIN
P3 N.C. No connection Do not connect P0.05/AIN
P4 N.C. No connection Do not connect P0.06
P5 N.C. No connection Do not connect P0.08
P6 MISO Digital output SPI Master In, Slave Out P1.08
P7 VSS Power Ground (0 V) GND
P8 UART_TXD Digital output RS485 TX P1.09
P9 VSS Power Ground (0 V) GND
P10 RS485_DE Digital output RS485 driver enable P0.12
P11 RS485_RE Digital output RS485 receiver enable P0.11
P12 nRESET Digital input Reset pin (active low, external pull-up) P0.18/nRESET
P13 N.C. No connection Do not connect P0.20
P14 N.C. No connection Do not connect P0.22
P15 UART_RXD Digital input RS485 RX P0.23
P16 SCK Digital input SPI clock P0.24
P17 N.C. No connection Do not connect P1.00
P18 N.C. No connection Do not connect P0.10/NFC
P19 N.C. No connection Do not connect P0.09/NFC
P20 SWDIO Digital input/output SWD interface data SWDIO
P21 SWDCLK Digital input SWD interface clock SWDCLK
P22 N.C. No connection Do not connect P1.02
P23 VSS Power Ground (0 V) GND
P24 VSS Power Ground (0 V) GND
P25 VSS Power Ground (0 V) GND
P26 VSS Power Ground (0 V) GND
P27 VSS Power Ground (0 V) GND
P281 IRQ Digital output SPI interrupt signal, active low P1.13
P291 N.C. No connection Do not connect P1.15
P301 N.C. No connection Do not connect P0.03/AIN
P311 N.C. No connection Do not connect P0.02/AIN
P321 BOOTLOADER Digital input Bootloader entry (active low, external pull-up) P0.28/AIN
P331 CS Digital output SPI chip select, active low P0.29/AIN
P341 UART_MGMT_TX Digital output UART management TX P0.30/AIN
P351 UART_MGMT_RX Digital input UART management RX P0.31/AIN
P36 VDD Power Power supply (3.3 V) 3V3
P37 VSS Power Ground (0 V) GND
P38 N.C. No connection Do not connect Vbus
P39 VSS Power Ground (0 V) GND
P40 N.C. No connection Do not connect USB_P
P41 N.C. No connection Do not connect USB_N

1 Low-frequency I/O (up to 10 kHz). For detailed information about the pin functionality, see the Nordic Semiconductor nRF52840 product specification.

RF Antenna Connector

To connect an external antenna, use the U.FL connector on the top of the module. The antenna must have a characteristic impedance of 50 ohm at 2.45 GHz. See the Antenna Guideline for more information.

Mechanical Specification

All dimensions are in millimeters.

Module Dimensions

W-Modbus module mechanical drawing

W-Modbus module dimensions

Mechanical design files in .stp and .dxf format are available for download, see Design Files.

Carrier Tape Dimensions

The modules are delivered on reels. The carrier tape has the following dimensions:

Carrier tape dimensions for the W-Modbus module reel

Reel Marking

Every reel has an identifier sticker, both on the reel and on the reel package.

W-Modbus module reel with identifier sticker

The identifier sticker contains the following information:

Information on the reel identifier sticker

Hardware Integration

This section describes how to integrate the W-Modbus module into a product.

Integration Overview

The block diagram below shows the components required to integrate the module. The module itself must be soldered onto a carrier board.

Block diagram of a W-Modbus module and its interfaces

To fully integrate the module into a product, the carrier board must provide the following interfaces:

A complete integration also requires:

Design Files

Electrical and mechanical design files, such as symbols, footprints, drawings and 3D models in .stp and .dxf format, are available for download on the W-Modbus OEM module support page.

Common Integration Mistakes

Integrating the W-Modbus module is a relatively simple process, but for optimal RF performance it is important to follow the Power Supply Recommendations and Layout Considerations. Otherwise, the RF performance may be poor. To avoid the most common mistakes:

Power Supply Recommendations

The W-Modbus module is designed for 3.3 V operation. Do not apply a voltage to any of the pins until the 3.3 V rail is connected.

To ensure reliable operation, decouple the supply pin with a 100 nF ceramic capacitor close to the pin. We also recommend adding a high-value ceramic bulk capacitor, such as 47 µF, to reduce the current ripple on the 3.3 V net.

Power supply decoupling for the W-Modbus module

During radio transmission, the current consumption rises sharply to 150 mA typical and 250 mA maximum. The typical slew rate during radio transmission is 300 A/s.

Symbol Parameter Min. Typ. Max. Unit
VDD Supply voltage 3.0 3.3 3.6 V
Vrise Supply rise time (0 V to 3.7 V) 60 ms
IDD Supply peak current capability 150 250 mA
IDD_rate Supply current slew rate 300 A/s

For an example circuit, see Power Supply Reference Design.

Layout Considerations

All dimensions are in millimeters unless otherwise specified. Symbols, footprints, drawings and 3D models are available for download, see Design Files.

Module Pad Positions

W-Modbus OEM module pad positions

All positions below are relative to the origin (0, 0) in the image above:

Recommended Footprint

Recommended PCB footprint for the W-Modbus module

Carrier Board Layout Guidelines

The W-Modbus module has been specifically designed to achieve optimal RF performance. To maintain this, follow these guidelines:

Routing keep-out area on the top layer under the W-Modbus module

The purple, diagonally striped area is the routing keep-out area for the top layer. Do not place tracks, vias or other copper shapes in this area.

Antenna Guideline

Antenna selection and design are crucial to achieve good RF performance in your product. Select an antenna with a narrow bandwidth for the 2.4 GHz ISM band (2.4–2.48 GHz) and minimum loss (typically expressed as the S11 parameter or VSWR). Mount the antenna according to the manufacturer's data sheet. Most antennas are not fully omnidirectional, so consider the radiation pattern of the antenna when you position it, so that it is most efficient in the desired directions.

The antenna may be terminated with a connector, usually of the TNC or SMA type. You then need a cable assembly like the one below to connect the antenna to the U.FL/I-PEX connector on the module.

U.FL to SMA antenna cable assembly

The other option is an antenna fitted with a cable assembly terminated with a U.FL/I-PEX connector that mates with the RF connector on the module.

Antenna Cable Handling

Not only the antenna is important, but also the RF path between the antenna and the module. The RF path must be a transmission line with an impedance of 50 ohm. Handle all cables and connectors that are part of the transmission line with care. Avoid twisting or bending the cable as far as possible.

Antenna cable handling

The U.FL/I-PEX connector on the module needs attention to mate properly. Make sure it snaps into place, but do not use force.

U.FL connector incorrectly mated

U.FL connector correctly mated

Antenna Placement

As a general rule, allow as much clearance and free space around the antenna as possible. Any object in the path of radiation interferes with the RF performance.

Antenna placement in a product enclosure

Mount a patch-type (stick-on) antenna on plastic of a well-defined thickness, preferably PC/ABS unless the manufacturer states otherwise. The typical recommended thickness is 1.5–2.0 mm; consult the manufacturer's data sheet. Keep the antenna clear of surrounding objects, especially ground planes and other metal objects. If possible, keep parallel surfaces free from metal objects. For example, if the PCB is right underneath the antenna surface, keep that area free from copper and components. At the very least, keep the minimum clearance distances shown below:

Minimum antenna clearance distances

Minimum antenna clearance to ground planes

Minimum antenna clearance to metal objects

Recommended Antennas

For the European market, make sure that the output power does not exceed 20 dBm, as required by European regulations. The W-Modbus module has been tested against FCC and IC regulatory requirements and is approved with the antennas below, or electrically equivalent antennas.

LumenRadio 2.15 dBi Dipole Omnidirectional Antenna

The LumenRadio 2.15 dBi dipole omnidirectional antenna delivers outstanding performance and orientation flexibility. The antenna can be tilted and swiveled, and has a rugged RP-TNC connector. Combined with the W-Modbus module, the total maximum radiated power is 21.65 dBm (146.2 mW).

Electrical specification Value
Frequency range 2400–2483.5 MHz
Gain 2.15 dBi
VSWR < 2
Nominal impedance 50 ohm
Polarization Vertical
Max power 25 W
Connector RP-TNC
Length 144 mm
Radome material TPEE
Radome color Black
LumenRadio order code 104-1001

LumenRadio 2.15 dBi dipole omnidirectional antenna

Molex 3.2 dBi Balanced Flex Antenna

The Molex 3.2 dBi balanced flex antenna is an adhesive, omnidirectional, flexible antenna. It has a 50 mm cable terminated with a U.FL/I-PEX MHF connector. Combined with the W-Modbus module, the total maximum radiated power is 22.7 dBm (186.2 mW).

Electrical specification Value
Frequency range 2400–2483.5 MHz
Gain 3.2 dBi
Return loss S11 < -10 dB
Nominal impedance 50 ohm
Polarization Linear
Connector U.FL/I-PEX MHF
Length 50 mm
Mounting style Adhesive
Packaging type PET film
Radome color Black
LumenRadio order code 104-1008

Molex 3.2 dBi balanced flex antenna

Microchip 0.56 dBi Whip Monopole Antenna

The 0.56 dBi whip antenna is a high-efficiency compact antenna with exceptional performance characteristics. Its small size (28.4 mm) makes it ideal for smaller products. Combined with the W-Modbus module, the total maximum radiated power is 20.06 dBm (101.4 mW).

Electrical specification Value
Frequency range 2400–2500 MHz
Gain 0.56 dBi
VSWR < 1.3
Nominal impedance 50 ohm
Connector RP-SMA male
Length 28.4 mm
Radome material TPEE
Radome color Black
LumenRadio order code 104-1034

Microchip 0.56 dBi whip monopole antenna

LumenRadio 5 dBi Outdoor Puck Antenna

The LumenRadio 5 dBi omnidirectional puck antenna is well suited for products in a metal enclosure. It has a 1 m RG-174 cable terminated with an RP-SMA male connector. Combined with the W-Modbus module, the total maximum radiated power is 24.5 dBm (281.8 mW).

Electrical specification Value
Frequency range 2400–2483.5 MHz
Gain 5 dBi
VSWR < 1.5
Nominal impedance 50 ohm
Polarization Vertical
Max power 25 W
Connector RP-SMA male
Cable length 1 m
Size Ø 45 × 25 mm
Radome material ABS
Radome color Black
LumenRadio order code 104-1033

LumenRadio 5 dBi outdoor puck antenna

Antennas Without FCC and IC Approval

{{#warning}} The following antennas have not been tested against FCC and IC regulatory requirements and are not approved for use with the W-Modbus module in the North American market. {{/warning}}

TE Connectivity 3.2 dBi Dipole Antenna

The TE Connectivity 3.2 dBi dipole antenna is a dome-type panel mount antenna that is available with different types of termination.

Electrical specification Value
Frequency range 2400–2483.5 MHz
Gain 3.2 dBi
VSWR < 1.9
Nominal impedance 50 ohm
Max power 5 W
Mounting type Panel mount
Radome color Black
LumenRadio order code 104-1027

TE Connectivity 3.2 dBi dipole antenna

TE Connectivity 2.1 dBi Monopole Antenna

The TE Connectivity 2.1 dBi monopole antenna is a dome-type panel mount antenna that is available with different types of termination.

Electrical specification Value
Frequency range 2400–2500 MHz
Gain 2.1 dBi
VSWR < 2.2
Nominal impedance 50 ohm
Max power 5 W
Mounting type Panel mount
Radome color Black
LumenRadio order code 104-1023

TE Connectivity 2.1 dBi monopole antenna

Reference Designs

This section provides example designs for the W-Modbus module. Schematic symbols, footprints and 3D models are available for download, see Design Files.

Power Supply Reference Design

The following design can be used as a reference for the power supply circuitry. A buck converter regulates the input voltage to 5 V, which is then converted to 3.3 V by an LDO. The 3.3 V supply (VCC) powers the W-Modbus module, while the 5 V rail can be used to power, for example, the RS485 driver circuit.

Power supply reference design for the W-Modbus module

RS485 Reference Design

This example shows an RS485 driver implementation. DE, TX, RX and RE are connected to the W-Modbus module as shown in the Module Connection Reference Design.

RS485 driver reference design for the W-Modbus module

{{#warning}} The voltage on RX must not exceed 3.3 V. The RS485 driver (U2) uses 5 V logic levels, and its RO pin (RX) is connected to the module (U1), which has CMOS-level I/Os. A level-shifting circuit, such as the resistor divider in the schematic, must be used. {{/warning}}

Module Connection Reference Design

This example shows how the W-Modbus module and its peripherals can be connected. See Pin Assignments for a description of the module pins.

Reference design for connecting the W-Modbus module and its peripherals

Reflow Soldering Specification

The W-Modbus module is a surface-mounted device (SMD) designed for easy integration into high-volume production lines, using reflow soldering onto a PCB. The customer is responsible for selecting a suitable solder paste and for ensuring that the reflow oven temperatures meet the requirements of the solder paste. The W-Modbus module complies with the J-STD-020D1 standard for reflow temperatures.

Reflow soldering profile for the W-Modbus module

{{#warning}} Temperatures must not exceed the minimums or maximums in the table below. {{/warning}}

Specification Value Unit
Temperature inc./dec. rate (max) 3 °C / sec
Temperature decrease rate (goal) 2–3 °C / sec
Soak temp increase rate (goal) 0.5–1.0 °C / sec
Flux soak period (min) 70 sec
Flux soak period (max) 120 sec
Flux soak temp (min) 150 °C
Flux soak temp (max) 190 °C
Time above liquidus (max) 70 sec
Time above liquidus (min) 50 sec
Time in target reflow range (goal) 30 sec
Time at absolute peak (max) 5 sec
Liquidus temperature (SAC305) 218 °C
Lower target reflow temperature 225 °C
Upper target reflow temperature 250 °C
Absolute peak temperature 260 °C

Verification and Testing

Design Verification

LumenRadio operates a full RF laboratory in Sweden and can offer design verification and testing services. Contact LumenRadio for advice.

Production Testing

All W-Modbus modules go through numerous production tests and quality checks before they are shipped. However, we advise you to include some level of testing in the overall test process of your product. LumenRadio is happy to advise on production testing; contact LumenRadio for advice.

Management Interfaces

The W-Modbus module is configured and monitored by the host product through one of two management interfaces:

Both interfaces have the same capabilities, so choose the one that suits your product best. Through either interface, the host product can, for example, set the app mode to commission the network, configure the RS485 bus parameters, read the network status and the detected Modbus devices, enable Bluetooth for the W-Modbus app, and put the module into bootloader mode for a firmware update.

Both interfaces are initialized 1500 ms after the W-Modbus module has started booting. Communicating with the module before that can give unexpected results.

SPI Interface

The Serial Peripheral Interface (SPI) allows communication with and configuration of the W-Modbus module.

The SPI is initialized 1500 ms after the W-Modbus module has started booting. Communicating with the module through the SPI before that can give unexpected results.

A reset of the SPI master, or interruptions on the chip select line, may cause the module to become unresponsive. The module recovers after 5 seconds, and any SPI transactions attempted during this time time out.

SPI Signals

The interface consists of five digital signals (VDD max):

See Pin Assignments for the pins.

Bit and Byte Order

The data on the SPI bus is clocked with the most significant bit first. All multi-byte register data is sent in big-endian byte order.

Clock Polarity

Data is valid on the low-to-high transition of SCK. In other words, the clock is active high, with valid data on the leading clock edge.

Maximum Clock Speed

The maximum clock speed supported by the W-Modbus module is 4 MHz. Clock speeds above this limit may result in unexpected behavior.

Setup Time

The SPI slave has a setup time of 4 μs after the high-to-low transition of the CS signal.

SPI Transactions

All SPI transactions start with a high-to-low transition on the CS pin. The CS pin must be held low during the entire SPI transaction.

The IRQ_FLAGS register is always shifted out as the first byte of each transaction.

Example SPI transaction

SPI Commands

All SPI command sequences, except for the NOP command, consist of two SPI transactions. The first transaction uses two bytes, which make up the command. The second transaction carries the payload, and must not be started until the W-Modbus module has acknowledged the command with a high-to-low transition on the IRQ pin. The first byte sent in the second transaction is ignored; we recommend sending 0xFF. The example below shows a full SPI command sequence.

Example SPI command sequence with a pending IRQ when the sequence started

The available SPI commands are listed in the table below. XX is any valid 1-byte register address, and -- are values that are ignored.

Command Hex value Description
READ_REG 0x00XX Read from a register.
WRITE_REG 0x01XX Write to a register.
NOP 0xFF-- No operation. Can be used as a shortcut to read the IRQ_FLAGS register. The last byte is not used.

SPI Interrupts

The IRQ pin indicates two things:

The IRQ pin always goes high (inactive) after a successful SPI command sequence.

The pin goes from high to low when interrupts are pending, or when the module is ready for the second transaction of an SPI command sequence.

SPI Register Map

The table below lists all registers available through the SPI. The first column is the single-byte address of each register. The second column contains the register and field names; the fields of a register are listed below it. The "Bit" column is the bit positions that the field occupies in the register. The "Type" column shows whether the field is read-only (R), write-only (W) or read-write (R/W).

The "Reset value" column is the default value of each field, in hexadecimal format: the value when the module is factory new, or after DEVICE_RESET has been set to 1. A reset value of - means either that the field is write-only, or that its value depends on circumstances. For example, the reset value of ANTENNA_SELECTOR depends on whether the module is an MWA-N2 or an MWA-N3 module, since only the MWA-N3 has an internal antenna.

Address Name Bit Type Reset value
0x00 STATUS
0x00 NETWORK_STATUS 0–6 R -
0x00 COMMISSIONING 7 R/W 0
0x01 MODE
0x01 APP_MODE 0–6 R/W 0
0x01 BOOTLOADER_ENABLED 7 W -
0x02 IRQ_MASK
0x02 NETWORK_STATUS_EN 0 R/W 1
0x02 PING_EN 1 R/W 1
0x02 RESERVED 2–7 R/W -
0x03 IRQ_FLAGS
0x03 NETWORK_STATUS 0 R 0
0x03 PING 1 R 1
0x03 RESERVED 2–6 -
0x03 TRANSACTION_ERROR 7 R 0
0x04 VERSION
0x04 FIRMWARE_VERSION_MAJOR 0–7 R -
0x04 FIRMWARE_VERSION_MINOR 8–15 R -
0x04 FIRMWARE_VERSION_PATCH 16–23 R -
0x06 RS485_CONFIG
0x06 BAUDRATE 0–23 R/W 0
0x06 PARITY 24 R/W 0
0x06 STOP_BITS 25 R/W 0
0x06 RESERVED 26–31 -
0x07 RESET
0x07 DEVICE_RESET 0 W -
0x07 NETWORK_RESET 1 W -
0x07 RESERVED 2–7 - -
0x10 MODBUS_STATUS
0x10 SERVER_ADDRESSES 0–127 R/W FF..FF
0x20 GENERAL_REQUESTS
0x20 ANTENNA_SELECTOR 0–1 R/W -
0x20 BLUETOOTH_ENABLED 2 R/W -
0x20 PROTOCOL_SELECTOR 3–4 R/W -
0x20 RESERVED 5–7 -
0x21 MODBUS_REQUESTS
0x21 RESCAN 0 R/W -
0x21 RESERVED 1–7 -
0x30 DEVICE_NAME
0x30 ASCII_CHARACTERS 0–160 R/W FF..FF
0x40 PING
0x40 PING_STATUS 0 R -
0x41 DIAGNOSTICS
0x41 DIAGNOSTICS_ADDRESS 0–7 R/W 0

STATUS Register (SPI)

This register contains information about the network status of the module.

NETWORK_STATUS (SPI)

This field is read-only and shows roughly how stable the connection to the network is.

To perform network operations successfully, such as changing the network baudrate or app mode, we recommend doing them when the value of NETWORK_STATUS is 1 or 2.

Modules in a gateway mode always have the value 1 in this field, since the link quality is measured relative to the gateway.

Value Meaning
0 Not connected to a network
1 Connected, good link
2 Connected, ok link
3 Connected, unreliable link

COMMISSIONING (SPI)

This field is read-write, and shows whether the module has received network commissioning data.

Setting this bit to 1 factory resets the module, which has exactly the same effect as setting DEVICE_RESET to 1. This reverts the COMMISSIONING field to 0. See DEVICE_RESET for more information about this behavior.

The table below shows the meaning of each value when read, and the number of restarts when the value is written:

Value Meaning (when read) Restarts (when written)
0 No commissioning data received yet 0
1 Valid commissioning data received 2

MODE Register (SPI)

This register contains information about the current state of the application.

APP_MODE (SPI)

This field is read-write and sets the app mode of the module. A factory-new module boots into mode 0 (None). The application detects this and switches to the default mode 4 (Commissioning Mesh Mode), which causes a restart. In other words, a factory-new module restarts once after booting. Writing 1 to DEVICE_RESET factory resets the module manually. Writing 0 or 4 to APP_MODE puts the module in Commissioning Mesh Mode.

Idle Mode prevents the module from performing any networking, and puts it in a kind of sleep. No configuration is erased when switching to this mode, so the module can be put back into a secure mode and connect to a previously saved network.

Commissioning and Decommissioning describe how the app modes are used.

The table below lists all app modes, and the number of restarts when switching to each mode:

Value Meaning Restarts (when written)
0 None (reverts to default) 2
1 Secure Gateway Mode 1
2 Commissioning Gateway Mode 1
3 Secure Mesh Mode 1
4 Commissioning Mesh Mode (default) 1
5 Idle Mode 1

BOOTLOADER_ENABLED (SPI)

This field is write-only. Set this bit to 1 to put the module in bootloader (DFU) mode for a firmware update.

Value Meaning Restarts (when written)
1 Enter bootloader (DFU) mode 1

IRQ_MASK Register (SPI)

This register enables and disables interrupts.

NETWORK_STATUS_EN (SPI)

This field is read-write, and enables or disables the network status interrupt.

Value Meaning
0 Disable network status IRQ
1 Enable network status IRQ

PING_EN (SPI)

This field is read-write, and enables or disables the ping interrupt.

Value Meaning
0 Disable ping IRQ
1 Enable ping IRQ

IRQ_FLAGS Register (SPI)

See SPI Interrupts for how these flags are signaled.

NETWORK_STATUS Interrupt Flag (SPI)

Set when the NETWORK_STATUS field has changed. Only valid for modules in Commissioning Mesh Mode (4) or Secure Mesh Mode (3), see APP_MODE.

The flag is cleared when the STATUS register, which includes the NETWORK_STATUS field, is read.

PING Interrupt Flag (SPI)

Set when the PING_STATUS field is set to 1. The flag is cleared when the PING register is read.

Clear the flag as soon as possible to avoid missing subsequent pings.

TRANSACTION_ERROR Interrupt Flag (SPI)

Always check this bit. A 1 in this bit means that the module cannot process the current transaction, and the full command sequence must be sent again.

VERSION Register (SPI)

This register is read-only, and contains the firmware version that the module runs.

FIRMWARE_VERSION (SPI)

This field contains three bytes: the major, minor and patch version of the firmware on the module. See Firmware Update for how to get and install the latest firmware.

RS485_CONFIG (SPI)

This register is read-write, and is used to read and configure the RS485 bus configuration: baudrate, parity and stop bits. The default is one stop bit and no parity.

BAUDRATE (SPI)

The standard baudrates 9600 bps, 19200 bps, 38400 bps and 76800 bps have been tested and verified. Higher values, such as 115200 bps, are allowed but have not been tested. The default baudrate is 0 bps.

PARITY (SPI)

The default parity is no parity.

Value Meaning
0 No parity
1 Even parity

STOP_BITS (SPI)

The default is one stop bit.

Value Meaning
0 One stop bit
1 Two stop bits

RESET Register (SPI)

This register is used to wipe configurations on the module.

DEVICE_RESET (SPI)

This field is write-only, and factory resets the module manually. A factory reset restores the module to the state it was in at its first boot by wiping all modified configurations. It wipes the network credentials and RS485 configurations, and reverts all registers and fields to their reset values (see SPI Register Map).

A device reset causes 2 restarts of the module. The first one happens after the configuration is wiped, which also sets APP_MODE to 0. After the first restart, the application detects that APP_MODE is 0 and switches to the default app mode, 4. This switch causes the second restart, after which the module is in Commissioning Mesh Mode. See APP_MODE for more about this behavior.

Value Meaning (when written) Restarts (when written)
1 Perform a factory reset 2

NETWORK_RESET (SPI)

This field is write-only. When set to 1, it wipes any saved network credentials. Other configurations, such as the RS485 bus parameters, are not affected.

In practice, this means that modules in Secure Mesh Mode or Commissioning Mesh Mode leave any network they have joined. For modules in a gateway mode, a network reset clears previously saved network credentials. Such credentials exist if the module was previously in a mesh mode and connected to a network, and was later switched to a gateway.

Value Meaning (when written) Restarts (when written)
1 Wipe network credentials 1 if in Secure Mesh Mode, 0 otherwise

MODBUS_STATUS Register (SPI)

This register is used to read Modbus-related data from the module.

SERVER_ADDRESSES (SPI)

This field contains the single-byte address of each set or detected Modbus device. A byte equal to 0xFF is an empty slot, with no address.

Writing any valid Modbus address to this register disables scanning and sets the addresses that the module bridges. Setting all addresses to 0xFF enables scanning again.

Value Meaning
0xFF No Modbus Server (Slave) set or detected
Anything else Address of a set or detected Modbus Server (Slave)

GENERAL_REQUESTS Register (SPI)

This register contains fields that perform various application-related actions.

ANTENNA_SELECTOR (SPI)

This field selects either the internal or the external antenna for wireless communication. Switching antenna is always followed by a restart.

{{#note}} MWA-N2 modules do not have an internal antenna, so never change this field on them. {{/note}}

Value Meaning Restarts (when switched to)
1 Internal antenna selected 1
2 External antenna selected 1

BLUETOOTH_ENABLED (SPI)

This field is read-write, and controls Bluetooth Low Energy (BLE) advertising for connections from the W-Modbus app. The module advertises for 3 minutes after Bluetooth is enabled. The W-Modbus app can be downloaded from the App Store and Google Play.

When the app is connected to a Secure Gateway with firmware version 3.1.0 or later, the app can update the firmware and show the network map. It also shows the installed firmware version.

The network map shows how many devices are in the network, and how their packets are routed through the mesh network. It also shows which Modbus addresses are connected to which W-Modbus module, and lets you name the W-Modbus modules.

The app can also connect to a mesh node, but then it only shows the firmware version.

Value Meaning (when written)
0 BLE advertising disabled
1 BLE advertising enabled

PROTOCOL_SELECTOR (SPI)

Reads or changes the active communication protocol.

Value Meaning
1 Modbus protocol is active
2 BACnet protocol is active

MODBUS_REQUESTS Register (SPI)

This register performs Modbus-specific actions.

RESCAN (SPI)

This field starts a manual rescan for connected Modbus Servers on the RS485 bus. After the command is sent, the W-Modbus module takes up to 90 seconds to scan all possible Modbus addresses. The contents of the SERVER_ADDRESSES field are invalid during the scan.

Value Meaning
1 Perform a rescan of Modbus devices

DEVICE_NAME Register (SPI)

This register is read-write, and is used to get or set the device name. The device name identifies the module in the W-Modbus app.

ASCII_CHARACTERS (SPI)

Each byte contains one printable ASCII character, up to a maximum of 20 bytes.

PING Register (SPI)

This register handles the device ping function.

Ping is a command that can be sent from the W-Modbus app to help locate a device. On the boxed W-Modbus products, for example, the LEDs flash.

When the OEM module is pinged, it sets the PING_STATUS field to 1. If the ping interrupt is enabled, an interrupt is raised when the module is pinged.

The ping status and the ping interrupt flag are cleared when the PING_STATUS field is read.

PING_STATUS (SPI)

This field is read-only, and contains the ping status of the module. When the module is pinged from the mobile app, the field is set to 1. Reading this field clears the status and the ping interrupt flag, if enabled.

DIAGNOSTICS Register (SPI)

This register configures diagnostics.

DIAGNOSTICS_ADDRESS (SPI)

This field is read-write and holds the single-byte address used for diagnostics requests. Any value between 1 and 255, or 0 to disable, is accepted. The value is kept across restarts, and reverts to 0 after a DEVICE_RESET.

If set to 0, the module does not respond to diagnostics requests.

SPI Usage Example

SPI Example Implementation

A reference implementation is available on LumenRadio's GitHub. It shows how to communicate with the module over SPI, and includes a set of tests to help verify your connection and the module's functionality.

The program is built on the Zephyr RTOS, which supports a wide range of boards. If your target board is not already supported, add a devicetree overlay file (.overlay) in the boards/ directory.

SPI Pseudocode Example

Below is a simple pseudocode example that reads the RS485 configuration through the SPI. The SPI is assumed to be initialized before this code runs.

/* Buffers must be large enough to hold the register and commands */
uint8_t rx_buffer[BUF_SZ];
uint8_t tx_command[2];

tx_command[0] = 0x00; // Read command
tx_command[1] = 0x06; // Address of RS485_CONFIG

/* Transfer the command bytes, read back the IRQ flags in the first byte */
spi_transfer(tx_command, 2, rx_buffer, 1);

/* Wait until the transfer completes */
WAIT_UNTIL(spi_transfer_complete());

/* Wait for the IRQ indicating that the response is ready */
WAIT_UNTIL(gpio_value(SPI_IRQ) == 0);

/* Read the value. RS485_CONFIG is 4 bytes long, plus one for the IRQ flags */
spi_transfer(tx_command, 2, rx_buffer, 4 + 1);

/* Wait until the transfer completes */
WAIT_UNTIL(spi_transfer_complete());

/* The IRQ flags are stored in rx_buffer[0] */

/* The baudrate is multi-byte, MSB first */
uint32_t baudrate = (rx_buffer[1] << 16) |
                    (rx_buffer[2] << 8) |
                    (rx_buffer[3] << 0);

/* Parity is a boolean value in bit 24, at position 0 in byte 4 */
uint8_t parity = (rx_buffer[4] & 0x01);

/* Stop bits is a boolean value in bit 25, at position 1 in byte 4 */
uint8_t stop_bits = (rx_buffer[4] & 0x02) >> 1;

UART Interface

{{#note}} The UART management interface is available from firmware version 3.2.0. To update modules with older firmware, see Firmware Update. {{/note}}

The UART management interface allows communication with and configuration of the W-Modbus module.

The UART interface is initialized 1500 ms after the W-Modbus module has started booting. Communicating with the module through the UART interface before that can give unexpected results.

The interface uses two digital signals (VDD max):

Connect the RX of the UART cable to the UART_MGMT_TX pin, and the TX of the cable to the UART_MGMT_RX pin. See Pin Assignments for the pins.

UART Configuration

The UART management interface uses the following communication parameters:

Baudrate Parity Stop bits
115200 None 1

UART Timing Requirements

Each UART frame must be separated by 100 ms of silence on the bus. Less than 100 ms between the end of one frame and the start of the next gives unexpected results.

UART Commands

UART commands and responses consist of ASCII characters. Send each command separately, following the timing requirements. There are two kinds of commands: read commands and write commands.

The UART usage example shows how the APP_MODE register is read.

UART Command Syntax

A UART command starts with the character r or w, for a read or a write command. The first character is followed by the separator : and a register name (see UART Registers). In write commands, the separator is used again to add write parameters. The command ends with a carriage return followed by a new line: \r\n.

The syntax also has the following properties:

Read Commands

Read commands have the following format, where REG_NAME is any readable register (see UART Registers):

r:REG_NAME\r\n

When a read command is successful, the response has the format below, where REG_NAME is the register and VALUE is the value read from the register:

ok:REG_NAME:VALUE\r\n

Some registers, like RS485_CONFIG, have more than one value, separated by ::

ok:REG_NAME:VALUE1:VALUE2:VALUE3\r\n

A register can also have no value, as with SERVER_ADDRESSES when no Modbus devices are detected:

ok:REG_NAME:\r\n

Write Commands

Write commands have the following format, where REG_NAME is any writable register (see UART Registers) and PARAM is any valid write parameter:

w:REG_NAME:PARAM\r\n

Some registers take more than one parameter:

w:REG_NAME:PARAM1:PARAM2\r\n

When a write command is successful, the response repeats the request exactly, but starts with ok instead of w. See the UART syntax examples.

Responses and Errors

Responses have almost the same format as reads and writes, but start with ok: when the command was successful, and with error: otherwise. An error message is returned when the command is invalid. For example, if the command does not end with \r\n, the response is an error.

UART Syntax Examples

/* Read examples */

/* The response 4 shows that the module is in Commissioning Mesh Mode */
>> r:APP_MODE\r\n
>> ok:APP_MODE:4\r\n

/* The values after the register name are baudrate = 9600,
   parity = even (E) and stop bits = 1 */
>> r:RS485_CONFIG\r\n
>> ok:RS485_CONFIG:9600:E:1\r\n

/* There is no register named 'APP' */
>> r:APP\r\n
>> error:UNKNOWN_REGISTER\r\n

/* The command must end with both carriage return '\r'
   and new line '\n' */
>> r:APP_MODE\n
>> error:INCORRECT_TERMINATION\r\n

/* Write examples */

/* The register is written successfully with the value 2 */
>> w:APP_MODE:2\r\n
>> ok:APP_MODE:2\r\n

/* The register is written with baudrate = 38400,
   parity = none (N) and stop bits = 2 */
>> w:RS485_CONFIG:38400:N:2\r\n
>> ok:RS485_CONFIG:38400:N:2\r\n

/* There is no register named 'APP' */
>> w:APP\r\n
>> error:UNKNOWN_REGISTER\r\n

UART Registers

The table below lists all registers available in the UART management interface. The "Type" column shows whether the register is read-only (R), write-only (W) or read-write (R/W).

The "Reset value" column is the default value of the register: the value when the module is factory new, or immediately after DEVICE_RESET has been set to 1. A reset value of - means either that the register is write-only, or that its value depends on circumstances. For example, the reset value of ANTENNA_SELECTOR depends on whether the module is an MWA-N2 or an MWA-N3 module, since only the MWA-N3 has an internal antenna.

Registers with several values, like RS485_CONFIG, show the reset value of each value, in the order they are read and written.

Register name Type Reset value
NETWORK_STATUS R -:-
APP_MODE R/W 4
BOOTLOADER_ENABLED W -
FIRMWARE_VERSION R -:-:-
RS485_CONFIG R/W 0:N:1
DEVICE_RESET W -
NETWORK_RESET W -
SERVER_ADDRESSES R/W -
ANTENNA_SELECTOR R/W -
BLUETOOTH_ENABLED R/W 0
PROTOCOL_SELECTOR R/W -
DEVICE_NAME R/W -
PING R -
DIAGNOSTICS_ADDRESS R/W 0
MODBUS_RESCAN W -

NETWORK_STATUS (UART)

This register is read-only and contains the network status of the module. It holds two values: the first shows whether the module has received network commissioning data, and the second shows roughly how stable the connection to the network is. To perform network operations reliably, such as changing the network baudrate or app mode, we recommend doing them when the value of NETWORK_STATUS is 1:1 or 1:2.

{{#note}} Modules in a gateway mode always have the value 1 in the LINK_QUALITY value, since the link quality is measured relative to the gateway. {{/note}}

/* The response when reading NETWORK_STATUS has this format: */
>> ok:NETWORK_STATUS:<COMMISSIONING>:<LINK_QUALITY>\r\n

/* An example with real values: */
>> r:NETWORK_STATUS\r\n
>> ok:NETWORK_STATUS:1:1\r\n

COMMISSIONING shows whether network credentials have been received, that is, whether the module has joined a network.

Value Meaning
0 No commissioning data received yet
1 Valid commissioning data has been received

LINK_QUALITY shows how stable the current network connection is.

Value Meaning
0 Not connected to a network
1 Connected, good link
2 Connected, ok link
3 Connected, unreliable link

APP_MODE (UART)

This register is read-write and sets the app mode of the module. A factory-new module boots into mode 0 (None). The application detects this and switches to the default mode 4 (Commissioning Mesh Mode), which causes a restart. In other words, a factory-new module restarts once after booting. Writing 1 to DEVICE_RESET factory resets the module manually. Writing 0 or 4 to APP_MODE puts the module in Commissioning Mesh Mode.

Idle Mode prevents the module from performing any networking, and puts it in a kind of sleep. No configuration is erased when switching to this mode, so the module can be put back into a secure mode and connect to a previously saved network.

Commissioning and Decommissioning describe how the app modes are used.

The table below lists all app modes, and the number of restarts when switching to each mode:

Value Meaning Restarts (when written)
0 None (reverts to default) 2
1 Secure Gateway Mode 1
2 Commissioning Gateway Mode 1
3 Secure Mesh Mode 1
4 Commissioning Mesh Mode (default) 1
5 Idle Mode 1

FIRMWARE_VERSION (UART)

This register is read-only and contains the firmware version that the module runs. The module responds with the major, minor and patch version in the following format:

>> r:FIRMWARE_VERSION\r\n
>> ok:FIRMWARE_VERSION:MAJOR:MINOR:PATCH\r\n

BOOTLOADER_ENABLED (UART)

This register is write-only and puts the module into bootloader (DFU) mode, so that the firmware can be updated.

Value Meaning Restarts (when written)
1 Enter bootloader (DFU) mode 1

RS485_CONFIG (UART)

This register is read-write, and is used to read and configure the following RS485 communication parameters, in the order in which they are read and written:

  1. Baudrate
  2. Parity
  3. Stop bits
/* Read example */
>> r:RS485_CONFIG\r\n
>> ok:RS485_CONFIG:9600:E:1\r\n

/* Write example */
>> w:RS485_CONFIG:9600:N:1\r\n
>> ok:RS485_CONFIG:9600:N:1\r\n

Baudrate: the standard baudrates 9600 bps, 19200 bps, 38400 bps, 57600 bps, 76800 bps and 115200 bps have been tested and verified. The default baudrate is 0 bps, which means that the module receives its RS485 configuration from the gateway once it has connected. We recommend setting RS485_CONFIG with the correct baudrate each time the module is powered on.

Parity: the default is no parity.

Value Meaning
N No parity
E Even parity

Stop bits: the default is one stop bit.

Value Meaning
1 One stop bit
2 Two stop bits

DEVICE_RESET (UART)

This register is write-only and factory resets the module. A factory reset restores the module to the state it was in at its first boot. Among other things, it wipes the network credentials and RS485 configurations, and resets all register values.

A device reset causes 2 restarts of the module. The first one happens after the configuration is wiped, which also sets APP_MODE to 0. After the first restart, the application detects that APP_MODE is 0 and switches to the default app mode, 4. This switch causes the second restart, after which the module is in Commissioning Mesh Mode. See APP_MODE for more about this behavior.

Value Meaning Restarts (when written)
1 Perform a factory reset 2

NETWORK_RESET (UART)

This register is write-only. When set to 1, it wipes any saved network credentials. Other configurations, such as the RS485 bus parameters, are not affected.

In practice, this means that modules in Secure Mesh Mode or Commissioning Mesh Mode leave any network they have joined. For modules in a gateway mode, a network reset clears previously saved network credentials. Such credentials exist if the module was previously in a mesh mode and connected to a network, and was later switched to a gateway.

Value Meaning Restarts
1 Wipe network credentials 1 if in Secure Mesh Mode, 0 otherwise

SERVER_ADDRESSES (UART)

This register contains the addresses of the set or detected devices as a list of decimal numbers separated by :.

If no devices are detected, reading the register gives no values:

>> r:SERVER_ADDRESSES\r\n
>> ok:SERVER_ADDRESSES:\r\n

With one device detected:

>> r:SERVER_ADDRESSES\r\n
>> ok:SERVER_ADDRESSES:128\r\n

With several devices detected, as is possible with the PRO versions of the module:

>> r:SERVER_ADDRESSES\r\n
>> ok:SERVER_ADDRESSES:32:125:126:127:128\r\n

Writing a list of one or more addresses to this register stops the scanning for new devices. The W-Modbus module then only bridges the written addresses. To start scanning again, write an empty list of Modbus addresses, or perform a Modbus rescan.

>> w:SERVER_ADDRESSES:1:17\r\n
>> ok:SERVER_ADDRESSES:1:17\r\n

>> w:SERVER_ADDRESSES\r\n
>> ok:SERVER_ADDRESSES\r\n

ANTENNA_SELECTOR (UART)

This register is read-write, and selects either the internal or the external antenna for wireless communication. Switching antenna always causes one restart.

{{#note}} MWA-N2 modules do not have an internal antenna, so never change this register on them. {{/note}}

Value Meaning Restarts (when changed)
1 Internal antenna selected 1
2 External antenna selected 1

BLUETOOTH_ENABLED (UART)

This register is read-write, and enables Bluetooth Low Energy (BLE) advertising for connections from the W-Modbus app. The module advertises for 3 minutes after Bluetooth is enabled, and then stops. The W-Modbus app can be downloaded from the App Store and Google Play.

When the app is connected to a module in Secure Gateway mode with firmware version 3.1.0 or later, the app can update the firmware and show the network map. It also shows the installed firmware version.

The network map shows how many devices are in the network, and how their packets are routed through the mesh network. It also shows which Modbus addresses have been detected by which W-Modbus module, and lets you name the W-Modbus modules.

The app can also connect to a module that is not a gateway, but then it only shows the firmware version and the number of connected Modbus devices.

Value Meaning
0 BLE advertising disabled
1 BLE advertising enabled

DEVICE_NAME (UART)

This register is read-write, and is used to get or set the device name. The device name identifies the module in the W-Modbus app. The maximum device name length is 20 bytes, where each byte contains one printable ASCII character.

PROTOCOL_SELECTOR (UART)

Reads or changes the active communication protocol.

Value Meaning
1 Modbus protocol is active
2 BACnet protocol is active

PING (UART)

This register is read-only and handles the device ping function.

Ping is a command that can be sent from the W-Modbus app to help locate a device. On the boxed W-Modbus products, for example, the LEDs flash.

When the OEM module is pinged, it sets the PING register to 1. The ping status is cleared when the PING register is read.

DIAGNOSTICS_ADDRESS (UART)

This register is read-write and holds the single-byte address used for diagnostics requests. Any decimal value between 1 and 255, or 0 to disable, is accepted. The value is kept across restarts, and reverts to 0 after a DEVICE_RESET.

If set to 0, the module does not respond to diagnostics requests.

MODBUS_RESCAN (UART)

Starts a rescan for connected Modbus Servers on the RS485 bus. After the command is sent, the W-Modbus module can take up to 90 seconds to scan all Modbus addresses. The contents of the SERVER_ADDRESSES register are invalid during the scan.

Value Meaning
1 Start the rescan

UART Usage Example

A simple way to get started is a USB-to-serial interface cable, such as the FTDI USB-RS232-WE-1800-BT_0.0. Wire the cable to the W-Modbus module (see Pin Assignments) and connect it to a computer. Open a serial terminal with the correct parameters, and start communicating with the module.

Below is a simple pseudocode example that reads the app mode. The UART is assumed to be initialized and configured correctly before this code runs.

/* The buffers must be large enough to hold the responses */
uint8_t rx_buffer[BUF_SZ];
uint8_t tx_command[BUF_SZ];

/* Prepare the command that reads the app mode */
size_t tx_len = strlen("r:APP_MODE\r\n");
memcpy(tx_command, "r:APP_MODE\r\n", tx_len);

/* Send the command bytes over UART */
uart_tx(tx_command, tx_len);

/* Receive the response over UART */
size_t rx_len = uart_rx(rx_buffer, BUF_SZ);

/* In Commissioning Mesh Mode, the response is "ok:APP_MODE:4\r\n" */

/* Check the first and last two bytes to confirm that a complete response was received */
if (rx_buffer[0] == 'o' && rx_buffer[1] == 'k' &&
    rx_buffer[rx_len - 2] == '\r' && rx_buffer[rx_len - 1] == '\n')
{
    int app_mode = rx_buffer[rx_len - 3] - '0'; // Extract the APP_MODE value
}

Development Kit

The W-Modbus Development Kit simplifies evaluation and prototyping with the W-Modbus module. The kit contains the parts needed to build a prototype and integrate the module into your product:

The W-Modbus development board has a W-Modbus module mounted, and is powered through USB or the pin headers. A development shield with an RS485 interface is included and can be attached to the pin headers. The shield also has headers for the SPI and UART management pins. The figure below shows the development board with the shield attached.

W-Modbus development board with the development shield attached

Development Kit Demonstration Video

The video "One-Hour Engineering Prototype Challenge" shows how a prototype can be built from scratch with the W-Modbus development kit.

Powering the Development Board

Power the development board with the included USB cable, connected to the J6 micro USB port labeled "USB IMCU". If the board does not power on, check that this port is selected with the power supply selector (S1).

The jumpers and switches are set at the factory and should not be changed. If the board malfunctions, remove the shield from the main board and check the jumpers and the DIP switch positions.

Switch S1 must be set to "USB IMCU", and the J1, J9 and J10 header pins must be connected with jumpers, as shown in the picture below. On J1, VDD and VDD MIRA must be connected. J9 and J10 are reserved.

Jumper positions on the W-Modbus development board

Development Shield

The shield has additional components to simplify getting started with the W-Modbus module, such as an RS485 interface (J3), SPI (J4) and UART management (J5). It also has a bootloader entry button, and LEDs that indicate power OK and traffic on the communication buses. The shield is powered by the development board.

Configure the module through the SPI or UART management interface.

W-Modbus development shield

Development Shield Pins

For the pins of the W-Modbus module, see Pin Assignments.

The relevant pins of the shield are listed below. The UART_TXD and UART_RXD pins are listed so that the RS485 IC can be bypassed.

Pin Name Pin type Description
J4.1 CS Digital output SPI chip select, active low
J4.3 MISO Digital output SPI Master In, Slave Out
J4.5 MOSI Digital input SPI Master Out, Slave In
J4.7 SCK Digital input SPI clock
J4.9 IRQ Digital output SPI interrupt signal, active low
J5.1 UART_MGMT_TXD Digital output UART management TXD
J5.3 UART_MGMT_RXD Digital input UART management RXD (3.3 V max)
J5.5 GND Power Signal ground
J5.7 3V3 Power 3.3 V supply output
J5.9 BOOTLOADER / push button Digital input Bootloader entry (3.3 V max, pulled up)
JP12.2 UART_TXD Digital output UART TXD
JP1.4 UART_RXD Digital input UART RXD (3.3 V max)
JP1.3 RS485_DE Digital output RS485 driver enable
JP1.3 RS485_RE Digital output RS485 receiver enable (active low)

Legacy Development Shield

Development kits shipped before 2025 have an earlier version of the shield, without some improvements such as indicator LEDs and a push button. The basic functions, such as RS485, SPI and UART management, are the same.

The LEDs, the three-position switch and the DIP switch on the legacy shield are not used by the W-Modbus module. Configure the module through the SPI or UART management interface.

Legacy W-Modbus development shield

The relevant pins of the legacy shield are listed below. The UART_TXD and UART_RXD pins are listed so that the RS485 IC can be bypassed.

Pin Name Pin type Description
J4.1 CS Digital output SPI chip select, active low
J4.3 MISO Digital output SPI Master In, Slave Out
J4.5 MOSI Digital input SPI Master Out, Slave In
J4.7 SCK Digital input SPI clock
J4.9 IRQ Digital output SPI interrupt signal, active low
JP12.2 UART_TXD Digital output UART TXD
JP1.4 UART_RXD Digital input UART RXD (3.3 V max)
JP12.5 UART_MGMT_TXD Digital output UART management TXD
JP12.8 UART_MGMT_RXD Digital input UART management RXD (3.3 V max)
JP10.3 BOOTLOADER / push button Digital input Bootloader entry (3.3 V max, pulled up)

Development Kit Antennas

The development kit includes 3 antennas of different size, form factor and performance for evaluation. For antennas approved for use in your product, see Recommended Antennas.

Compact Patch Antenna

The compact patch antenna is a flat, adhesive-mount patch antenna for ABS or PC plastic enclosures. It is an ultra-compact indoor antenna with an adhesive back for easy "peel and stick" mounting, designed to be mounted on the inside of an ABS/PC plastic enclosure with a thickness of 2 mm. Its performance is moderate compared to the other antennas, and the range is typically limited to 500 meters line of sight with the W-Modbus module.

Manufacturer product number Digi-Key order code
YF0027AA WM12218-ND
1461530100 (alternative) WM12218-ND

Quectel YF0027AA compact patch antenna

Molex 1461530100 compact patch antenna, alternative part

Dome Antenna for Outdoor Use

The dome antenna from Linx Technologies is suitable for relatively compact mounting in outdoor environments. Mount it on a grounded metal surface for optimal performance. With this antenna, the W-Modbus module reaches its full range of up to 1500 meters line of sight.

Manufacturer product number Digi-Key order code
ANT-DB1-WRT-MON-UFL ANT-DB1-WRT-MON-UFL-ND

Linx ANT-DB1-WRT-MON-UFL dome antenna

2.15 dBi Omni Antenna

The omnidirectional antenna from LumenRadio gives the best performance of the antennas in the development kit. It has an RP-TNC male connector, so it requires an I-PEX adapter cable. With this antenna, the W-Modbus module reaches its full range of up to 1500 meters line of sight.

LumenRadio order code Antenna cable order code
104-1001 102-2006

LumenRadio 2.15 dBi omnidirectional antenna

Firmware Update

The W-Modbus OEM module runs the same firmware as the other W-Modbus products. The latest firmware version is 4.3.1. The changes in each version are listed in the Release Notes.

The firmware version of a module can be read from FIRMWARE_VERSION in the SPI or UART management interface.

Firmware Update via the W-Modbus App

This method is available for modules with firmware version 3.1.0 or later.

The W-Modbus app is available for iOS and Android. When you start the app, it shows a scanning screen with the instruction "Set your device to app mode".

To connect the app to the module, enable Bluetooth on the module: set BLUETOOTH_ENABLED to 1 in the SPI or UART management interface. The app can then connect to the module for 3 minutes.

If a firmware update is available for the connected module, the app shows an option to start the update, and shows the progress in real time.

If you update a gateway, the update automatically propagates to all nodes in the network. This typically takes 30 minutes to 2 hours, but can take longer depending on the size of the network.

Switching Update Channel

To update to beta firmware, switch the update channel: while the app is starting, tap the LumenRadio logo 8 times and select Beta mode.

Firmware Update via nRF Connect

The firmware of the W-Modbus module can also be updated with Nordic Semiconductor's nRF Connect app, available for mobile and desktop.

To update the module, first put it in bootloader (DFU) mode in one of two ways:

In DFU mode, the module appears in the list of Bluetooth devices in nRF Connect. Connect to the module, and update it with the firmware zip file from the W-Modbus support page, which also has detailed instructions.

The module boots into application mode again if there has been no BLE activity for 2 minutes. A reset with the nRESET pin also boots the module into application mode immediately.

Known Compatibility Issues

Release Notes

4.3.1

Released on 2026-11-18.

Added

Changed

Fixed

Known Issues

4.3.0

Released on 2026-09-07.

Added

Changed

Fixed

Known issues

4.2.2

Released on 2026-05-28.

Added

Fixed

Known issues

4.2.1

Released on 2026-03-16.

Added

Changed

Fixed

Known issues

4.2.0

Internal release.

4.1.1

Released on 2025-12-16.

Fixed

Known issues

4.1.0

Released on 2025-11-07.

Added

Changed

Fixed

Known issues

4.0.0

Released on 2025-08-07.

Added

Changed

Fixed

Known issues

3.3.2

Released on 2025-04-25.

Added

Fixed

Known issues

3.3.1

Internal release, no changes to firmware.

3.3.0

Released on 2024-12-05.

Added

Changed

Fixed

Known issues

3.2.7

Released on 2024-10-01.

Added

Fixed

Known Issues

3.2.5

Released on 2024-05-24.

Fixed

3.2.4

Released on 2024-05-17.

Fixed

Known Issues

3.2.3

Released on 2024-04-30.

Fixed

3.2.0

Released on 2024-02-14.

Added

Changed

Fixed

3.1.1

Released on 2023-12-18.

Changed

Known Issues

3.1.0

Released on 2023-11-28.

Added

Fixed

3.0.0

Released on 2023-10-27.

Added

Changed

Fixed

2.2.3

Released on 2023-08-23.

Fixed

2.2.1

Released on 2023-04-27.

Added

Changed

2.2.0

Added

2.1.1

Released on 2022-09-20.

Changed

2.1.0

Released on 2022-06-01.

Added

2.0.1

Released on 2022-05-05.

Fixed

2.0.0

Released on 2022-04-25.

Added

1.2.0

Released on 2022-04-14.

Added

Fixed

1.1.2

Released on 2021-09-27.

Changed

Fixed

1.1.0

Released on 2021-06-29.

Added

1.0.2

Released on 2021-06-01.

Fixed

1.0.0

Released on 2021-04-09.

Added

Warranty and Support

This section provides information about the warranty and support options available for W-Modbus products. It includes details on the warranty coverage, how to obtain support, and contact information for customer service.

Warranty Terms

The length of the warranty is a negotiation question between distributor and LumenRadio. Each distributor has a different term. The warranty term is typically between 1-5 years from day of shipment, but you will need to check with your distributor to find out what applies to you.

The warranty or service agreement will be deemed void if:

  1. The product is repaired, modified, or changed, unless such repair, modification or change has been approved by LumenRadio AB; or
  2. The serial number on the product has been made illegible or is missing.

Return and complaint policy

The customer is required to examine the goods as soon as possible upon receipt. If there is reason to believe that a product defect may result in damage, a written complaint must be made immediately. LumenRadio's liability shall pertain solely to defects that the customer asserts in writing within 15 days after the defect is discovered or should have been discovered, and no later than within the period stated in the agreement with LumenRadio from the invoice date.

When to Contact Support

Contact support for your W-Modbus product when:

Who to contact

Contact your installer or distributor first for help with installation, wiring, power supply, or system configuration, and for suspected hardware faults or warranty questions.

Contact LumenRadio support for firmware errors or product issues that remain unresolved after troubleshooting or assistance from your installer or distributor.

How to submit a support ticket

Select Create Support Ticket in the manual's navigation, enter your contact details, a subject, and the information listed in [What to include in support request](#What to include in support request), then select Create Ticket. This opens the LumenRadio support portal in a new tab; complete and submit the request there, adding any relevant attachments.

If Create Support Ticket is unavailable or the new tab does not open, open the LumenRadio support portal directly and submit the same information. If you cannot access the portal, ask your installer or distributor to raise the request on your behalf.

What to include in support request

In order to get help as fast as possible, please include as much information about your case as possible, including

{{#NOTE}}The more information you can provide, the faster we can help you.{{/NOTE}}

RMA claims

You can find the warranty terms for LumenRadio products in the Warranty and Support section. If you have a claim that you believe is covered by the warranty, please submit an RMA claim via our {{action:open-rma:support system}}.

The RMA ticket must contain the serial number of the products, a clear description of the observed fault, and details of how the device has been installed.

Compliance Information

The available certifications for the W-Modbus module can be found on the W-Modbus support page.

FCC Information

FCC Information to User

This product does not contain any user-serviceable components and must only be used with approved antennas. Any product changes or modifications invalidate all applicable regulatory certifications and approvals.

FCC Guidelines for Human Exposure

This equipment complies with the FCC radiation exposure limits set forth for an uncontrolled environment. This equipment should be installed and operated with a minimum distance of 20 cm between the radiator and your body. This transmitter must not be co-located or operated in conjunction with any other antenna or transmitter.

FCC Declaration of Conformity

We, LumenRadio AB, Johan Willins gata 6, 416 64 Gothenburg, Sweden, declare under our sole responsibility that 840-2111 and 840-2115 W-Modbus comply with Part 15 of the FCC Rules. Operation is subject to the following two conditions:

  1. This device may not cause harmful interference.
  2. This device must accept any interference received, including interference that may cause undesired operation.

FCC Radio Frequency Interference Warnings and Instructions

This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment uses and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:

Modifications made to the product, unless expressly approved by LumenRadio AB, could void the user's right to operate the equipment.

Industry Canada Statement

This digital apparatus does not exceed the Class B limits for radio noise emissions from digital apparatus set out in the Radio Interference Regulations of the Canadian Department of Communications.

Le présent appareil numérique n'émet pas de bruits radioélectriques dépassant les limites applicables aux appareils numériques de la classe B prescrites dans le Règlement sur le brouillage radioélectrique édicté par le ministère des Communications du Canada.

CE Declaration

840-2111 and 840-2115 W-Modbus comply with the Essential Requirements of the RED (Radio Equipment Directive) of the European Union (2014/53/EU). W-Modbus meets the ETSI EN 300 328 V2.2.2 conformance standards for radio performance.

Compliance Marking

FCC and Industry Canada Marking

The W-Modbus module is FCC certified as a single-modular transmitter.

The W-Modbus module is an FCC-certified radio module that carries a "Modular" grant. W-Modbus radio modules comply with the "Intentional Radiator" portion (Part 15C) of the FCC certification: Part 15.247 transmitter tests.

An end product that incorporates a W-Modbus module does not require additional testing or authorization for the W-Modbus transmitter. Host end products can use the FCC ID of the certified module as the FCC ID of the host end product. A label displaying the FCC ID of the W-Modbus module must be affixed and visible on the host end product for approval.

FCC IDs are required for host end products with radio transmitters.

Other Compliance

As the product manufacturer, you are responsible for ensuring that all compliance testing required by other local regulations (CE, UL, CSA, SRRC, C-Tick and so on) is completed. LumenRadio is happy to advise on compliance testing; contact LumenRadio support for details.

Cybersecurity Compliance

Cybersecurity overview

The W-Modbus OEM module is a radio module that you integrate into your own host product. It runs the same firmware and the same MiraMesh wireless network stack as the other W-Modbus products, and has been designed with security in mind: wireless communication is encrypted, the module has no IP interface, it is configured only by the host product, and firmware updates are signed and verified on every device.

This section describes the security design of the W-Modbus module, how it relates to the cybersecurity requirements of the EU Radio Equipment Directive (RED), and what you, as the manufacturer of the host product, are responsible for.

Interfaces

The W-Modbus module has the following interfaces:

Interface Purpose Notes
RS485 (through an external RS485 driver) Connects the module to Modbus devices Serial only. No IP.
Management interface (SPI or UART) Lets the host product configure the wireless mesh network settings and monitor the module Wired, local interface to the host product only. No IP.
Wireless mesh (MiraMesh, 2.4 GHz) Carries Modbus traffic and firmware updates between W-Modbus devices AES-128 encrypted. IPv6 used internally within the mesh only.
Bluetooth Low Energy (BLE) Used by the W-Modbus mobile app for the network map and firmware updates, and by nRF Connect in bootloader mode Disabled by default. Enabled only by the host product, through the management interface or the BOOTLOADER pin. Times out automatically.

MiraMesh uses IPv6 addressing internally between W-Modbus devices. This IP layer stays inside the encrypted mesh. The W-Modbus module has no Ethernet, Wi-Fi or other interface to an external IP network, no border-router function, and no cloud or remote management interface. It cannot be addressed or reached from the internet, and no IP services are exposed to users, integrators or the host product.

Security features

Encrypted wireless communication

All data sent over the W-Modbus wireless network is encrypted with AES-128. Only devices that have the network credentials can join the mesh. A network communicates securely using encryption once the gateway has been set to Secure Gateway mode, as the last step of Commissioning.

No external IP connectivity

IPv6 is used only for internal addressing within the mesh. The W-Modbus module does not route traffic to or from an external IP network.

Configuration controlled by the host product

The wireless mesh network settings of the W-Modbus module, such as the app mode used for commissioning, the RS485 configuration, resets and Bluetooth, are configured over the SPI or UART pins of its management interface. This is a wired connection to the host product, and the host product decides when and how these settings are read and changed.

It is the OEM vendor's responsibility to design the host product with security in mind: expose only non-sensitive items remotely, and require physical access to the host product for writing parameters to the module. See Responsibilities of the host product manufacturer.

The module does not advertise over BLE by default. The host product makes the module connectable to the W-Modbus app by setting BLUETOOTH_ENABLED in the SPI or UART management interface. The module then advertises for 3 minutes. If no connection is made within that time, advertising stops.

The module only enters bootloader (DFU) mode when the host product sets BOOTLOADER_ENABLED, or drives the BOOTLOADER pin low during a reset. It returns to application mode after 2 minutes without BLE activity.

Secure firmware updates

Firmware updates are sent from the W-Modbus mobile app over BLE to a gateway module. The gateway then distributes the update to the nodes over the W-Modbus mesh network. This happens in the background while normal Modbus communication continues, so the network keeps working during the update. A module can also be updated with nRF Connect while it is in bootloader mode. See Firmware Update.

The update process protects firmware as follows:

Because an update can only start over BLE, and BLE and bootloader mode can only be enabled by the host product, firmware cannot be updated from the internet or over the Modbus interface.

Protection of sensitive data

Network keys and other credentials are not shared by default. When keys do need to be shared, for example when adding a device to an existing network, they are sent as encrypted blobs that only W-Modbus devices can decrypt. The mobile app and any intermediate device or connection only handle the encrypted blob, never the key in plain text. All other sensitive data, such as configuration, is also encrypted when sent wirelessly.

No remote management

The W-Modbus module cannot be configured, managed or updated from the internet or over the Modbus interface. Only the host product can configure it, through the SPI or UART management interface.

Read-only gateway diagnostics

When the host product sets a diagnostics address with DIAGNOSTICS_ADDRESS in the SPI or UART management interface, a module running in gateway mode answers diagnostics requests from the Modbus master with wireless diagnostic metrics, such as signal quality and network status. These registers are read-only: they cannot be written, and no configuration or control of the W-Modbus network is possible through them. The diagnostic registers contain only radio and network data and no personal data. Diagnostics are only available in gateway mode, and are disabled when DIAGNOSTICS_ADDRESS is 0.

EU Radio Equipment Directive – Article 3(3)(d), (e), (f)

Delegated Regulation (EU) 2022/30 applies cybersecurity requirements under RED Article 3(3)(d), (e) and (f) to certain radio equipment. The harmonized standards for these requirements are EN 18031-1, EN 18031-2 and EN 18031-3.

Requirement Applies to W-Modbus module
Art. 3(3)(d) – Network protection (EN 18031-1) Internet-connected radio equipment Not applicable. See below.
Art. 3(3)(e) – Personal data and privacy (EN 18031-2) Internet-connected equipment processing personal data, toys, childcare equipment, wearables Not applicable. The W-Modbus module does not process personal data.
Art. 3(3)(f) – Protection from fraud (EN 18031-3) Equipment that can transfer money or virtual currency Not applicable. The W-Modbus module has no financial functions.

Article 3(3)(d): the W-Modbus module has no interface to any external IP network and cannot communicate over the internet. IPv6 is used only for internal addressing within the encrypted MiraMesh network. Externally, the module carries Modbus frames over RS485 and is configured by the host product over SPI or UART. The module exposes no IP interface to the host product either, so it cannot connect to the internet in any form, even through the OEM's own product. If the host product has its own internet connection, the host product is the internet-facing equipment and is responsible for network protection on the IP side.

LumenRadio has therefore assessed the W-Modbus module as outside the scope of RED Article 3(3)(d). No Notified Body evaluation against EN 18031-1 is required. The W-Modbus module still includes security measures in line with the intent of EN 18031-1, including encrypted communication, host-controlled configuration, encrypted key sharing and signed firmware updates verified on every device, as described above.

Responsibilities of the host product manufacturer

The W-Modbus module is designed to be as secure as the wired Modbus network it replaces. The overall security of the end product and the installation also depends on the host product. As the manufacturer of the host product, you should:

Reporting security issues

To report a suspected security vulnerability in a LumenRadio product, submit a request through the LumenRadio support portal.

Please include the product name, firmware version and a description of the issue. Do not disclose the vulnerability publicly until LumenRadio has had the chance to investigate and respond.