Re: Lua, and accessing nodes in /dev/ (Lua in Linux)...
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua, and accessing nodes in /dev/ (Lua in Linux)...
- From: Ryanne Thomas Dolan <rtdmr6@...>
- Date: 2006年2月08日 22:31:50 -0600
Is it possible that your script doesn't have read/write permission on this device node? I've had this simple problem in the past, and it is easy to overlook.
If you wanna take a look at my GPS code, we have it hosted on our SVN server:
https://robotics.umr.edu:7651/svn/lua/gps.lua
https://robotics.umr.edu:7651/svn/lua/com.lua
I don't usually like to post work I haven't tested a million times, but maybe that will help you out a bit. Sorry it isn't commented yet; I will have someone on the team comment it for me at some point...
On Thu, 2006年02月09日 at 15:19 +1100, Matthew Percival wrote:
G'Day,
I think I have sort of worked out why I am not reading anything back:
it does not seem the script is sending anything in the first place. If
I do `print (tty)', I get back `file (0x8051688)', so it seems OK at
that point, but if I wrap a print() around the write() call I get this:
nil Bad file descriptor 9
> I use Lua with the UMR Robotics Team to interface with several
> different devices such as GPS receivers, microcontrollers, etc. So
> long as you don't want it to be portable, it is easy in Linux with
> stty:
I am trying to check the status of a GPS Modem, and the script will
only ever be run from Linux, so it sounds like you are doing something
very similar to what I am trying to do (which also suggests it does
work). I tried copying your code (with minor changes for my setup), and
added a write at the end, but it returned the same error.
-- Matthew
- References:
- Lua, and accessing nodes in /dev/ (Lua in Linux)..., Matthew Percival
- Re: Lua, and accessing nodes in /dev/ (Lua in Linux)..., David Given
- Re: Lua, and accessing nodes in /dev/ (Lua in Linux)..., Matthew Percival
- Re: Lua, and accessing nodes in /dev/ (Lua in Linux)..., Ryanne Thomas Dolan
- Re: Lua, and accessing nodes in /dev/ (Lua in Linux)..., Matthew Percival