Presently I am using the library/module "luars232" installed via luarocks. I am using this on a Debian Linux machine, on the USB-serial port "/dev/ttyUSB0".
I can access this port perfectly well using tools like picocom or minicom, i.e. have proper bi-directional communication.
However, when I try this snippet:
rs232 = require("luars232")
port_name = "/dev/ttyUSB0"
local e, p = rs232.open(port_name)
print(e, p)
[/code]
I get the output:
2 nil
Indicating an error in opening the port. One thing that I am pretty sure of, is that this isn't a permission
issue. Since I have already added my userid to the "dialout" group, and
use the "picocom" tool similarly. Also, I am sure that the port is not in use by any other app/tool at the time of running the lua snippet.
However, I am not sure how to debug this further.