25.10.2016, 08:51
Correction: default receive pattern is '*l' - a single line, not the whole result. Receive() will return partial result as a third return value when an error occurs (that's why you are getting an empty string). So you can use '*a' pattern to receive everything until timeout occurs. This is not the most efficient way, but it will work
As for hex logging, new firmware will have loghex() function to make this easier.
Code:
data, err, partial = client:receive('*a')
-- error
if not data then
data = partial
end
-- do something with data that's available
if data then
parsedata(data)
end
client:close()
As for hex logging, new firmware will have loghex() function to make this easier.