Page 1 of 1

Sending UDP with lua

Posted: Monday 09 January 2017 22:31
by JelteV
Hi,

Is it possible to send an UDP package from lua?
Is it possible to add new devices/lights directly from lua?

Re: Sending UDP with lua

Posted: Thursday 29 June 2017 10:36
by holdestmade
This is what I use for sending UDP:

function sendUDP(msg)
local socket = require "socket"
local udp = assert(socket.udp())
assert(udp:sendto(msg, "192.168.1.100", 9999))
assert(udp:close())
end



sendUDP("HELLO")

Re: Sending UDP with lua

Posted: Saturday 01 July 2017 14:30
by papoo
@holdestmade : thanks for this function
a question : where can i find socket for lua you use?

Re: Sending UDP with lua

Posted: Monday 03 July 2017 8:30
by simonrg
You willfind the socket library here - http://www.domoticz.com/wiki/Remote_Con ... _Libraries.

Re: Sending UDP with lua

Posted: Wednesday 05 July 2017 20:29
by papoo
thanks