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 Server logging writing IPs
#2
You should use this script: https://forum.logicmachine.net/showthread.php?tid=4288

Modify the handler function in the resident script to alert IP/port for each connection:
Code:
local function handler(sock)
  local ip, port = sock:getpeername()
  alert('modbus connection from: %s:%d', ip, port)

  copas.setErrorHandler(log)

  sock = copas.wrap(sock)
  sock:settimeout(60)

  while true do
    local res, err = mb.tcphandler(sock)
    if not res then
      break
    end
  end

  sock:close()
end
Reply


Messages In This Thread
RE: Modbus Server logging writing IPs - by admin - 19.10.2023, 09:09

Forum Jump: