02.09.2020, 12:06
(02.09.2020, 11:43)admin Wrote: You can convert hex char codes to a string like this:
Code:hs = string.char(0x45, 0x53, 0x43, 0x2F, 0x56, 0x50, 0x2E, 0x6E, 0x65, 0x74, 0x10, 0x03, 0x00, 0x00, 0x00, 0x00)
Then you need to send it before the actual command:
Code:res, err = sock:send(hs)
res, err = sock:send(cmd)
Note that anything between <> is not a string value but an ASCII character name, so 'PWR OFF<CR>' should actually be 'PWR OFF\r'
Awesome - thank you very much for you help!