Hi,
Is it possible to send an UDP package from lua?
Is it possible to add new devices/lights directly from lua?
Sending UDP with lua
Moderator: leecollings
-
- Posts: 5
- Joined: Thursday 18 May 2017 17:07
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Sending UDP with lua
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")
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")
- papoo
- Posts: 126
- Joined: Friday 22 January 2016 22:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10
- Location: France
- Contact:
Re: Sending UDP with lua
@holdestmade : thanks for this function
a question : where can i find socket for lua you use?
a question : where can i find socket for lua you use?
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: Sending UDP with lua
You willfind the socket library here - http://www.domoticz.com/wiki/Remote_Con ... _Libraries.
Raspberry Pi 2 B - 2A@5V 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
Who is online
Users browsing this forum: No registered users and 1 guest