Page 9 of 20

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Sunday 24 June 2018 20:29
by Sprokkie
i have jessie beacause my apple homekit plugin did not wok on strech.
got it working now, afraid to update to strech.

can i have second raspberry run the modbus software and then send the data to domoticz running on jessie ?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 25 June 2018 7:32
by gizmocuz
You should be able to get your apple homekit to run on stretch, else they should update their library.
You do not want to stay on that old system forever....

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 25 June 2018 8:54
by Sprokkie
its the software bridge that runs on the pi.
I tried an install on strech that didn'r work....
The apple is up to date.

but what about the -U optopn for th einstall command, that is the problem i ran in to.
Or is that also jessie related ?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Tuesday 21 August 2018 23:07
by malp
dear ...
I have synology and domoticz (Python support) there. Python is installed.
I added the modbus device in the hardware, but I see the following issues (looks like the same like some people before) in the log:

2018-08-21 23:33:38.790 Status: (Modbus-1) Started.
2018-08-21 23:33:38.884 Error: (Modbus) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/modbus-read/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload'.
2018-08-21 23:33:38.885 Error: (Modbus-1) Module Import failed, exception: 'ImportError'
2018-08-21 23:33:38.885 Error: (Modbus-1) Module Import failed: ' Name: pymodbus'
2018-08-21 23:33:38.885 Error: (Modbus-1) Error Line details not available.
2018-08-21 23:35:00.924 Error: Modbus-1 hardware (5) thread seems to have ended unexpectedly
pymodbus and pymodbusTCP are installed:

Solution:
I added the following in the script:
sys.path.append('/usr/lib/python2.7/site-packages')
sys.path.append('/usr/local/lib/python2.7/site-packages')
sys.path.append('/usr/local/lib/python3.5/dist-packages')

just specified the path where serial, pymodbus etc are located (in my case)

On windows it works without issues.

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 27 August 2018 19:30
by rusu3
Hello everyone :)

I em new in domoticz i have installation on rpi2. I was able to install this modbus read and write plugin. I want to connect by this write plugin to a zamel rxm-01. this is a modbus rtu/asci converter to closed Zamel system.To switch on my device i need to send "on " command 01 05 00 00 FF 00 8C 3A I don,t know how to connect switch in domoticz with that plugin. I will be gratefull for any help.
Zrzutekranuz2018-08-2719-25-16.png
Zrzutekranuz2018-08-2719-25-16.png (130.55 KiB) Viewed 5685 times

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Saturday 08 September 2018 20:34
by Domoticx
@rusu3

To break down the command: 01 05 00 00 FF 00 8C 3A

SLAVE ID: 01
FUNCTION: 05 (write single coil)
REGISTER: 0 (00 00)
DATA: FF 00 (DEC = 65280)
CHECkSUM: info (8C 3A)

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Sunday 30 September 2018 23:01
by MaikelK
Hi Domoticx,

Could you explain me how you are reading out the SDM120C ?

What did you use to connect it to the RPi?

And whats needed to read it via ESP?

Thanks!

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 01 October 2018 23:23
by malp
I have to following issues with Modbus RTU (via USB).
I have Win10 and domoticz there + "Modbus RTU/ASCII/TCP - READ v1.1.2" plugin. For Modbus RS485 bus I use USB-RS485 converter that actually works quite good.

I have one sensor than sends data via RS485.
When I use Modbus READ plugin in RTU mode, that within 1st request plugin reads the data (I see in LOG) and update the values, but with the following reads it shows smth like that

2018-10-02 00:18:45.705 (USB - modbus (reg1)) Modbus error communicating! (RTU/ASCII/RTU over TCP), check your settings!
2018-10-02 00:18:45.705 (USB - modbus (reg1)) Updating device from 0:'1415' to have values 0:'0'.
2018-10-02 00:18:45.713 (USB - modbus (reg1)) Modbus error decoding or recieved no data (RTU/ASCII/RTU over TCP)!, check your settings!
2018-10-02 00:18:45.714 (USB - modbus (reg1)) Updating device from 0:'0' to have values 0:'0'.

I tested the sensor with CAS Modbus scanner and it gets the data via modbus regulary.

Does anyone meet the same issue?

The sensor is made on Arduino and follows the following implementation http://domoticx.com/arduino-modbus-rs485-rtu-slave/ (from the 1st page)

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Tuesday 02 October 2018 0:34
by malp
solution for my previous message (after the debugging), so probably will be helpfull:

it is solved with the statement client.close after the data reading for RTU
line 263
Devices[1].Update(0, value) # Update value in Domoticz
try: - here is my code
client.close() - here is my code
except: - here is my code
Domoticz.Log("Error closing Serial interface on "+Parameters["SerialPort"]) - here is my code

except:
Domoticz.Log("Modbus error decoding or recieved no data (RTU/ASCII/RTU over TCP)!, check your settings!")
Devices[1].Update(0, "0") # Update value in Domoticz

###################################
# pymodbusTCP section
###################################

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Sunday 14 October 2018 18:24
by Koploper
Hi ,

