24.04.2016, 22:02
(This post was last modified: 24.04.2016, 22:04 by Erwin van der Zwart.)
Hi,
Try this to see the HEX values from cmd after string.char(0x01, 0x00, 0xA9, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x9A):
Are your commands processed? Sometimes you need to end a command like this:
If you expect an answer from the socket after sending a command you need to switch to receive mode like this:
Good luck!
BR,
Erwin
Try this to see the HEX values from cmd after string.char(0x01, 0x00, 0xA9, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x9A):
Code:
response_tbl['cmd']=lmcore.strtohex(cmd)
Are your commands processed? Sometimes you need to end a command like this:
Code:
res, err = sock:send(cmd .. '\r')
If you expect an answer from the socket after sending a command you need to switch to receive mode like this:
Code:
s, status, partial = sock:receive(1024) -- 1024 is expected response length and be sure to set socket timeout like this sock:settimeout(2) before sending a command
Good luck!
BR,
Erwin