Open wernerfred opened 2 years ago
Hi @wernerfred
Thanks for the issue report and sorry for the delay.
It seems that you are getting the error due to failure in modbus TCP layer. Unfortunately, modbus errors are quite common in CTS700. You should ignore the error and retry. This is quite hard to do in version 1.0.0, because it lacks error handling in general.
I have introduced error handling in the new version of nilan
(v. 1.1.0). The interface is slightly different, as FetchValue
(and other functions) now returns a tuple consisting of a result and an error, if it occurs.
Sample usage:
value, err := controller.FetchValue(slaveID, register)
if err != nil {
// handle error
}
So, the controller should return you an error if something goes wrong in modbus TCP layer.
One more thing... If you are trying out nilan-rest-api: please provide NILAN_ADDRESS
environment variable.
E.g.
NILAN_ADDRESS=192.168.1.31:502 ./nilanapp
Or if you are running in Docker:
docker run -e NILAN_ADDRESS=<IP and port of Nilan> -it --rm -p 8080:8080 nilan
Hey, 👋🏻
i got the following error, can you help me what what might be wrong?