28.09.2020, 07:31
You can log the connect() call result in your script:
You will probably get "Connection refused" which means that the remote host is alive but the requested port is not available.
Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.250.5', 10502)
res, err = mb:connect()
log(res, err)