1. How to access serial port data in Linux using Euphoria?
- Posted by Rubens Aug 29, 2008
- 1024 views
- Last edited Aug 30, 2008
Hi,
Does anyone have an example of how can I access serial port(com1, com2, ...) data in Linux using Euphoria?
I do this in Windows using the Pcomm.dll library, but in linux I have no idea how to do that.
Thanks
Rubens
2. Re: How to access serial port data in Linux using Euphoria?
- Posted by ghaberek (admin) Aug 29, 2008
- 1079 views
- Last edited Aug 30, 2008
You need to access /dev/ttyS1, etc. There's lots of C howtos and tutorials on the web. Search Google for linux serial port.
-Greg
3. Re: How to access serial port data in Linux using Euphoria?
- Posted by ryanj Aug 29, 2008
- 1050 views
- Last edited Aug 30, 2008
I was wondering the same thing. The problem I'm having is I don't understand how to set the Baud Rate and such...
4. Re: How to access serial port data in Linux using Euphoria?
- Posted by ChrisB (moderator) Aug 30, 2008
- 1033 views
Hi
Set the serial port wih setserial
open the port for read or write eg open("
dev
ttyS0", "r") (may need to be root for this, or allow program to have access)
get bytes from the serial port with getc or gets
put bytes with put putc or puts
Remember that on linux all files, terminals, ports access etc are just streams of data, you just have to tell the computer where to put them. While the above is obviously extremely simplified, its a good starting point for experiments.
Read everything else you can, there's no simple one size fits all solution.
If you're wanting to do modem stuff just use mgetty
Chris
5. Re: How to access serial port data in Linux using Euphoria?
- Posted by ghaberek (admin) Aug 30, 2008
- 1045 views
open the port for read or write eg open("
dev
ttyS0", "r")
Looks like Creole markup got the best of you.
integer fn fn = open( "/dev/ttyS0", "r" )
-Greg
6. Re: How to access serial port data in Linux using Euphoria?
- Posted by ChrisB (moderator) Aug 30, 2008
- 1027 views
Yes it did. Ta.
7. Re: How to access serial port data in Linux using Euphoria?
- Posted by Rubens Aug 31, 2008
- 1003 views
Thanks,
I will start some tests here. It seems much simpler than in Windows.
Rubens