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.

Send Hex Values to an ser2net device
#1
Hi,

I want to control my samsung smart TV via Visu/KNX. For that I setuped a Linux device with ser2net (local serial RS232 to TV) and connected them to my TV.
The debug console from TV over ser2net works perfectly, but I can't send some hex values to control functions.

How can I send via telnet from spaceLYnk some hex values like "082200000001d5 " or in this syntax "\x08h\x22h\x00h\x00h\x00h\x01h\xd5h"

Can somebody give me one example?

with this command I get an connection: 

telnet 192.168.100.55 4001

Thx forwards

Regards
Habib
Reply
#2
Try this:
Code:
require('socket')

ip = '192.168.1.11'
port = 1234
data = string.char(0x08, 0x22, 0x00, 0x00, 0x00, 0x01, 0xd5)

sock = socket.tcp()
sock:settimeout(5)

res, err = sock:connect(ip, port)

if res then
  res, err = sock:send(data)

  if not res then
    alert('send error ' .. tostring(err))
  end
else
  alert('connect error ' .. tostring(err))
end

sock:close()
Reply


Forum Jump: