Serial I/O Support

classic Classic list List threaded Threaded
34 messages Options
12
b g
Reply | Threaded
Open this post in threaded view
|

Serial I/O Support

b g
I need to do serial I/O in LUA.
Should I use Serial I/O from LUASYS or http://lua-users.org/wiki/SerialCommunication.
In either case, how do I build and install LUASYS on a Windows XP machine?
I am currently using LUA 5.1

Bruce
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

Tiago Katcipis-2


On Mon, Jan 4, 2010 at 4:06 PM, b g <[hidden email]> wrote:
I need to do serial I/O in LUA.
Should I use Serial I/O from LUASYS or http://lua-users.org/wiki/SerialCommunication.
In either case, how do I build and install LUASYS on a Windows XP machine?

Since it is on windows, this might help you:

http://luaforwindows.luaforge.net/
 
I am currently using LUA 5.1

Bruce

best regards,
Katcipis

Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

Petr Štetiar
In reply to this post by b g
b g <[hidden email]> [2010-01-04 13:06:30]:

Hi,

> I need to do serial I/O in LUA.
> Should I use Serial I/O from LUASYS or
> http://lua-users.org/wiki/SerialCommunication.
> In either case, how do I build and install LUASYS on a Windows XP machine?
> I am currently using LUA 5.1

you can download Lua for Windows[1] and unpack there my luars232 library[2].
In examples you can find how to use it. More in my test suite[3]. Sorry, no
manual yet.

-- ynezz

1. http://luaforwindows.luaforge.net/
2. http://cloud.github.com/downloads/ynezz/librs232/luars232-lua_for_windows.zip
3. http://github.com/ynezz/librs232/blob/master/bindings/lua/test.lua
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

RJP Computing


On Tue, Jan 5, 2010 at 2:27 AM, Petr Štetiar <[hidden email]> wrote:
b g <[hidden email]> [2010-01-04 13:06:30]:

Hi,

> I need to do serial I/O in LUA.
> Should I use Serial I/O from LUASYS or
> http://lua-users.org/wiki/SerialCommunication.
> In either case, how do I build and install LUASYS on a Windows XP machine?
> I am currently using LUA 5.1

you can download Lua for Windows[1] and unpack there my luars232 library[2].
In examples you can find how to use it. More in my test suite[3]. Sorry, no
manual yet.

-- ynezz

1. http://luaforwindows.luaforge.net/
2. http://cloud.github.com/downloads/ynezz/librs232/luars232-lua_for_windows.zip
3. http://github.com/ynezz/librs232/blob/master/bindings/lua/test.lua

Fantastic! After I do some testing I am going to add this to the Lua for Windows package. If all goes well expect it in the next release.

A small simple manual would be huge though. All other modules have something.
--
Regards,
Ryan
Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
In reply to this post by b g
> I need to do serial I/O in LUA.
> Should I use Serial I/O from LUASYS or http://lua-users.org/wiki/SerialCommunication.
> In either case, how do I build and install LUASYS on a Windows XP machine?
> I am currently using LUA 5.1

I have written my own library.  There is no documentation except for "clean" code.  I have attached my library.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.

