Accessing Mervis variables through Evok
Is there any way to set and get the variables defined in Mervis through Evok? Let's say i have a script that gets some data and would like that my mervis program acts upon that data. Can i use the Evok API in order to set some variable to the value that i get from the script? Or is this possible in any other way?
@n1lp0int3r Right now you can do it but not easily. When someone is asking for an interface between Mervis and other application, we suggest making a TCP Modbus channel and device in Mervis and map the variables to registers.
In Evok, there is no full support of making a proper TCP/RTU Modbus client or server (even though the TCP Modbus client is used to interface with neuron IOs and TCP Modbus Server provides access to DI of UniPi 1 for Mervis). But the support is hardcoded in evok so you would have to figure it out yourselves how it works...
Oh ok. One point that i didn't understood correctly is how we can make that mapping. In order to acomplish that i should interact with the TCP Modbus server and present to it a new device is that it?
If i understood correctly is there any documentation that you can point?
You can use the Modbus Client in evok https://github.com/UniPiTechnology/evok/blob/master/evok/modbusclient_tornado.py which is used in Neurons and create a custom device which will periodically read from registers or write to register on event...
Ok i can see now. Thanks