Click here to Skip to main content
15,883,929 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

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
Updated 7-Nov-12 11:14am
v2
Comments
Sergey Alexandrovich Kryukov 6-Nov-12 14:01pm    
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?
--SA
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 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
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.

1 solution

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.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900