By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,589 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,589 IT Pros & Developers. It's quick & easy.

Collect data from serial port - rs232 to browser

P: n/a

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.

Jan 12 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
Jan 13 '07 #2

P: n/a
Dear Mikegtr,

have a look at the following links, they might help:

http://www.weberdev.com/get_example-4347.html
http://www.mikrocontroller.net/artic..._benutzen_(PHP)

Have fun

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.
Jan 13 '07 #3

P: n/a

It might have been useful to tell us what platform you are running on.
I'm working on Win xp , running apache 2.2 , mysql and php latest
versions (5th in both cases).
I'm now trying the solutions provided above ( thx by the way).
We'll see what good will come from that :)
If I do it - i'll let you know :)

Jan 15 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.