24.08.2017, 22:47
(24.08.2017, 17:51)admin Wrote: Resident script:
Code:if not server then
require('socket')
server = socket.udp()
server:setsockname('*', 8891)
server:settimeout(1)
end
data = server:receive()
if data then
loghex(data)
end
Super, thanks admin.
but what I need to add to script, if an example I send ASCII 'group 1/1/1 on' (HEX 67 72 6f 75 70 20 31 2f 31 2f 31 20 6f 6e) to LM from other device and LM set group 1/1/1 to "TRUE" or to "1" or to something else regarding this group data type? And what sleep interval better to set for this resident script or it does not matter?? No so experienced with LUA, how convert "data" from this script and compare with my ASCII or HEX I send to LM to make changes in groups regarding received data??
By the way found free packet sender: https://packetsender.com/download
can be used to send as example data to LM using UDP for some testing. Works fine but I see some delays, but I send data to LM over WiFi...