lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all!

I'm planning to do some experiments involving serial communication between a PC (Windows 7) and an Arduino UNO board (UART standard protocol via virtual COM ports over USB connection) using Lua on PC side.

I've got very little time at my disposal for that, therefore I'd need a library for Lua meeting the following requirements:

* Should run on Win32 architecture.

* Lua 5.3 support.

* Easy to use: I don't need advanced features, but I've not the time to learn how exactly a serial connection must be set up at lower levels. Ideally I should be able to make a call to connect to a COM port, possibly specifying the connection parameters (baud rate, parity, etc.) and then make calls that can retrieve (send) bytes from (to) the port (maybe handling blocking/non-blocking I/O as well)

* Basic documentation (it would be enough to have some well documented example scripts and a reference for the available functions.)

* If not already available in binary form, it should be:
** easily compilable with MINGW (hopefully TDM-GCC, which is the compiler I use). ** simple makefile-driven compilation, with no need of other tools (like LuaRocks, Autotools, etc.)


Is there something that can meet my needs? I've briefly searched the WIKI, but what I found doesn't seem to meet all those requirements. The module by D.Manura uses Alien, which in turn must be installed via LuaRocks (years ago I tried installing Alien it without LR and it was a time-consuming failure). LuaRS232 seems stuck back at Lua 5.1 and moreover it seems it needs autotools.

Any hint and suggestion will be greatly appreciated!

Cheers!


-- Lorenzo


P.S.: as a **last resort**, I'm also willing to write a quick and dirty C module which binds to Win32API functions, but I'm not really a Win32 API wizard and I'd appreciate pointers to step by step examples on how to setup and manage a COM connection in C using Win32 API.