<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help 4-Channel Relay 13.2 Modbus]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have purchased the 4-Channel Relay 13.2 module and I need an example to activate and deactivate the relays using Modbus, both as a master and as a slave. Could you please provide me with a sample code or guide on how to achieve this?</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://community.m5stack.com/topic/6680/help-4-channel-relay-13-2-modbus</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:22:09 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6680.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Aug 2024 20:37:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Fri, 09 Aug 2024 18:00:36 GMT]]></title><description><![CDATA[<p dir="auto">Hola <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a><br />
<img src="/assets/uploads/files/1723226419489-capture-resized.jpg" alt="capture.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Now I did it but it can't be done!</p>
]]></description><link>https://community.m5stack.com/post/26044</link><guid isPermaLink="true">https://community.m5stack.com/post/26044</guid><dc:creator><![CDATA[Robertof]]></dc:creator><pubDate>Fri, 09 Aug 2024 18:00:36 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Fri, 09 Aug 2024 10:58:12 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/robertof" aria-label="Profile: Robertof">@<bdi>Robertof</bdi></a></p>
<p dir="auto">if you edit your first post it should allow you to change the title. Have you tired that?</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26038</link><guid isPermaLink="true">https://community.m5stack.com/post/26038</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 09 Aug 2024 10:58:12 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Fri, 09 Aug 2024 08:24:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a><br />
Hi Felix, I haven’t been able to change the title.<br />
I saw your GitHub page, it’s clear that C++ is your language.<br />
Thanks for providing me with the UIflow example.<br />
Roberto.</p>
]]></description><link>https://community.m5stack.com/post/26037</link><guid isPermaLink="true">https://community.m5stack.com/post/26037</guid><dc:creator><![CDATA[Robertof]]></dc:creator><pubDate>Fri, 09 Aug 2024 08:24:12 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Thu, 08 Aug 2024 14:26:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/robertof" aria-label="Profile: Robertof">@<bdi>Robertof</bdi></a></p>
<p dir="auto">You are welcome. I am glad to hear you got it working to your liking.</p>
<p dir="auto">I don't know of an official way to mark a post as resolved. Sometimes people change the title and prepend it with [Solved], but I haven't seen that in a while. I'll leave that up to you.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26035</link><guid isPermaLink="true">https://community.m5stack.com/post/26035</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 08 Aug 2024 14:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Thu, 08 Aug 2024 11:58:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a><br />
This has worked perfectly thanks to your help.<br />
Your comments helped me understand the code and adapt it to my needs.<br />
If there's any way to mark this post as resolved, I would appreciate it if you could let me know how to do it.<br />
I am very grateful for your help.<br />
Thank you so, so, so much.<br />
Roberto.</p>
]]></description><link>https://community.m5stack.com/post/26033</link><guid isPermaLink="true">https://community.m5stack.com/post/26033</guid><dc:creator><![CDATA[Robertof]]></dc:creator><pubDate>Thu, 08 Aug 2024 11:58:40 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Thu, 08 Aug 2024 11:54:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> <img src="/assets/uploads/files/1723118034904-uiflow_block_1723117206494.png" alt="uiflow_block_1723117206494.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/26032</link><guid isPermaLink="true">https://community.m5stack.com/post/26032</guid><dc:creator><![CDATA[Robertof]]></dc:creator><pubDate>Thu, 08 Aug 2024 11:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Thu, 08 Aug 2024 05:07:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/robertof" aria-label="Profile: Robertof">@<bdi>Robertof</bdi></a></p>
<p dir="auto">from what I can tell Modbus Slave (Server) blocks have not yet been implemented in UIFlow<strong>2</strong>.</p>
<p dir="auto">That said, please find below a Modbus Slave (Server) example in UIFlow<strong>1</strong>:</p>
<p dir="auto"><img src="/assets/uploads/files/1723093567585-m5stackmodbusslaveexample_uiflow1.13.6_20240808.png" alt="M5StackModbusSlaveExample_UIFlow1.13.6_20240808.png" class=" img-fluid img-markdown" /></p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
from modbus.slave.rtu import ModbusSlave

setScreenColor(0x222222)

myVal = None

label0 = M5TextBox(20, 31, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(19, 69, "label1", lcd.FONT_Default, 0xFFFFFF, rotate=0)

label0.setText('Coil 0 : off')
label1.setText('Coil 1 : off')
modbus_s = ModbusSlave(2, tx=17, rx=16, baudrate=9600, data_bits=8, stop_bits=1, parity=None, slaveID=4)
modbus_s.function_init(5, 0, 2)
while True:
  myVal = modbus_s.receive_req_create_pdu()
  if (modbus_s.find_function) == (5):
    if modbus_s.find_address==0:
      if myVal == 0:
        label0.setText('Coil 0 : off')
      else:
        label0.setText('Coil 0 : on')
    elif modbus_s.find_address==1:
      if myVal == 0:
        label1.setText('Coil 1 : off')
      else:
        label1.setText('Coil 1 : on')
    else:
      pass
    modbus_s.create_slave_response(myVal)
  wait_ms(2)
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26029</link><guid isPermaLink="true">https://community.m5stack.com/post/26029</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 08 Aug 2024 05:07:54 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Wed, 07 Aug 2024 09:28:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hi Felix, the problem is that I only know how to use Uiflow. I followed an example that was available to read multiple records, and it worked with qmodmaster. I am using an M5Core 2.7. The information for Uiflow Modbus V1 and V2 is under construction, and I am frustrated because I can’t solve it. I appreciate your comment, regards.</p>
]]></description><link>https://community.m5stack.com/post/26024</link><guid isPermaLink="true">https://community.m5stack.com/post/26024</guid><dc:creator><![CDATA[Robertof]]></dc:creator><pubDate>Wed, 07 Aug 2024 09:28:53 GMT</pubDate></item><item><title><![CDATA[Reply to Help 4-Channel Relay 13.2 Modbus on Tue, 06 Aug 2024 19:12:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/robertof" aria-label="Profile: Robertof">@<bdi>Robertof</bdi></a></p>
<p dir="auto">which M5Core / Modbus hardware are you panning to use?</p>
<p dir="auto">Documentation about the 4-Channel Relay module can be found <a href="https://docs.m5stack.com/en/module/4Relay%20Module%2013.2_V1.1" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">The required libraries (and examples) can be found here:</p>
<ul>
<li><a href="https://github.com/m5stack/M5Module-4Relay" target="_blank" rel="noopener noreferrer nofollow ugc">M5Module-4Relay</a></li>
<li><a href="https://github.com/m5stack/ArduinoModbus" target="_blank" rel="noopener noreferrer nofollow ugc">Modbus</a></li>
<li><a href="https://github.com/m5stack/ArduinoRS485" target="_blank" rel="noopener noreferrer nofollow ugc">RS485</a></li>
</ul>
<p dir="auto">I suggest you start with controlling the four relays from the M5Core first (w/o Modbus). Then learn about Modbus master and slave. And finally combine Modbus with the relays.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26023</link><guid isPermaLink="true">https://community.m5stack.com/post/26023</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Tue, 06 Aug 2024 19:12:51 GMT</pubDate></item></channel></rss>