serialcom.c (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

KHMan
King, Mike wrote:
>> I need to do serial I/O in LUA.
>> Should I use Serial I/O from LUASYS or http://lua-users.org/wiki/SerialCommunication.
>> In either case, how do I build and install LUASYS on a Windows XP machine?
>> I am currently using LUA 5.1
>
> I have written my own library.  There is no documentation except for "clean" code.  I have attached my library.
>
> CONFIDENTIALITY NOTICE: [snip]

Ah, but you have a "CONFIDENTIALITY NOTICE"... Very few people
will dare to use your code, unless you tag it with a suitable license.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Reply | Threaded
Open this post in threaded view
|

Re[2]: Serial I/O Support

Bulat Ziganshin
Hello KHMan,

Tuesday, January 5, 2010, 7:41:37 PM, you wrote:

> Ah, but you have a "CONFIDENTIALITY NOTICE"... Very few people
> will dare to use your code, unless you tag it with a suitable license.

even w/o NOTICE, default code license is "look but don't touch",
anything more liberal should be stated explicitly. and may require
permission from employeer

--
Best regards,
 Bulat                            mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

KHMan
Bulat Ziganshin wrote:

> Hello KHMan,
>
> Tuesday, January 5, 2010, 7:41:37 PM, you wrote:
>
>> Ah, but you have a "CONFIDENTIALITY NOTICE"... Very few people
>> will dare to use your code, unless you tag it with a suitable license.
>
> even w/o NOTICE, default code license is "look but don't touch",
> anything more liberal should be stated explicitly. and may require
> permission from employeer

Yes, I should have rephrased it better.

Although it's pretty much standard coding for a Lua library, IIRC
a particular expression of standard coding can be copyrighted. So,
it's better to make things unambiguous.

Perhaps Mike would like to put it up on the Lua wiki, replete with
a suitably libre license.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
>> Ah, but you have a "CONFIDENTIALITY NOTICE"... Very few people
>> will dare to use your code, unless you tag it with a suitable license.

> Perhaps Mike would like to put it up on the Lua wiki, replete with
> a suitably libre license.

Sorry, I have no control on what our mail server adds to outgoing messages.  I'll try adding it to the wiki with some sample code and with a "free" license.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

KHMan
King, Mike wrote:
>>> Ah, but you have a "CONFIDENTIALITY NOTICE"... Very few people
>>> will dare to use your code, unless you tag it with a suitable license.
>
>> Perhaps Mike would like to put it up on the Lua wiki, replete with
>> a suitably libre license.
>
> Sorry, I have no control on what our mail server adds to outgoing messages.  I'll try adding it to the wiki with some sample code and with a "free" license.

Thanks!!!
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
>> Sorry, I have no control on what our mail server adds to outgoing messages.  I'll try adding
>> it to the wiki with some sample code and with a "free" license.

> Thanks!!!

I have begun the process of registering a project on LuaForge.  I'm now waiting for approval.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
> I have begun the process of registering a project on LuaForge.  I'm now waiting for approval.

It has been approved.  I'll need some time to configure the new project.  Hopefully, sometime tomorrow people can check it out at http://luaserial.luaforge.net/.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

RJP Computing


On Tue, Jan 5, 2010 at 2:25 PM, King, Mike <[hidden email]> wrote:
> I have begun the process of registering a project on LuaForge.  I'm now waiting for approval.

It has been approved.  I'll need some time to configure the new project.  Hopefully, sometime tomorrow people can check it out at http://luaserial.luaforge.net/.


Any thought about making this cross-platform? I really need Linux and Windows. 
--
Regards,
Ryan
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

Petr Štetiar
In reply to this post by RJP Computing
RJP Computing <[hidden email]> [2010-01-05 10:43:31]:

> On Tue, Jan 5, 2010 at 2:27 AM, Petr Štetiar <[hidden email]> wrote:
>
> Fantastic! After I do some testing I am going to add this to the Lua for
> Windows package. If all goes well expect it in the next release.

Great!

> A small simple manual would be huge though.

LFW is a good reason to make manual, so I'll add something.

-- ynezz
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

Petr Štetiar
In reply to this post by RJP Computing
RJP Computing <[hidden email]> [2010-01-05 10:43:31]:

> [snip] After I do some testing [snip]

Hi,

please test with the new release v1.0.0[1], it contains some fixes[2] (mainly
cosmetic). Thanks.

-- ynezz

1. http://cloud.github.com/downloads/ynezz/librs232/luars232_v1.0.0-lua_for_windows.zip
2. http://github.com/ynezz/librs232/commit/879f398271c8e80d55882fec6af9f08610a93521
Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
In reply to this post by RJP Computing
> Any thought about making this cross-platform? I really need Linux and Windows. 

I don't know Linux will enough so probably not.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

steve donovan
On Wed, Jan 6, 2010 at 4:42 PM, King, Mike <[hidden email]> wrote:
>> Any thought about making this cross-platform? I really need Linux and Windows.
>
> I don't know Linux will enough so probably not.

What's so cool about serial on Linux is that you really can just open
/dev/ttyS0 (aka 'COM1') and treat it like any file (tho remember to
f:flush() occaisionally). Except, you need to set the comm parameters
first.  There are several command-line utilities for that, can just
shell out to them using os.execute()

OK, this is not exactly portable.  I do have Linux serial
terminal-setting code, I'll have a look at Mike's interface and see
how it can fit in.

steve d.
Reply | Threaded
Open this post in threaded view
|

Re: Serial I/O Support

BogdanM


On Wed, Jan 6, 2010 at 4:51 PM, steve donovan <[hidden email]> wrote:
On Wed, Jan 6, 2010 at 4:42 PM, King, Mike <[hidden email]> wrote:
>> Any thought about making this cross-platform? I really need Linux and Windows.
>
> I don't know Linux will enough so probably not.

What's so cool about serial on Linux is that you really can just open
/dev/ttyS0 (aka 'COM1') and treat it like any file (tho remember to
f:flush() occaisionally). Except, you need to set the comm parameters
first.  There are several command-line utilities for that, can just
shell out to them using os.execute()

You could do this, but you don't really need to. Most (if not all) you need to know about serial programming under Linux (and other POSIX compliant systems) is here :

http://www.easysw.com/~mike/serial/serial.html

I already have a C serial library that works both under Windows and Linux (I'm using it for eLua), but it's quite small at the moment, and not really tested. If there is interest, however, I can make it public (which I'll do anyway, but I can also try make it public as a separate library, not only as part of eLua). I think it might also work under OSX, but I have yet to test this.

Best,
Bogdan


Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
In reply to this post by steve donovan
>>> Any thought about making this cross-platform? I really need Linux and Windows.

>> I don't know Linux will enough so probably not.

> What's so cool about serial on Linux is that you really can just open
> /dev/ttyS0 (aka 'COM1') and treat it like any file (tho remember to
> f:flush() occaisionally). Except, you need to set the comm parameters
> first.  There are several command-line utilities for that, can just
> shell out to them using os.execute()

> OK, this is not exactly portable.  I do have Linux serial
> terminal-setting code, I'll have a look at Mike's interface and see
> how it can fit in.

I agree the *NIX-like way of doing things is cool.  I would like to know how serial communication ways in Linux.  I would imagine the API is much more powerful giving the history.  As a personal project, I would like to learn more about it and maybe make my library cross-platform.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

RE: Serial I/O Support

King, Mike
In reply to this post by BogdanM
> You could do this, but you don't really need to. Most (if not all) you need to know
> about serial programming under Linux (and other POSIX compliant systems) is here :

> http://www.easysw.com/~mike/serial/serial.html

> I already have a C serial library that works both under Windows and Linux (I'm using
> it for eLua), but it's quite small at the moment, and not really tested. If there is
> interest, however, I can make it public (which I'll do anyway, but I can also try make
> it public as a separate library, not only as part of eLua). I think it might also work
> under OSX, but I have yet to test this.

That looks like some good information.  I'd be interested in looking at your code.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
12