Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
fogmajor 0
Good afternoon
I am trying to send an ascii string to a UDP device via a Lua Scene without success.
Firstly can someone tell me if this is possible as there seem to be conflicting data.
I have scoured the forums and google without success, below is my latest attempt.
This is the error I get [DEBUG] 16:08:03: 2021-02-14 16:08:03.316379 [ fatal] Unknown exception: /opt/fibaro/scenes/23.lua:22: attempt to index global 'Net' (a nil value)
I am new to Lua so please excuse my lack of understanding
Thank you in advance
Regards
Andrew
if (
( tonumber(fibaro:getValue(141, "value")) > 0 )
)
then
socket = Net.FUdpSocket()
local ip = '192.168.0.251'
local port = 3671
local data = string.char(0xaf, 0xbf, 0xcf, 0xdf, 0xef, 0xff)
socket:setReadTimeout(1000)
local bytes, errorCode = socket:write(data, ip, port)
if errorCode == 0 then
fibaro:log("sent")
else
fibaro:log("failed")
end
socket = nil
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.