Collect data from serial port - rs232 to browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mikegtr

    Collect data from serial port - rs232 to browser


    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.

  • Colin McKinnon

    #2
    Re: Collect data from serial port - rs232 to browser

    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.

    Comment

    • Martin Mandl - m2m tech support

      #3
      Re: Collect data from serial port - rs232 to browser

      Dear Mikegtr,

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


      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.

      Comment

      • Mikegtr

        #4
        Re: Collect data from serial port - rs232 to browser


        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 :)

        Comment

        Working...