Re: [opensuse] howto - Read Data from Serial Port?



David C. Rankin wrote:
Banning someone out of personal spite is uncalled for fascism wrote:
David C. Rankin wrote:
Listmates,

A linux question. I have a phone system that will output call logs through an rs-232 cable. I would like to write a script that will read the data from the serial port and input it into a mysql table.

cat /dev/ttyS_ | data_storing_program


Thanks Theo, and Mr. fascism,

I will look at the python interface and definitely see if I can make the cat script work.

Another question, If I write a small script and "sleep" for 30 seconds or so during the loop to cut down on racing the loop, will that have any unintended consequences I should look out for?


You might want to drop that down to 10 seconds.

On the other hand, if you just write the program as if it's
taking input from the keyboard, the process will automatically
"block on I/O" and go to sleep until there is data ready
for it to read.

Try both with and without explicit sleep statements.

I'm pretty sure that I/O blocking will prevent the sort
of problem that you're anticipating.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Sleep command quitting
    ... It cannot be that the `sleep` command is terminating. ... That script was popular when I started working at SCO Support in 1989. ... it doesn't really hold the settings you specify. ... anything else comes along and makes further changes, the holdopen script ...
    (comp.unix.sco.misc)
  • Re: WScript.dll not working
    ... But, when i call a script indirectly in my application's exe's context, then it doesn't repond further. ... the sleep method is coded into the ... could call the sleep api directly from script. ...
    (microsoft.public.scripting.vbscript)
  • my script crashes when I try to rename the file!
    ... OK, thanks, but the script does not seem to rename the files. ... You can set the working directory from within your Perl ... # sleep 1; ... to the string in this particular file that I want to match. ...
    (perl.beginners)
  • More on perl like tail
    ... If I write my script based on this code... ... But first about that sleep comment. ... I see 7-8 lines output to the tail -f slpipe command, ...
    (perl.beginners)
  • Re: Rename File Using Strring Found in File?
    ... OK, thanks, but the script does not seem to rename the files. ... # sleep 1; ... to the string in this particular file that I want to match. ...
    (comp.lang.perl.misc)