Sending UDP with lua

Post Reply
JelteV
Posts: 8
Joined: Wednesday 04 January 2017 20:55
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Sending UDP with lua

Post by JelteV » Monday 09 January 2017 23:31

Hi,

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

holdestmade
Posts: 5
Joined: Thursday 18 May 2017 17:07
Target OS: Windows
Domoticz version:
Contact:

Re: Sending UDP with lua

Post by holdestmade » Thursday 29 June 2017 10:36

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")

User avatar
papoo
Posts: 42
Joined: Friday 22 January 2016 23:14
Target OS: Raspberry Pi
Domoticz version: beta
Location: France
Contact:

Re: Sending UDP with lua

Post by papoo » Saturday 01 July 2017 14:30

@holdestmade : thanks for this function
a question : where can i find socket for lua you use?

simonrg
Posts: 1054
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version:
Location: North East England
Contact:

Re: Sending UDP with lua

Post by simonrg » Monday 03 July 2017 8:30

You willfind the socket library here - http://www.domoticz.com/wiki/Remote_Con ... _Libraries.
Raspberry Pi 2 B - [email protected] PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

User avatar
papoo
Posts: 42
Joined: Friday 22 January 2016 23:14
Target OS: Raspberry Pi
Domoticz version: beta
Location: France
Contact:

Re: Sending UDP with lua

Post by papoo » Wednesday 05 July 2017 20:29

thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests