How to make localhost webpage
-
Hi. I wonder how to make localhost webpage.
My QT app is showing sensor value in Raspberry Pi.
Sensor and Raspberry Pi connect with using QTcpServer.
Sensor and Raspberry Pi have to write and read packet.
And then, I want to send sensor value to localhost webpage in Raspberry Pi.
Here is the Problem, My localhost webpage example also use QTcpserver.
When I combine two code, it not work.
So, is there way to solve this problem?
For example, using two QTcpServer code
Or another solution?
Advise Me. Please
-
@duckrae said in How to make localhost webpage:
is there way to solve this problem?
Provide more information/code/errors
-
You need to create an AJAX client in your web-page. You could do this with a JavaScript timer that periodically requests data via a GET request to your application. Your application would need to listen for these requests using a TCP socket then respond.
Depending on the amount of data you are going to be sending back to the client you may want to consider changing the method to a POST instead of GET as GET is limited in the data response to the URL length.
You will also need to have a web-server, you could build a web-server into your application using TCP sockets, if not use Apache or something else for prototyping.