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.
Toulon7559
Posts: 402
Joined: Sunday 23 February 2014 18:56
Target OS: Raspberry Pi
Domoticz version: latest
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 » Monday 19 December 2016 20:47

@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-B+RFXCom433+S0PCM+Linksprite-shield for BMP180/DS18B20/RS485+DDS238ZN1
Set2 = RPI-3+RFLinkGTW+ESP8266s+PWS_WS7000
Common = 2*PVLogger+PWS_TFA_Nexus+KAKUs
=> Energy & Data Management based on Time and on PV&Consumption&Meteo

Toulon7559
Posts: 402
Joined: Sunday 23 February 2014 18:56
Target OS: Raspberry Pi
Domoticz version: latest
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 » Monday 19 December 2016 21:33

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 9:47, edited 2 times in total.
Set1 = RPI-B+RFXCom433+S0PCM+Linksprite-shield for BMP180/DS18B20/RS485+DDS238ZN1
Set2 = RPI-3+RFLinkGTW+ESP8266s+PWS_WS7000
Common = 2*PVLogger+PWS_TFA_Nexus+KAKUs
=> Energy & Data Management based on Time and on PV&Consumption&Meteo

term
Posts: 8
Joined: Sunday 16 March 2014 18:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: General Modbus support

Post by term » Wednesday 21 December 2016 22:38

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: 402
Joined: Sunday 23 February 2014 18:56
Target OS: Raspberry Pi
Domoticz version: latest
Location: Hengelo(Ov)/NL
Contact:

Re: General Modbus support

Post by Toulon7559 » Thursday 09 February 2017 11:46

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 14:23, edited 1 time in total.
Set1 = RPI-B+RFXCom433+S0PCM+Linksprite-shield for BMP180/DS18B20/RS485+DDS238ZN1
Set2 = RPI-3+RFLinkGTW+ESP8266s+PWS_WS7000
Common = 2*PVLogger+PWS_TFA_Nexus+KAKUs
=> Energy & Data Management based on Time and on PV&Consumption&Meteo

bobdvb
Posts: 23
Joined: Friday 29 July 2016 9:53
Target OS: Raspberry Pi
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by bobdvb » Tuesday 14 March 2017 17:39

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: 43
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax » Monday 10 April 2017 19:02

+1

vuokko
Posts: 3
Joined: Saturday 11 March 2017 13:28
Target OS: Linux
Domoticz version:
Contact:

Re: General Modbus support

Post by vuokko » Monday 10 April 2017 22:19

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: 43
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax » Saturday 15 April 2017 21:07

I might be interested in putting a bounty up for this functionality, if there are any takers?

Thomasdc
Posts: 211
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: General Modbus support

Post by Thomasdc » Tuesday 09 May 2017 18:33

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: 6
Joined: Monday 26 June 2017 21:16
Target OS: Raspberry Pi
Domoticz version: 3.8072
Location: Spain
Contact:

Re: General Modbus support

Post by salvacalatayud » Thursday 13 July 2017 20:41

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: 43
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by Lomax » Tuesday 01 August 2017 18:39

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: 23
Joined: Friday 29 July 2016 9:53
Target OS: Raspberry Pi
Domoticz version:
Location: United Kingdom
Contact:

Re: General Modbus support

Post by bobdvb » Thursday 10 August 2017 22:51

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests