<?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[Pycom modbus]]></title><description><![CDATA[<p dir="auto">I'm testing out the official modbus library as, modbus is a critical component of the product we're developing. We're currently based on the ESP32 and RFM95x and the Lopy4 looks like a reasonable replacement with a good ecosystem for managing the devices.</p>
<p dir="auto">However, I can't get the regular modbus library to work with the RX485 XY-017 module for testing purposes.</p>
<pre><code>from uModBus.serial import Serial
import machine

######################### RTU SERIAL MODBUS #########################
uart_id = 0x01
modbus_obj = Serial(uart_id, pins=('P3', 'P4'))


###################### READ HOLDING REGISTERS ##################
slave_addr=0x0001
starting_address=0x0156
register_quantity=4
signed=True

register_value = modbus_obj.read_input_registers(slave_addr, starting_address, register_quantity, signed)
print('Input register value: ' + ' '.join('{:d}'.format(x) for x in register_value))
</code></pre>
<p dir="auto">I'm trying to read the value of slave ID 1 on an <a href="https://www.eastroneurope.com/images/uploads/products/protocol/SDM120-MODBUS_Protocol.pdf" target="_blank" rel="noopener noreferrer nofollow">eastron modbus meter</a>. Not sure where to start looking even, the info for the library seems very sparse. The XY-017 RX is connected to P3, and TX connected to P4</p>
<p dir="auto">The error message:</p>
<pre><code>Traceback (most recent call last):
  File &quot;main.py&quot;, line 25, in &lt;module&gt;
  File &quot;uModBus/serial.py&quot;, line 144, in read_input_registers
  File &quot;uModBus/serial.py&quot;, line 95, in _send_receive
  File &quot;uModBus/serial.py&quot;, line 100, in _validate_resp_hdr
OSError: no data received from slave
</code></pre>
<p dir="auto">The PDF alluded to in the documentation itself, where is it?<br />
&quot;For more information on the MODBUS RTU see the following PDF File . Information on the MODBUS TCP can be found Here .&quot;</p>
]]></description><link>https://forum.pycom.io/topic/7350/pycom-modbus</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 03:44:29 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/7350.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Nov 2021 09:02:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pycom modbus on Wed, 10 Nov 2021 09:02:20 GMT]]></title><description><![CDATA[<p dir="auto">I'm testing out the official modbus library as, modbus is a critical component of the product we're developing. We're currently based on the ESP32 and RFM95x and the Lopy4 looks like a reasonable replacement with a good ecosystem for managing the devices.</p>
<p dir="auto">However, I can't get the regular modbus library to work with the RX485 XY-017 module for testing purposes.</p>
<pre><code>from uModBus.serial import Serial
import machine

######################### RTU SERIAL MODBUS #########################
uart_id = 0x01
modbus_obj = Serial(uart_id, pins=('P3', 'P4'))


###################### READ HOLDING REGISTERS ##################
slave_addr=0x0001
starting_address=0x0156
register_quantity=4
signed=True

register_value = modbus_obj.read_input_registers(slave_addr, starting_address, register_quantity, signed)
print('Input register value: ' + ' '.join('{:d}'.format(x) for x in register_value))
</code></pre>
<p dir="auto">I'm trying to read the value of slave ID 1 on an <a href="https://www.eastroneurope.com/images/uploads/products/protocol/SDM120-MODBUS_Protocol.pdf" target="_blank" rel="noopener noreferrer nofollow">eastron modbus meter</a>. Not sure where to start looking even, the info for the library seems very sparse. The XY-017 RX is connected to P3, and TX connected to P4</p>
<p dir="auto">The error message:</p>
<pre><code>Traceback (most recent call last):
  File &quot;main.py&quot;, line 25, in &lt;module&gt;
  File &quot;uModBus/serial.py&quot;, line 144, in read_input_registers
  File &quot;uModBus/serial.py&quot;, line 95, in _send_receive
  File &quot;uModBus/serial.py&quot;, line 100, in _validate_resp_hdr
OSError: no data received from slave
</code></pre>
<p dir="auto">The PDF alluded to in the documentation itself, where is it?<br />
&quot;For more information on the MODBUS RTU see the following PDF File . Information on the MODBUS TCP can be found Here .&quot;</p>
]]></description><link>https://forum.pycom.io/post/39535</link><guid isPermaLink="true">https://forum.pycom.io/post/39535</guid><dc:creator><![CDATA[Andreas Tollånes]]></dc:creator><pubDate>Wed, 10 Nov 2021 09:02:20 GMT</pubDate></item><item><title><![CDATA[Reply to Pycom modbus on Wed, 17 Nov 2021 08:20:15 GMT]]></title><description><![CDATA[<p dir="auto">I seem to be unable to edit my message, I wanted to add another question to it: is there perhaps another library that could work well for Lopy that is not the official one? Still not gotten it to work.</p>
]]></description><link>https://forum.pycom.io/post/39571</link><guid isPermaLink="true">https://forum.pycom.io/post/39571</guid><dc:creator><![CDATA[Andreas Tollånes]]></dc:creator><pubDate>Wed, 17 Nov 2021 08:20:15 GMT</pubDate></item></channel></rss>