Lua Read Write Serial Port
Oscilloscope service manual. The Serial library reads and writes data to and from external devices one byte. The serial port is a nine pin I/O port that exists on many PCs and can be. 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.
Thank you very much for all of your answers. I tried to install ynezz/librs232, but when I execute: >./configure --build=i686-pc-linux-gnu --host=mips-openwrt-linux-uclibc --target=mips-openwrt-linux-uclibc --prefix=$PWD/dist I got this message: configure: WARNING: *** Lua (>=5.0) headers and/or librairies couldn't be found in your system. *** Try to install liblua, liblualib and liblua-dev with your software package manager. *** librs232 will be built without Lua bindings library./configure: line 11854: 1: command not found But I have all this packages installed. Lks matematika kls 6 sd.
Do you know if there is something that I am missing? > -----Original Message----- > From: [mailto:] On > Behalf Of Helen Fornazier > Sent: vrijdag 29 maart 2013 12:04 > To: > Subject: Lua and Serial Port > > Hello!
> > I am new in Lua and I just start developing for OpenWRT in a Dragino > platform. > > I want to develop an application that reads data from Uart and print it in > a Luci based web page. > But I am having a problem that I described here: > > back-when-i-read-from-serial-port-why > When I execute the code: > print('Dragino Uart Test started n') > while 1 do > serialin=io.open('/dev/ttyS0','r') > print(serialin:read()) --print the data > serialin:close() > end > I read the serial port but I receive an echo too and the read() waits > until a new line character to return.
> > > There is any other way to read from a serial port? Have you tried the serial libraries? See Alternatively, I read somewhere that the upcoming release of LuaSocket also supports serial connections. See > Thank you for your help, I appreciate it. > > -- > Helen Fornazier > • References: •, Helen Fornazier •, Thijs Schreijer •, mlepage •, Helen Fornazier • Prev by Date: • Next by Date: • Previous by thread: • Next by thread: • Index(es): • •.
