This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus RTU Serial Enabled/Disabled by Script
#15
I have tried 2 variants of the script, and both seem to work wrt. disable/enable. However, the polling continues.

Below please find the script where one variant is commented out.

Quote:value = event.getvalue()
log('Air Con polling script fired, value=' .. tostring(value))

webrequest = require('webrequest')
vars = {
  plugin = 'modbus',
  request = 'config-save',
  data = {
    enabled = value
  }
}

res, err = webrequest('general', 'plugin', vars)
log(res, err)

--------------

--value = event.getvalue()

--require('uci')
--require('json')

--function getvar()
--  return 'config-save'
--end

--function json.data()
--  return { enabled = value }
--end

--ngx = { sleep = os.sleep }
--dofile('/lib/genohm-scada/plugins/modbus/web.lua')
Reply


Messages In This Thread
RE: Modbus RTU Serial Enabled/Disabled by Script - by EjvindHald - Yesterday, 09:55

Forum Jump: