Posts: 5
Threads: 2
Joined: Mar 2017
Reputation:
0
Due to the long distance and a higher number of stations, I would like to control the valves via modbus. I already have Arduino boards ready that can be controlled via modbus. From the Raspberry I can switch them on and of via modbus. Now I would like to use modbus commands (which are python function calls) instead of GPIO pins. What would be the best way? The most clean way would be to write a plugin. But I am not sure if that would be appropriate here as it would influence a central part of the control architecture.
Posts: 5
Threads: 2
Joined: Mar 2017
Reputation:
0
2017 Mar 08, 10:30 AM
(This post was last modified: 2017 Mar 08, 10:31 AM by cyberthom.)
Yes, I am using minimalmodbus at the Raspi and SimpleModbusSlave at the Arduino.
The plugin actually only need to use the function calls instrument.write_register() instead of setting the GPIO pins.
For reading input values like the moisture sensor, it would need to use the function call instrument.read_register().
To be honest, I am not sure where to start. My python knowledge is more at beginners level. There are a lot of function calls in the OpenSprincler code at which the GPIO is referred.
My goal would be to use the minimalmodbus python functions instead of GPIO pins to enable/disable the valves.
In addition I also would like to add moisture sensors via minimalmodbus, but I guess up to now only rain sensors are supported so it would need a second plugin I guess, right?