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.

UDP commands
#8
ok. I tried this:

function cmd (mioff)
-- edit ip address and port
ip = '192.168.1.32'
port = 5987

 local sock = require('socket').udp()
 if sock then
   sockConfusedendto(cmd, ip, port)
sockConfusedettimeout(200)
   data = sock:receive()
   sock:close()
 end
return data
end
log(data)

as event function I used this following:

require("user.milight")
mioff = string.char(0x31,0x00,0x00,0x00,0x03,0x04,0x00,0x00,0x00,0x01)
cmd (mioff)

But I received the error below:

User Library "Milight", Line 8: bad argument #1 to 'sendto' (string expected, got function).

Thanks.
Reply


Messages In This Thread
UDP commands - by Domoticatorino - 08.12.2016, 14:42
RE: UDP commands - by admin - 08.12.2016, 14:48
RE: UDP commands - by Domoticatorino - 09.12.2016, 18:10
RE: UDP commands - by buuuudzik - 12.12.2016, 13:22
RE: UDP commands - by Erwin van der Zwart - 12.12.2016, 14:04
RE: UDP commands - by Domoticatorino - 12.12.2016, 14:23
RE: UDP commands - by admin - 12.12.2016, 14:26
RE: UDP commands - by Domoticatorino - 15.12.2016, 18:43
RE: UDP commands - by admin - 15.12.2016, 19:02
RE: UDP commands - by Domoticatorino - 15.12.2016, 20:48
RE: UDP commands - by Domoticatorino - 02.01.2017, 18:24
RE: UDP commands - by Erwin van der Zwart - 02.01.2017, 20:12
RE: UDP commands - by Domoticatorino - 03.01.2017, 12:07
RE: UDP commands - by admin - 03.01.2017, 13:22
RE: UDP commands - by Domoticatorino - 04.01.2017, 09:27
RE: UDP commands - by Domoticatorino - 04.01.2017, 16:01
RE: UDP commands - by Domoticatorino - 14.03.2017, 22:36
RE: UDP commands - by Erwin van der Zwart - 15.03.2017, 00:29
RE: UDP commands - by Domoticatorino - 15.03.2017, 15:57
RE: UDP commands - by Erwin van der Zwart - 15.03.2017, 21:45
RE: UDP commands - by Domoticatorino - 19.03.2017, 21:28
RE: UDP commands - by gilles38 - 01.05.2017, 12:38
RE: UDP commands - by Domoticatorino - 08.06.2017, 17:30

Forum Jump: