I'm new to lua and I'm trying to receive data from the port, ttyACM0, I can write to the port by:

```
wserial = io.open("/dev/ttyACM0","w")
wserial:write("hellloooo")
wserial:flush()

```

I thought since I can write to it in the same way as I would write to a file that I could read it in the same way as I would read a file. But when I try to read it (using the code below) I just end up in an infinite loop.

```
rserial=io.open("/dev/ttyACM0","r")
while chaine==nil do
  chaine=rserial:read()
  rserial:flush()
end
print(chaine)

```

So my question is what am I doing wrong, how do I read from the port, ttyACM0?