Click here to Skip to main content
13,095,658 members (52,523 online)
Rate this:
Please Sign up or sign in to vote.
See more:

As the subject says I want to write web app that communicates with the client in PHP which I started to work with not so long ago. I have a network device controlling my heating at home and its connected to internet with dynamic ip, and I want to connect it to server where there will be an application which shows the temperatures or any string that the device is sending, also to be able to send back some command which tells the device what to do. In simple words I need to send and receive strings between the application and the network device. The embedded programing would be in C, and I need to define the best way for the communication.

Edit: After googleing about this for few hours I stumbled into PHP socket functions. Can this be done using them?
Posted 6-Nov-12 6:50am
Updated 7-Nov-12 11:14am
Your own heating control? Wow!
Why strings? should better be binary, if possible.
The only problem I see is your Internet Server Provider (ISP). For regular residential service, they usually won't allow you to provide any service from your home, and this is what you would really need. So, how about that?
Sebastiaan Meijerink 6-Nov-12 17:25pm
You could host the webapp from a home computer. Poke a hole in your router. That way you only have to deal with a local area network. You could use xamp for the php server. Talking to the c software from php shouldn t be a problem that way.
RateP 7-Nov-12 17:07pm
The idea is to control or view the device outside LAN
RateP 7-Nov-12 17:11pm
Why strings? Honestly I don't know, I'm not programing the device, and I'm told that the app should capture and return strings, and I need to provide and decide how the server and the client will communicate.
Sebastiaan Meijerink 8-Nov-12 2:12am
That doesnt mean the webserver itself couldnt be in the lan. You can host the website to the internet from your own home.
RateP 8-Nov-12 11:27am
Yes, that would be good solution of the problem, but in future I plan to have more users and more devices, and also already purchased web hosting and domain so...Anyway thank you for the feedback.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Of course it can. Sockets are the best way to communicate bytes between applications. You need a Server(Listener) and a client(Sender). Is this setup going to need more than one client sending strings to the server to get it to do stuff?...You should probably look into if you want to do this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 7 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100