RFI RS485 User manual

Author
Ivo van Ling
Hardware Release
1.0
Quick Install Guide Version
QIG_RS485_RPSW_v1.00.docx
Date
1-07-2020
Covering Product code
RE.11.R485
RS485 Remote Power Switch
Device for remotely controlling
industrial and home appliances
over RS485 networks
Quick Installation Guide

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 1(12)
1 Table of Contents
2 REVISION HISTORY .................................................................................... 2
3 INTRODUCTION .......................................................................................... 3
3.1 CHECK YOUR PACKAGE CONTENTS .....................................................................3
4 CONNECTING THE RS485 RPSW TO YOUR U-ROUTER NGW......................... 4
4.1 LED INDICATORS ON THE RPSW ......................................................................5
4.2 LAST RELAY POSITION IS SAVED IN THE EEPROM...................................................5
5 CONFIGURATION OF THE RPSW.................................................................. 5
5.1 MICRO-USB INTERFACE ................................................................................5
5.2 COMMAND LINE INTERFACE (CLI) .....................................................................5
5.2.1 Logging in over CLI............................................................................5
5.2.2 Getting help on CLI commands ...........................................................5
6 MESSAGING PROTOCOL OVER THE RS485 NETWORK.................................. 6
6.1 RIOT PROTOCOL .........................................................................................6
6.2 MODBUS PROTOCOL ......................................................................................6
6.3 WHY IS THERE A NEED FOR THE RIOT PROTOCOL? ..................................................6
6.4 RIOT MESSAGE FORMAT.................................................................................7
6.5 RIOT PAYLOAD FIELD ....................................................................................8
6.6 RELAY TOGGLE VIA RIOT RS485 MESSAGE .........................................................9
6.7 RELAY STATE MESSAGES VIA RIOT RS485 MESSAGE..............................................9
7 TROUBLESHOOTING...................................................................................10
7.1 EXAMPLE OF A RIOT RELAY STATUS MESSAGE .................................................... 10
7.2 RESET TO FACTORY DEFAULTS ........................................................................ 11
8 RPSW FIRMWARE UPGRADE ......................................................................11
8.1 USING DFU-UTIL COMMAND LINE TOOL ON MACOS................................................ 11
Disclaimer
The specifications and information regarding the products in this manual are subject to change
without notice. All statements, information, and recommendations in this manual are believed to be
accurate but are presented without warranty of any kind, express or implied. Users must take full
responsibility for their application of any products.
Notwithstanding any other warranty herein, all document files and software are provided “as is” with
all faults. RFI Engineering B.V. disclaims all warranties, expressed or implied, including, without
limitation, those of merchantability, fitness for a particular purpose and noninfringement or arising
from a course of dealing, usage, or trade practice.
In no event shall RFI Engineering B.V. or its suppliers be liable for any indirect, special,
consequential, or incidental damages, including, without limitation, lost profits or loss or damage to
data arising out of the use or inability to use this manual, even if RFI Engineering B.V. or its suppliers
have been advised of the possibility of such damages.

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 2(12)
2 Revision History
Revision
Reason
Author
Date
1.0
First version for RPSW software release 0.04, and
hardware release 1.0
IvL
25 May 2020

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 3(12)
3 Introduction
The RS485 Remote Power Switch (RE.11.R485) is a device for remotely controlling industrial and
home appliances over an RS485 network. The unit features one IEC-C14 input connector, and one
IEC-C13 output connector so that it easily fits into any environment. Furthermore, it supports two
RJ11 connectors to create a loop through RS485 network.
Applications include the remote control of heating in vacation homes, lighting, engine pre-heaters,
aviation engine heaters, irrigation systems, water well pumps, pumping stations, cabin heaters,
resetting remote servers, enabling and disabling security systems, access control of gates and
garage doors. Communication to the RE.11.R485 is done using the integrated loop through RS485
bus. If you connect the device to our U-router NGW there is even nothing to configure. Using our
advanced RS485 serial protocol, called RIOT, the device announces itself over the RS485 bus to the
U-router NGW and is immediately ready for use.
This document provides information on the following topics:
• Connecting the RS485 Remote Power Switch to the U-router NGW.
• Operating the RS485 Remote Power Switch.
• RIOT RS485 protocol description
• Firmware update.
3.1 Check Your Package Contents
These are the items included with your RS485 Remote Power Switch purchase:
RS485 Power Switch
Power Cord with C13 – C14
connectors
RJ11 – RJ11
extension cord

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 4(12)
4 Connecting the RS485 RPSW to your U-router NGW
The RS485 Remote Power Switch (RPSW) communicates its internal state and can be operated by
sending and receiving commands over an RS485 network. The RS485 network consists of multiple
nodes connected in parallel to a bus. In case of the RPSW, the RS485 network is formed by
connecting multiple RPSWs together using the supplied RJ11-RJ11 extension cords.
The RS485 RPSW is meant to be connected to and operated from RFI Engineering’s’ U-router NGW.
Although the RPSW can be operated from third party routers using the Modbus protocol, this manual
focuses on how to connect the RPSW to the U-router NGW.
Below is a schematic diagram connecting multiple RPSW’s to a U-router NGW. The RPSW’s can be
daisy chained together using the loop-through RS485 interface connectors (RJ11).
A maximum of 32 RS485 devices, like the RPSW, can be connected to the RS485 bus of the U-router
NGW.
When connected to a U-router NGW the remote power switches will be found automatically. Each
switch is identified by its RIOT address. In the user interface of the U-router the relays show up on
the ‘Relays’ page. Below is an example of the WEB interface of a U-router NGW showing multiple
connected RPSW’s.
Each relay can be given a meaningful description. For example, which device it operates. The
description is stored on the RPSW itself.

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 5(12)
4.1 LED indicators on the RPSW
During normal operation the blue LED on the RPSW flashes every two seconds. This indicates that
the software is running normally. When the relay is OFF, the green LED is off. When the relay is in
the ON position the green LED will be on.
4.2 Last relay position is saved in the EEPROM
The last relay position is always saved to the EEPROM of the RPSW and periodically broadcast over
the RS485 network. This is done to ensure that the relay will not accidentally be triggered when
other components of the RS485 network are unplugged or rebooted. For example; if you reboot the
U-router NGW you don’t want your RPSW to momentarily be switched off during reboot, thereby
causing a service disruption. Also, in case of power loss, the RPSW relay will return in the original
position when power is restored. So, when the RPSW was switched off before the power loss, it will
be restarted in the off position when the power is restored.
5 Configuration of the RPSW
Configuration of the RS485 RPSW is done over the USB interface. The USB interface is accessible
on the micro-USB connector on the side of the unit.
5.1 Micro-USB Interface
The micro-USB connector on the RPSW acts as a virtual serial port when connected to a laptop or
PC. When the unit is in normal operating mode, it can be connected to a PC using a standard micro-
USB cable. The port then enumerates as a standard serial port on the PC. You will have to use a
terminal emulator (for example putty on Windows) to configure the RPSW using simple command
line interface (CLI) commands.
5.2 Command Line Interface (CLI)
The RPSW supports a Command Line Interface (CLI) to configure the unit. During normal operation
there is no need to configure the unit. The CLI interface is only available to supply an advanced
configuration to the unit. For example, in case you need to switch the communication protocol, or
set the RS485 communication speed.
The CLI can also be used to troubleshoot the RPSW. This troubleshooting might be useful for the
initial setup of the RPSW. One example is the logging function, which will show you what packets
the RPSW is sending and receiving.
CLI commands are entered on a single line and can have multiple options. Pressing [ENTER] will
execute the command.
5.2.1 Logging in over CLI
When connected to the serial interface on the RPSW pressing [ENTER] a couple of times gives you
a login prompt. For example:
Password: Permission denied, please try again.
Password: Permission denied, please try again.
Password: Permission denied, please try again.
Password:
Enter your password, followed by [ENTER] to log in. The default password is; rfi123
Password: rfi123
Logged in
CMD >
Once logged in you should see the command prompt: CMD >
5.2.2 Getting help on CLI commands
The CLI has a help function that is accessed using ?or help. For example:

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 6(12)
CMD > help
*** RFI Engineering B.V. RS485 Remote Power Switch ***
Version [0.04] Compiled [May 13 2020 13:35:57]
The parameters of the RS485 RPSW
get state, see all settings and state
set logging <on>/<off>
set relay <on>/<off>
set label <text>
set password <password>, password can be 3 to 30 characters
reset factory, to reset the unit to factory defaults and then reboot
reboot, to reboot the unit
exit, to log out
OK
CMD >
6 Messaging protocol over the RS485 network
The RPSW can connect to a local RS485 network using either the RFI IOT protocol (RIOT) or the
Modbus protocol. The default communication protocol is RIOT.
6.1 RIOT Protocol
RIOT is an RS485 protocol between multiple hosts whereby each host is equal, that is to say; there
is no concept of a host (master) and devices (slaves). The protocol uses RS485 transmission sensing
(Listen before Talk) to defer transmissions until no other hosts are transmitting. This is used in
combination with collision detection in which a transmitting host detects collisions by sensing
transmissions from other hosts while it is transmitting a message. Each host is terminating
transmission as soon as a collision is detected, thus shortening the time required before a retry can
be attempted. When a collision is detected each host waits for a random period of time before re-
sending the message.
6.2 Modbus protocol
Modbus is a protocol between a host (master) and devices (slaves) to access the configuration of
the devices and to read the position of the relay. Modbus messages correspond to relatively simple
operations to read and write 16-bit words and binary registers (often called "coils"). The host
systematically initiates the exchange and the "slave" device answers. The slave doesn't send any
message before the host requests it.
6.3 Why is there a need for the RIOT protocol?
Modbus is a commonly used standard in industrial automation, and for good reason. It is simple,
easy to implement, and reliable. Modbus is also the first widely used fieldbus standard.
If Mobus is so commonly used, why would there be a need for another protocol? In the RPSW
network topology we wanted the RPSW to be automatically found and configured on the network.
Furthermore, in the network topology it must be possible to have multiple ‘master’ like devices, for
example two U-router NGW. Each capable of operating the same Remote Power Switch.
Both requirements are not supported in the Modbus standard. For the auto configuration to work we
had to expand the addressing space from a mere 255 devices to 16 million devices. We also had to
allow for symmetrical communication capabilities, i.e. no master/slave configuration. Therefore, we
came up with the RFI Engineering’s IOT protocol, or RIOT.
When an RPSW leaves the factory the default communication mode is set to RIOT. This choice was
prompted by the need to have a zero-configuration deployment and the need to have multiple hosts
on the RS485 bus that communicate with each other. These two requirements make the Modbus
RTU protocol unsuitable for our purpose because Modbus must have a master device configuration
and can only address slaves numbered 1 to 255. In which case each slave needs to be pre-configured
with a slave address prior to deployment.
Using the RIOT protocol, you can address more than 16 million devices. Each RIOT capable device
has a unique Device ID, similar to a MAC address. In fact the Device ID numbering comes out of the
OUI range allocated to RFI Engineering BV (40:28:14:00:00:00 - 40:28:14:FF:FF:FF). Both the
serial number as well as the device address are printed on the bottom of the unit.

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 7(12)
6.4 RIOT message format
Using RIOT each device communicating (transferring data) on the RS485 network is given a unique
address. All RIOT messages are ASCII messages that consists of two start characters, “R0”, a
destination address, source address, message length, message payload and the end of the message
is defined by a carriage return and line feed. This enables the space between the messages to be
variable and make RIOT ASCII messages suitable for transmission through certain modems.
Using RIOT, any device can send out a message, thus all can act as a master. An ASCII RIOT
message can be a maximum of 256 characters, including the start “R0” and the terminating carriage
return and line feed.
A typical RIOT message frame is shown below:
Start
Destination
Address
Source
Address
Length
Payload
CRC-16
END
R0
6 ASCII
chars
6 ASCII
chars
2 ASCII
chars
0-234 ASCII
Chars
4 ASCII
Chars
CR/LF
The CRC-16 is calculated over the whole message, excluding the ending Carriage Return/Line Feed
and the 4 bytes CRC itself. The CRC calculation is done similar to the Modbus RTU CRC-16 method.
When the RIOT source address is set to 000000 it is considered to be sending a broadcast message.
In that case every node on the network is allowed to answer the message. The broadcast message
is used for example in the auto discovery of the RPSW on the RS485 network.

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 8(12)
6.5 RIOT payload field
The Payload field can contain arbitrary ASCII data, but for an RFI manufactured relay (RPSW) there
is currently one message type called R0 defined in the payload field.
As a relay host (hardware device and/or printed circuit board containing relays) may have multiple
physical relays but only one RS485 interface per device/box you can address multiple relays in the
RIOT R0 payload field messages. Furthermore, future relay devices might have extended command
sets, so the relay R0 messages contain a version number to indicate what sub-commands are
supported.
A relay R0 message always has the same format. It starts with R0 followed by the relay number,
then a sub-command indicator instructing the relay what to do and then 1 or more ASCII
characters to convey the contents of the sub command.
R0 relay message fields:
Start
Version
Relay Number
Sub-command
Indicator
Data
1 ASCII char
1 ASCII char
1 ASCII char
1 ASCII char
1..230 ASCII chars
R
0
0..9
a..z
A..Z
S, L, C, V, P,
v, t, T, C
A typical R0 relay message looks like:
The R0 relay message contains a sub-command indicator field instructing the relay what to do. For
example, when the sub-command indicator ‘S’ is used, it instructs the RPSW to operate the relay.
The following table lists the available sub-commands for the R0 relay messages:
RIOT R0 sub-command Type
Sub-
command
Indicator
Comments
State
S
State can be ‘0’ or ‘1’ meaning off when
signaling 0 and on when signaling 1
Label
L
Set a text label. The label can be 100 ASCII
characters long. For example: Point of Sale (POS)
installation
Current
C
Current is reported in ASCII including the unit
of measure. For example, 6.2A
Voltage
V
Voltage is reported in ASCII including the unit
of measure. For example, 220VAC
Power
P
Power is reported in ASCII including the unit of
measure. For example, 1364Watt
Software version
v
Software version in ASCII, maximum of 100
characters
Temperature
t
Temperature is reported in ASCII including the
unit of measure. For example, 29.3Celsius
Product Type
T
Maximum of 100 ASCII characters, for example:
RS485 Remote Power Switch

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 9(12)
Text Command
C
Send a text command to the RSWP as if it was
typed from the USB (CLI) interface.
Request ALL information
?
When used the RPSW responds by sending the Relay
State, Relay Label, Relay Software Version and
Relay Type
For further reading please refer to the RIOT protocol technical documentation.
6.6 Relay Toggle via RIOT RS485 message
You can toggle the relay to the off or on position by sending 0 or 1 as payload in the RS485 RIOT
message. Sending 0turns the relay off. Sending 1turns the relay on.
In order to toggle RPSW from the off position to the on position you send it the R0 relay message.
Since the RPSW only contains one relay the R0 message looks like:
R00S1
This instructs relay 0 on the RPSW to turn on.
Suppose the R0 command above needs to be send to the RPSW with RIOT address fa0004 from a
U-router NGW with RIOT address 02efcf. Then the corresponding RIOT message would be:
6.7 Relay State Messages via RIOT RS485 message
The RPSW sends the relay state every 30 seconds over the RS485 interface. The interval is
controlled by the ‘interval’ setting in the RPSW, the default setting is 30 seconds.
The RPSW reports the state of the relays as follows:
0 indicates relay off,
1 indicates relay on.
The interval between sending the state messages can be set between 30 seconds and 3600
seconds (1 hour). Use the command set interval <seconds>, where seconds can be 30 – 3600
to set the interval. For example:
CMD > set interval 60
Setting interval to 60 seconds
OK

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 10(12)
7 Troubleshooting
The RPSW contains a logging function that shows exactly what the RPSW is doing. This function can
be accessed on the CLI. In order to switch the logging function on you issue the following command:
set logging on [ENTER]
For example:
CMD > set logging on
Setting RS485 message logging on
OK
CMD >
From then on, the RPSW provides logging information on the CLI interface. The setting is preserved
through reboots and power cycles. So, in order to stop the logging function, you will have to give
the command: set logging off [ENTER]
For example:
CMD > set logging off
Setting RS485 message logging off
OK
CMD >
7.1 Example of a RIOT Relay Status Message
When the RPSW is switched on it starts sending relay status messages on the RS485 network every
30 seconds. This is also the message by which the RPSW is detected on the network.
The following log shows a Relay Status Message:
CMD > Sending RS485 relay state message
|-> RawMsg: [R0000000af000119R00S06eac]
'-> Status: message sent OK
Received an RS485 message
'-> RawMsg: [R0000000af000119R00S06eac]
Decoding RIOT message
|-> Received a message from mac [af0001]
|-> Received a message for mac [000000]
'-> This message is from us
You can check the status of the RPSW by giving the get state command.
CMD > get state
Serial number : [RE.11.R485.000001]
Device ID (devid): [402814af0001]
Device Label : [Development version, via JTAG]
RPSW state
Logging is : [on]
Relay state is : [off]
Relay interval : [30 seconds]
RIOT msg sent : [25877]
RIOT msg received: [108338]
RIOT CRC errors : [1]
RIOT collisions : [2]
OK
CMD >
In the example above, you can see that the RPSW connected to the RS485 network, it received
108338 messages and encountered 2 collisions and 1 CRC error.

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 11(12)
7.2 Reset to factory defaults
You can reset the RPSW to factory default settings by giving the command: reset factory. This
command resets all keys and counters to zero. It also resets the device label to the factory default
setting, i.e. the value it is indicated on the bottom of the unit.
8 RPSW firmware upgrade
The firmware of the RPSW can be updated using the USB port. You have to put the unit in Device
Firmware Upgrade (DFU) mode in order to flash the device with new firmware.
To put the RPSW in DFU mode disconnect the unit from the mains power. The RPSW contains a Hall
sensor above the micro-USB connector. Holding a magnet close to the Hall sensor and then switching
the unit back on, will switch the RPSW into programming (DFU) mode. No LEDs on the side of the
unit are lit, and the unit is now in DFU mode. You can remove the magnet and the RPSW will stay
in DFU mode until the power is disconnected. Using a micro-USB cable connect the RPSW to the PC
or laptop from which you are going to perform the firmware update.
Using DFU utils (available for Windows, MAC OS and Linux) you can flash new firmware into the
unit. New firmware releases can be found on www.rfi-engineering.com.
8.1 Using dfu-util command line tool on MacOS
Dfu-util is a host side implementation of the DFU 1.0 and DFU1.1 specification from the USB forum.
Pre-compiled binaries can be found here: http://dfu-util.sourceforge.net
As an example, the following is a successful firmware upgrade from the command line on a
MacBook using MacOS:
dfu-util -a 0 -s 0x08000000:leave -D RS485_RPSW_01-v0.04.bin
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0

The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
QIG_RS485_RPSW_v1.00.docx Page: 12(12)
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
dfu-util: Non-valid multiplier ' ', assuming bytes
Downloading to address = 0x08000000, size = 56656
Download [=========================] 100% 56656 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
After the upgrade the RPSW will reboot and leave DFU mode. Normal operation is indicated by the
flashing blue LED.
Table of contents
Other RFI Switch manuals
Popular Switch manuals by other brands

Moxa Technologies
Moxa Technologies ToughNet TN-5524-8PoE Hardware installation guide

Sentera Controls
Sentera Controls DTMF Mounting and operating instructions

WOODLAND SCENICS
WOODLAND SCENICS JP5702 manual

Crestron
Crestron QM-WMC Operations & installation guide

StarTech.com
StarTech.com 35BAYFWUSB Instruction guide

COMSOL
COMSOL HD5014K user manual