Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP Web-Development
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 6-Nov-12 7:50am
RateP214
Edited 7-Nov-12 12:14pm
v2
Comments
Sergey Alexandrovich Kryukov at 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 at 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 at 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 at 7-Nov-12 17:07pm
   
The idea is to control or view the device outside LAN
Sebastiaan Meijerink at 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 at 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
good
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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 7 Nov 2012
Copyright © CodeProject, 1999-2014
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