Pretty sure I know where your error is in this code:
scr.SetProperty("testLabel","Label",p:read(12, 5))
LUA allows you to do multiple returns from a function. This means when the function exits, it can have a statement like:
myfunction()
...
return a,b,c
end
When you call this function you might do something like this:
x, y, z = myfunction()
Where x gets the value returned by "a", y the value for "b", and z the value for "c". You don't need to use all 3, however they always return in this order.
The LUA serial function read() returns 3 variables as shown below:
e, data_read, size = p:read(length, timeout)
"e" is the error code, "data_read" is the data, and "size" is the length of the returned string.
When you called this function inside another function, you only grabbed the first returned value, in this case the error code not the data you wanted.
To make this work, you'll need to do something like this:
e, string = p:read(12, 5)
scr.SetProperty("testLabel","Label",string)
Note that in this case I captured the first return "e" but did nothing with it and I didn't even bother to capture the 3rd return "size".