<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85552/zephyr-modbus-samples</link><description>Hi 
 We wan&amp;#39;t use in our project some MODBUS sensors and I found, that Nordic Connect SDK (I use version 1.9.1) with Zephyr has support for MODBUS. I tried the samples (rtu- server and rtu-client), but I don&amp;#39;t get them work. They compile OK and if I look</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Mar 2022 14:04:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85552/zephyr-modbus-samples" /><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357971?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 14:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3853718-019f-44cb-a4be-7bc128231bba</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;br /&gt;&lt;br /&gt;It is great to hear that you got everything working.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357933?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 12:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22011cf-2652-4ba8-a33f-df5c8f927a70</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;Hi Dejan&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I got it working, but I don&amp;#39;t know what was the problem actually. I removed everything releated to SDK, cleaned the folders and reinstalled from scratch and the example worked straight out of the box. That is strange, because it was not working with 1.8.0, 1.9.0 and also with 1.9.1 -- i tried different SDK versions more than one time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I got my sensor also working -- Senseair Sunrise uses non-standard approach for MODBUS checksum stopbits and I modified SDK-s Zephyr MODBUS subsystem files with a patch, that is included in newer Zephyr version (&lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/40558/files"&gt;modbus: stop bits can now be set individually by Constikri &amp;middot; Pull Request #40558 &amp;middot; zephyrproject-rtos/zephyr &amp;middot; GitHub&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647261763045v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357829?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 08:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d543e697-11ad-4c7e-a4d9-77944029d2e0</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;/p&gt;
[quote user="Tiit"]Do you use also RS232 for communication? I have tested the example first -- I didn&amp;#39;t touch the settings (only commented DE pin out, because I don&amp;#39;t use RS485 tranceiver) and connected Arduino serial (UART1, RX - 1.01, TX - 1.02) pins crossed between two boards -- I see only RX timed out.[/quote]
&lt;p&gt;&lt;br /&gt;I connected two boards the same way, with pins P1.01 and P1.02 on one board connected to the pins P1.02 and P1.01 on the second board, respectively. I did not use RS485 and I was observing communication on the boards&amp;#39; COM ports.&lt;/p&gt;
[quote user="Tiit"]&lt;p&gt;It&amp;#39;s strange, because the server board is recieving coil change messages (log shows, but LED-s stay off).&lt;/p&gt;
&lt;p&gt;The client board is sending MODBUS messages and server board is answering (as I see from logic analyzer), but client board&amp;nbsp; shows only the RX timeout error.&lt;/p&gt;[/quote]
&lt;p&gt;I could see &amp;quot;Coils state change&amp;quot; on the client side, and &amp;quot;Coil write&amp;quot; and &amp;quot;Coil read&amp;quot; on the server side.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357812?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 06:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7240394-2ddc-496d-9fb1-6dd6913033ed</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;Hi Dejan&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you use also RS232 for communication? I have tested the example first -- I didn&amp;#39;t touch the settings (only commented DE pin out, because I don&amp;#39;t use RS485 tranceiver) and connected Arduino serial (UART1, RX - 1.01, TX - 1.02) pins crossed between two boards -- I see only RX timed out.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s strange, because the server board is recieving coil change messages (log shows, but LED-s stay off).&lt;/p&gt;
&lt;p&gt;The client board is sending MODBUS messages and server board is answering (as I see from logic analyzer), but client board&amp;nbsp; shows only the RX timeout error.&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357731?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 15:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4e67b23-ed63-4800-bf0c-90e0d4d4c9fd</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;br /&gt;&lt;br /&gt;I haven&amp;#39;t been able to reproduce the problem you reported. I used the same MODBUS example and nRF Connect SDK v1.9.1. I have also tried with nRF Connect SDK v1.8.0 and that also worked well. I haven&amp;#39;t observed warnings neither for frame size nor for timeout. The communication was working well as observed in the output of the COM ports. &lt;br /&gt;In my setup the error which you reported shows up only when I disconnect one of the Tx/Rx lines which connect two boards. In this case OFF/ON sequence was needed on the client side. After that everything started to work as expected.&lt;br /&gt;&lt;br /&gt;I would suggest you to try the same example without sensors and see if you get any errors. Ensure that everything is properly connected. Later, if you change for example pins in prj.conf file, make sure that you also change pins when physically connecting the boards together.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357596?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 10:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f16005-5b7c-457a-9045-4251541b3bca</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I enabled CONFIG_MODBUS_SERIAL from prj.conf and added CONFIG_MODBUS_LOG_LEVEL_DBG, got a little more logging to terminal:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646993226681v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But still no luck.. RX timeout.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/357146?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 12:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32193cf6-f0c9-4e75-817d-c386cfffe8ee</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;br /&gt;&lt;br /&gt;For more information about logging in Zephyr take a loook at the &lt;a href="https://docs.zephyrproject.org/latest/reference/logging/index.html"&gt;Zephyr logging&lt;/a&gt; page.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356952?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 15:09:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ab110d9-02ae-4b6e-9347-b477bba60ab8</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646751940015v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Actually there are not much more messages there. I am very new to Zephyr .. can I enable deeper logging as that is on old SDK and sdk_config.h on Zephyr?&lt;/p&gt;
&lt;p&gt;The RTU timeout ise longer, because the sensor is using 9600 baud.&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356943?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 14:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf478d2d-34f2-40d3-8ba4-6ae450694f66</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="Tiit"]The client app says: invalid frame length and straight after that Client wait-for-RX timeout.&amp;nbsp;[/quote]
&lt;p&gt;&lt;br /&gt;Can you share full error message including both &amp;quot;invalid frame length&amp;quot; and &amp;quot;Client wait-for-RX timeout&amp;quot;?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356920?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 14:00:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49eec019-ae0e-40b5-aef9-ac62c672409b</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;If I try to read our sensor (I modified the client sample to read some registers with modbus_read_input_regs() function) I see an answer from sensor on logic analyzer with right data, The client app says: invalid frame length and straight after that Client wait-for-RX timeout.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried to raise the rx_timeout value on interface parameters, but that only raised timeslot before the RX timeout message appears.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356913?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 13:46:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2890f31d-b757-4b39-bb39-fbebec86dc68</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;Yes :&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;arduino_serial {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; modbus0 {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;zephyr,modbus-serial&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;label&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;MODBUS0&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;//de-gpios = &amp;lt;&amp;amp;arduino_header 15 GPIO_ACTIVE_LOW&amp;gt;; &amp;nbsp;/* D9 */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Tiit&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356907?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 13:36:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f223b095-f4fe-4e62-a9ac-434efd6abf3c</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;/p&gt;
&lt;p&gt;Do you have Driver Enable (DE) pin commented out on both boards i.e. on both server and client side?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356816?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25478e27-6797-41be-98fa-82269a7fb3c7</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;Two NRF52840-DK -s&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646734131889v1.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356814?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:02:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7fb5dcf-18ca-40cb-b5ff-b8fb77c0c74a</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Tilt,&lt;br /&gt;&lt;br /&gt;Which board are you using?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr MODBUS samples</title><link>https://devzone.nordicsemi.com/thread/356756?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 07:37:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4c5027e-250b-4487-8abf-c14fe7312a17</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;I forgot to mention, that I use RS232 and not RS485 and the DE pin is commented out in app.overlay.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>