RLY-8 Relay Controller, initial bringup
Table of Contents
I added a RLY-8 to my home lab. It has 8 controllable relays and can be talked to via network.
These are my notes on initial bringup.
Since I found no German distributor that had it in stock, I ordered directly at DFRobot.
Note that the relays can control a lot more than the 12V ±2A DC that my ODROID-HC2 CFeph cluster nodes use.
Why?
My ODROID Ceph nodes do not always initialise network and/or SATA correctly on warm boot. See here for details.
Physically unplugging is both annoying and needs me to be in the computer room. I find it much nicer to be able to control power to cluster nodes over the network.
The control unit should, of course, only cost a fraction of the price of a cluster node. As such no enterprise grade solutions were realistic, even at second hand prices.
I also did not find enough spare time to build one of these from scratch, so I was very happy when I heard about the RLY-8.
Setup
Since this is a Linux household, I had no interest in the Windows software.
Initial setup was pain free, I connected it to my network, connected the power supply, booted up, grabbed the MAC address from my dhcp server logs, gave the RLY-8 a fixed entry via dhcp and added DNS records.
Most of the abopve steps are not really needed. You can also just look in your dhcp server logs which IP address it got and connect to it.
Command Reference
All commands are documented in the full protocol description, you will find the commands you can send via JSON on pages 4 through 7.
Technical Details
kirich.blog has a refreshingly technical review, I recommend you read it.
If, like me, you do not understand Russian, use a translation service, e.g. Google Translate
Initial test
(copious empty lines added by hand to increase readability of example below)
$ telnet rly-8.internal.pcfe.net 2000
Trying 192.168.1.12...
Connected to rly-8.
Escape character is '^]'.
{"get":"netconfig"}
{"ipaddr":"192.168.1.12","gateway":"192.168.1.1","netmask":"255.255.255.0","port":"2000"}
{"get":"version"}
{"version":"V1.0U"}
{"get":"name"}
{"name":"DFRobot"}
{"name":"DFRobot RLY-8"}
{"resp":"ok"}
{"get":"relayStatus"}
{"relay1":"off","relay2":"off","relay3":"off","relay4":"off","relay5":"off","relay6":"off","relay7":"off","relay8":"off"}
{"relay1":"on","relay2":"off","relay3":"on","relay4":"off","relay5":"on", "relay6":"off","relay7":"on","relay8":"off"}
{"resp":"ok"}
{"get":"relayStatus"}
{"relay1":"on","relay2":"off","relay3":"on","relay4":"off","relay5":"on","relay6":"off","relay7":"on","relay8":"off"}
^]
telnet>
Note
If you try the above, remember to disconnect the telnet session when done. This is a small embedded device, not a full blown server. While I had no expectation for it to handle more than one connection concurrently, your expectations might be different.
Planned Use
- decide if I want something more advanced that a telnet connection to power nodes on or off
- wire it into my ODROID-HC2 based Ceph cluster
A webUI
This RLY-8 Web Application worked well for me, but I do not currently plan to use it regularly. If I need to power cycle an ODROID-HC2, I tend to have a shell open anyway but not necessarily a web browser.
Summary
The Good
- cheap. With shipping and import duty, I paid about 100€.
- network attached
- picks up IP address via DHCP out of the box
The Bad
FIXME: measure if I can just use comm - NO for wiring the power on state, that’s rated 5A
- When the RLY-8 itself is power-cycled, it comes up with all relays off. It would be nicer for my use-case if on power on all relays were active. Ideal would be if the RLY-8 remembered the last (or a saved) state and restored that on powerup.
- There is no user access control. If you can reach it over the network, you can control the relays.
- Power over Ethernet is not working with my Ubiquiti US-8-150W PoE switch. The switch reports the device pulling 0.00W on a PoE+ enabled port. The RLY-8 is not pingable and it’s NIC LEDs stay dark.
I can live fine with these when controlling the 12V DC power of a few test nodes in my home lab. This household contains only two adults and both use that Ceph cluster for testing.
For anything needing even a smidge of guaranteed uptime, I recommend to heavily restrict access to the IP of the RLY-8 on the network side.
Since the switch in the room the RLY-8 is used in does not have PoE, I do not care that it does not play well with my UniFi PoE.
Untested
Since the following are of no interest for me, I have not tested any of;
- the Windows software
- the USB connection
- the serial connection
Links
- DFRobot
- YouTube: Cinema Technology: IO-Box RLY-8 Review
- Google Translate of a page with a lot of technical info.
- the full protocol description, you will find the commands you can send via JSON on pages 4 through 7
- a short post on stackoverflow, has info on how to test it with telnet only
- An unofficial Java based tool that works like a charm for me
- a php tool
- DFRobot RLY-8 Contoller class written in python
- DFROBOT RLY-8-POE-USB http gateway
- a question on how to use it with HomeAssistant
- Getting Started With Relays
- Relay Logic