473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

connecting to a tcp port and displaying the data


I am doing a project with a embedded processor. I have a program that
can take the data from the serial port and send it out a tcp port of
my choosing. I want to be able to read that stream and display in on
a website.

The data is going to be really basic just a couple of temperatures. I
just want to have two text boxes that update the temperature every
couple minutes or so. I have read some information on the php site
but I don't know where to start. Any help would be great.

Thanks,
Seth
Mar 20 '08 #1
2 4199
Seth wrote:
I am doing a project with a embedded processor. I have a program that
can take the data from the serial port and send it out a tcp port
Do you mean send out of, or to a tcp port..is the embedded stuff a
sender of data via TCP or a listener for requests, on a port?
Send out via a port of my choosing makes no sense. TCP i ahbitually sent
on random ports. Its where thelistener is boud to that is the key thing.

of
my choosing. I want to be able to read that stream and display in on
a website.
Php may not be your friend here. What you want is a daemon that can read
the data and update a web page..independtly of whether someone is
watching the pages at all..

Or do you want a user to click on a page,and have that page then go and
read the embedded data? And put a timed refersh on that page?

Depends whether you want to e.g./ record the data for posterity on a
timed basis, or just on a 'need to know/show' one.
The data is going to be really basic just a couple of temperatures. I
just want to have two text boxes that update the temperature every
couple minutes or so. I have read some information on the php site
but I don't know where to start. Any help would be great.
If your embedded device can *listen* on a port, you want to explore the
fsockopen() and fread() commands in the php library.

SEE

http://www.php.net/manual/en/function.fsockopen.php

You would use something like

$fp=fsockopen("$MyEembeddedIPAddress",$myspecialpo rt);

and then an fread on $fp until you had the data, and then an fclose($fp);
Thanks,
Seth
Mar 20 '08 #2
Seth wrote:
I am doing a project with a embedded processor. I have a program that
can take the data from the serial port and send it out a tcp port of
my choosing. I want to be able to read that stream and display in on
a website.

The data is going to be really basic just a couple of temperatures. I
just want to have two text boxes that update the temperature every
couple minutes or so. I have read some information on the php site
but I don't know where to start. Any help would be great.

Thanks,
Seth
The easiest might be to just format the data as an HTTP POST or GET
request and send it to a page on your website. Use .htaccess to limit
access to the page to a the localhost (127.0.0.1).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 20 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Google Mike | last post by:
After a lot of thought and research, and playing with FreeTDS and InlineTDS, as well as various ODBC connections, I have determined that the fastest and cheapest way to get up and going with PHP on...
1
by: Jim Bayers | last post by:
Our network nazi doesn't want us running a webserver on the server that has a connection to the campus database so we created a remote object that runs as a windows service. The windows service...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
10
by: Mike Collins | last post by:
I am trying to connect to a 2003 Server from an ASP.Net page and am getting the following error message. Can someone please help get me started on how to track and fix this error? The code I am...
9
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql...
0
by: nathanious | last post by:
Hello guys(and gals) It has come upon me to alter an existing application to connect to another server in addition to the one it is currently and write data there. The thing is that the new...
1
by: kimberly.walker | last post by:
Im new to creating a web service..... I have a public web page that collects data this is stored in an .mdb. The plan is to create a web service behind the firewall to get the data from the .mdb...
1
by: ElvisRS | last post by:
Hi, I'm writing a simple udp client using sockets. My code looks like this: initServer2 = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);...
4
by: JDS | last post by:
I have an application that interfaces with a USB device using the .Net serial port. The code works fine, displaying live data on the screen; that is until the USB lead is pulled out from the PC...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.