I also installed an Eastron SDM120 to monitor my solar energy production and like to integrate it into domoticz. I have a Modbus to USB dongle (https://www.hobbyelectronica.nl/product ... catie-usb/), installed the plugin but I can't seem to get the datatransfer working. Also I am not sure what exacly to fill in when setting up the hardware in Domoticz. When I set it up, I get a new device, which is identified as a Light/Switch. I am somewhat experienced with Domoticz, but am completely new to modbus.

Does someone know how I can set up the communication?

I'm running V4.9700 on an RPI.

Thanks!

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Tuesday 16 October 2018 19:54
by thefox154
I have the same problem, different device.
When i try to read out sensor readings from a Hitachi Modbus module (temperatures), this is added as a Light Switch device in domotiz :?:

edit: My eastron SDM530 also shows up as a light switch..

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Tuesday 16 October 2018 20:27
by MaikelK
Koploper wrote: Sunday 14 October 2018 18:24 Hi ,

I also installed an Eastron SDM120 to monitor my solar energy production and like to integrate it into domoticz. I have a Modbus to USB dongle (https://www.hobbyelectronica.nl/product ... catie-usb/), installed the plugin but I can't seem to get the datatransfer working. Also I ........
I would love to know the same, i bought the same (looking) adapter from Aliexpress.

You connected it to a Rpi too?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Wednesday 17 October 2018 14:45
by laulau
Hi,
I'm testing this plugin and encountered some problems.

I' ve defined two hardware devices, one for F1(Read coil) fonction and an other for F3(Read holding register) fonction.


But both device are shown as Light/Switch ! :o

This seem ok for F1 fonction (binary) but F3 should read a Custom sensor ?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Friday 19 October 2018 15:37
by butyl
Hi Domoticx,
are you still working on the modbus plugin? Have you updated it on Domoticz v4.x?
I need to read some regier values from the new modbus device.

Can you update the plugin for Domoticz v4.x, please?
Thank you.

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 05 November 2018 0:03
by calderopapas
Hello Domoticx,

I install your plug in, works fine, but i have a problem.

I use a modbus gateway between RTU and TCP. When add a MODBUS TCP device in domoticz, cant select address of modbus RTU device, only ip adress of gateway.

i use it in scadabr and works fine, how can select slave address in your plugin?

Scheme: modbus RTU bus(rs485)----------- modbus gateway (RTU-TCP)------ LAN
|
|
L device 1.
|
L device 2...

i attach and image of scadaLTS.

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 05 November 2018 1:16
by RonaldSl
Hallo,

I installed the plugins and after clean installation of Raspbian and Domoticz it works so far.
I am trying to read a coil from PLC over TCP and in debug mode. When I switched the register from on to off I see in debug mode:
2018-11-04 23:09:43.297 (Read MB20 - ModbusDEV-READ) Updating device from 1:'False' to have values 0:'False'.
2018-11-04 23:09:43.312 (Read MB20 - ModbusDEV-READ) Updating device from 0:'False' to have values 1:'False'.

When I switched from off to on in debug mode:
2018-11-04 23:10:53.304 (Read MB20 - ModbusDEV-READ) Updating device from 1:'True' to have values 0:'True'.
2018-11-04 23:10:53.319 (Read MB20 - ModbusDEV-READ) Updating device from 0:'True' to have values 1:'True'.

So far so good. Only thing is that when I switched that device, the device stay's on.
modbustcp.jpg
modbustcp.jpg (78.2 KiB) Viewed 5074 times
When I change the data type to INT instead of no conversion the device stay's off.

The ModBus-WRITE plugin the write coil function is working verry good with payload on=1 and off=0.

Can you please help me with the read plugin?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Wednesday 07 November 2018 16:31
by Mankan
Hi!

I need help to install Modbus Plugin, both Read and write

Ive downloaded plugins from,
https://github.com/DomoticX/domoticz-modbus

And I have placed it under

/home/pi/domoticz/plugins/modbus-write/plugin.py
/home/pi/domoticz/plugins/modbus-read/plugin.py

And then i made restart.

The log says,
2018-11-07 16:01:48.361 Error: PluginList: Parsing '/home/pi/domoticz/plugins/modbus-read/', 'Error document empty.' at line 0 column 0 in XML ''.

2018-11-07 16:01:48.361 Error: PluginList: Parsing '/home/pi/domoticz/plugins/modbus-write/', 'Error document empty.' at line 0 column 0 in XML ''.

Ive tried to run this to,
sudo pip3 install -U pymodbus

in hardware it looks like the attached file.

does anybody know what im doin wrong??

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Tuesday 27 November 2018 8:58
by rvdgaag
I upgraded to the read 1.1.3 and it has issues now connecting to the TCPIP device which was working fine with 1.1.2.

Any ideas where I can find the previous version ?

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Sunday 23 December 2018 14:44
by dzjr
Hello @Domoticx,

Thank you for this plug-in.
I use it together whit a Janitza UMG103 Universal measurement device, i can read all the measurements i want.

Only sometimes i get a bad reading, value = 0, but that is 1 times in two day's, it can also some bad wire-ring.


i tried to connect thru TCP/IP but that i can't get it working......
else i had tryed to connect it thru Ethernet.

Thank you for the plugin!

Re: [RELEASED] Python plugin: Modbus RTU / ASCII / TCP/IP

Posted: Monday 24 December 2018 17:36
by VHK17
Hello,
Is it possible to use the raspberry as a slave modbus device ?

I have a home automation plc for heating and so on and want to use the raspberry as a slave for the lights.