From Domoticz
Jump to: navigation, search

The RFLink gateway allows Domoticz to talk to cheap 433Mhz devices.

It consists of a firmware you flash onto an Arduino Mega. It currently supports a growing number of 433Mhz protocols, but may not support as many yet as the RFXCom. It does have the advantage of not needing you to select which protocols you want it to be able to talk, it manages this by itself.

There are two versions: the USB version and a ethernet version.

Building and Installing

You have to build the gateway yourself using an Arduino Mega and a wireless receiver and a wireless transmitter. You can buy the Arduino Mega cheaply from China (5 dollars), or support the Arduino makers by buying an original. The wireless parts can also be bought cheaply online. You should be able to build the device for less than 15 euros.

The proces of flashing the software onto it is also explained on the RFLink website.

Connecting though USB

In Domoticz you can add the device under the hardware tab. Make sure to select the right serial port. The cheap Arduino Mega clones form China need extra USB-serial drivers. See RFLink Gateway USB

Connecting through MQTT Bridge

Another more 'universal' option is to connect your RFLink device to an ESP2866 board, a small microcomputer with WiFi support. You could then make the RFLink available to any smart device on your network that supports the MQTT protocol by installing special bridge software. As of this moment (march 2017), Domoticz has MQTT support in the beta. This is useful if you have multiple Domoticz servers, or other smart home software that can then interact with the RFLink.

Installing/Updating RFLink on a mac

The RFLink software is easiest to install on a windows machine. But you can also do it on a mac.

1. If you have a cheap Arduino clone from China with the CH340 chip, you will first need the new signed drivers for Mac OS. The new Mac OS Sierra is a bit more difficult about what drivers it allows to be installed. Download the PKG file here, open it, and follow the installation instructions. https://github.com/adrianmihalko/ch340g ... s-x-driver

2. Download the firmware zip form the RFLink website. Unpack it, and look for the hex file that is inside it. Then copy that to the exact same directory as your Arduino app. My advice: (temporarily) place both in a folder in your downloads directory. Navigate to that directory via the terminal app. If you don't know how to do this, look it up. (or just open Terminal and type "cd Downloads/name-of-the-folder-you-just-created")

3. Run this one long command from the folder where the Arduino app is also located. In the command below (which should all be typed on a single line), you may need to change the "RFLink.cpp.hex" filename to the name of the file that you have. You may also need to change the "/dev/cu.wchusbserial1421" bit to whatever the Arduino app shows you as the USB serial port under its tools menu.

Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -v -p atmega2560 -c stk500 -P /dev/cu.wchusbserial1421 -b 115200 -D -U flash:w:RFLink.cpp.hex:i -C Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf

4. You are done. You can now move the Arduino app to your apps folder, or delete it, whatever you want. You also don't need the hex file anymore.