This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Relay board R421A08
I've done a short script for controlling cheap relay board from AliExpress Routerboard R421A08

If someone is interested in:
User library named ecl_modbus_rtu
local lt_modbus = {
   toggle=0x300, -- close/open/close/open
   switch=0x400, -- switch 1 of 8
   impulse=0x0500, -- close one for 1s, open other relays
   close_delay=0x0600 --close, then open with delay[s] 00 - FF - (0x06[00-FF])
   -- ll_slave =RS485 RTU Number set at relay board DIPs
   -- ll_Register = relay Nr 1-8
   -- ll_value = it_rboard_actions
   mb = luamodbus.rtu()
   mb:open(self.is_port, self.il_baudrate, 'N', 8, 1, 'H')
return lt_modbus

Code for testing:
local mbus=require('user.ecl_modbus_rtu')


LM5Lp, firmware: 2018.08.22, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151

Thank you.
I have been trying to communicate with tha same relayboard with no luck.
I will give this a try. Cool

Forum Jump: