General Modbus support

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Toulon7559
Posts: 843
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 »

@bobdvb

After adjustment of the interface to my configuration with /dev/ttyAMA0 and speed = 9600, I tried to run your probe-script (further unchanged), but got stuck.
See 1 printline appearing:
= Input Registers =
Then error report for line 23, and last line of Traceback/Debug reports 'IOError: No communication with the instrument (no answer)'.
Apparently something in that line 23, which is not accepted in my configuration with a kWh-meter DDS238-1ZN at Slave-Address 1.
Any idea?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 843
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 »

For the question 'Which devices on the RS485-bus?' perhaps pymodbus has some solution.
In the documentation the class pymodbus.constants.Defaults has settings to listen or to ignore Slaves-not-responding, and in the class pymodbus.constants.ModbusStatus reports the status of an adressed Slave.
;-) Now 'only' have to develop a script with pymodbus, which sequentially calls all Slaves to get a listing of occupied Slave-adresses, and then command/request selected Slave(s) to shift to another adress.
Last edited by Toulon7559 on Saturday 24 December 2016 8:47, edited 2 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
term
Posts: 2
Joined: Sunday 16 March 2014 17:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: General Modbus support

Post by term »

I have bought a Systemair SAVE mostly because it has a well documented MODBUS interface included. I have purchased an RS485 adapter to my domoticz units and I'm willing to help to try things out.

https://www.google.se/url?sa=t&rct=j&q= ... 3lWwPJBfiw
Toulon7559
Posts: 843
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 »

Looking on the internet for another thing, I found this introduction to Modbus.
In plain (dutch) language it summarizes what Modbus is, what you can do with it, and some aspects to notice, when making an application script.
Last edited by Toulon7559 on Friday 17 March 2017 13:23, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
bobdvb
Posts: 18
Joined: Friday 29 July 2016 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by bobdvb »

Okay, I have shelved my python scripts for now and I have found that I can get things roughly working with NodeRed and to do it I am using: https://flows.nodered.org/node/node-red-contrib-modbus

Because I am using serial I am using mbusd which I just recently discovered and it is working well so far. http://mbus.sourceforge.net

I'll publish my flows when I understand what I am doing!

Bob
Lomax
Posts: 32
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax »

+1
vuokko
Posts: 1
Joined: Saturday 11 March 2017 12:28
Target OS: Linux
Domoticz version:
Contact:

Re: General Modbus support

Post by vuokko »

Just to add link: http://libmodbus.org/

It's C implementation and it is quite robust, easy port and so on... RTU and TCP are supported. It can be used as master and slave implementation.

My experience is from 2012-2014...

EDIT: Reread the thread and libmodbus was already mentioned :oops:
Lomax
Posts: 32
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax »

I might be interested in putting a bounty up for this functionality, if there are any takers?
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: General Modbus support

Post by Thomasdc »

is someone working on this?

i would like to have Modbus TCP support, i would like to integrate a Railduino (and later more than one) in Domoticz..
see also:
https://www.domoticz.com/forum/viewtopi ... 17&t=17368
salvacalatayud
Posts: 112
Joined: Monday 26 June 2017 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Spain
Contact:

Re: General Modbus support

Post by salvacalatayud »

bobdvb wrote:Okay, I have shelved my python scripts for now and I have found that I can get things roughly working with NodeRed and to do it I am using: https://flows.nodered.org/node/node-red-contrib-modbus

Because I am using serial I am using mbusd which I just recently discovered and it is working well so far. http://mbus.sourceforge.net

I'll publish my flows when I understand what I am doing!

Bob
I'm interested in your work. How do you translate modbus to domoticz in node red?

Enviado desde mi Lenovo K50-t5 mediante Tapatalk
Lomax
Posts: 32
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax »

salvacalatayud wrote:
bobdvb wrote:Okay, I have shelved my python scripts for now and I have found that I can get things roughly working with NodeRed and to do it I am using: https://flows.nodered.org/node/node-red-contrib-modbus

Because I am using serial I am using mbusd which I just recently discovered and it is working well so far. http://mbus.sourceforge.net

I'll publish my flows when I understand what I am doing!

Bob
I'm interested in your work. How do you translate modbus to domoticz in node red?

Enviado desde mi Lenovo K50-t5 mediante Tapatalk
Anything to do with ModBus is interesting to me, please tell us more!
bobdvb
Posts: 18
Joined: Friday 29 July 2016 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by bobdvb »

Sorry for not visiting the forum for a while, I started a new job and it's occupied all my brain space lately.

My Pi has crashed and I haven't recovered it yet so I can't share what I did exactly, but from memory:
You need to set up the MQTT as sinks and sources, that should already be in Node-Red with Domoticz.
https://www.domoticz.com/wiki/MQTT

Then you just set up the node-red-contrib-modbus and it is all about reading "coils" and registers. You really need to know what the device is capable of and it's coil maps, otherwise it is hit and miss. I used my script to probe the coil reads which was helpful but writing to the relay still eluded me.

Work in progress?
miljume
Posts: 62
Joined: Thursday 03 December 2015 21:36
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8742
Contact:

Re: General Modbus support

Post by miljume »

I would also really like to see general Modbus TCP support

In that way it would be easy to interact with PLC's from different vendors
Ricard1
Posts: 62
Joined: Saturday 07 November 2015 12:30
Target OS: Windows
Domoticz version: Beta
Location: Sweden
Contact:

Re: General Modbus support

Post by Ricard1 »

How hard can it be... ;) Modbus and KNX support now please! :D :P
pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: General Modbus support

Post by pj-r »

Ricard1 wrote: Thursday 26 October 2017 10:16 How hard can it be... ;) Modbus and KNX support now please! :D :P
Just implement it! Domoticz is open source ;)
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
DomoArie
Posts: 8
Joined: Tuesday 10 November 2015 19:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Netherlands
Contact:

Re: General Modbus support

Post by DomoArie »

It was very interesting to read all you effort to get Modbus into Domoticz!
As I am creating a house that can be monitored and steered more and more, I also bought some kHw meters to measure (and steer) depending on power input (or other information) coming form kWh meters that have a Modbus onboard.

The basic of Modbus is robust and simple as you all noticed, but get it connected as a simple "fill in the addresses and variables" into a kind of table would be a nice goal as domotica is continue to grow and Modbus is one of the interesting protocols.

I was reading some real effort of coding and I asked myself what we as a community could create from that.
I am really not an expert programmer but have some spare nighttime to test and practise on several devices.

@Richard1, @pj-r, @miljume, @bobdvb, @Lomax, @salvacalatayud, @Thomasdc, @vuokko, @Toulon7559 together we could develop something nice
Who can help me in getting somewhere?

Regards
User avatar
Domoticx
Posts: 90
Joined: Sunday 07 January 2018 21:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marienheem / The Netherlands
Contact:

Re: General Modbus support

Post by Domoticx »

Hi All,

Modbus plugin released soon 8-) , follow: https://domoticz.com/forum/viewtopic.php?f=65&t=21297

Enjoy!
My Domoticz plugins:
- Modbus RS485 RTU/ASCII/TCP

Maatwerk in: Domotica - Automatisering - Elektronica - 3D printing - Software ontwikkeling
Website / Webshop / Knowledge Center / Facebook (like de pagina en blijf op de hoogte!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests