Helen FornazierThanks!But I have all this packages installed. Do you know if there is something that I am missing?I got this message :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
*** 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 foundI check the configure file, it checks if I have lua in my system, but as I am cross compiling I think it should just get the headers and not the compiling flags.Now I am testing ser2net, it works really well, I tested with telnet. I just have a simple (maybe stupid) question, I am really new in Lua : In my Lua code, when I write:
> require "nixio"
> nixio.connect(localhost, 2001, "inet", "stream")
> so = nixio.connect(localhost, 2001, "inet", "stream")
nixio socket 4
stdin:1: bad argument #1 to 'send' (nixio.socket expected, got string)
[C]: in function 'send'
stdin:1: in main chunk
the variable so is not a nixio.socket ?
On Fri, Mar 29, 2013 at 2:43 PM, <firstname.lastname@example.org> wrote:
I have successfully used ynezz to talk to a serial port on an Arduino, about a year ago.
Sent from my new BlackBerry Z10
> -----Original Message-----
> From: email@example.com [mailto:firstname.lastname@example.org] On
> Behalf Of Helen Fornazier
> Sent: vrijdag 29 maart 2013 12:04
> To: email@example.com
> Subject: Lua and Serial Port
> I am new in Lua and I just start developing for OpenWRT in a Dragino
> 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 :
> When I execute the code :
> print("Dragino Uart Test started\n")
> while 1 do
> print(serialin:read()) --print the data
> 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 https://github.com/ynezz/librs232/
Alternatively, I read somewhere that the upcoming release of LuaSocket also supports serial connections. See https://github.com/diegonehab/luasocket
> Thank you for your help, I appreciate it.
> Helen Fornazier