You are here: Re: Collect data from serial port - rs232 to browser « PHP Programming Language « IT news, forums, messages
Re: Collect data from serial port - rs232 to browser

Posted by Colin McKinnon on 01/12/07 23:55

Mikegtr wrote:

>
> I need to collect and send data from a rs232 device- it is a simple
> temperature controller.
> I need to be able to collect actual temperature ,store the result in
> database (mysql) and show it in browser in realtime (or with max 10 sec
> delay).
> Is there any function/script or smth that could help do that without
> external software - I don't want to write a small program in e.g. C
> and then collect it from database. Although it is also an option , but
> i would like to do it in php.

It might have been useful to tell us what platform you are running on.

On a Linux/*nix box its certainly no problem to write a daemon in PHP (but
writing something which isolates itself from the foreground process can be
a bit tricky - but there are wrapper programs that will do that). AFAIK you
also won't be able to call the ioctls to set the serial port behaviour
directly from a stock PHP - but most *nix have tools for this (on Linux use
setserial).

Updating the stuff in real time on a browser is a bit more tricky. You could
set the page to automatically refresh every 10 seconds, or just update a
div using AJAX.

HTH

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация