1. How to access serial port data in Linux using Euphoria?

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

new topic     » topic index » view message » categorize

2. Re: How to access serial port data in Linux using Euphoria?

You need to access /dev/ttyS1, etc. There's lots of C howtos and tutorials on the web. Search Google for linux serial port. blink

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: How to access serial port data in Linux using Euphoria?

I was wondering the same thing. The problem I'm having is I don't understand how to set the Baud Rate and such...

new topic     » goto parent     » topic index » view message » categorize

4. Re: How to access serial port data in Linux using Euphoria?

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: How to access serial port data in Linux using Euphoria?

ChrisB said...

open the port for read or write eg open("
dev
ttyS0", "r")

Looks like Creole markup got the best of you. getlost

integer fn 
fn = open( "/dev/ttyS0", "r" ) 


-Greg

new topic     » goto parent     » topic index » view message » categorize

6. Re: How to access serial port data in Linux using Euphoria?

Yes it did. Ta.

new topic     » goto parent     » topic index » view message » categorize

7. Re: How to access serial port data in Linux using Euphoria?

Thanks,

I will start some tests here. It seems much simpler than in Windows.

Rubens

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu