26.05.2020, 11:57
Since you have a log call between write and flush you basically have adding a random delay. Flush will discard all buffered data but the TV might not have sent the response completely.
You should remove flush after write and use read with timeout. Something like this:
You should remove flush after write and use read with timeout. Something like this:
Code:
res, err = port:read(100, 1)
log(res, err)