Home/Support/Support Forum/Server-side parameter update to client.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Server-side parameter update to client.

0 votes
In the Samples: "\tcpip\rabbitweb\humidity.c" example program is a variable called "hum" which is displayed on the client's webpage. I would like the server when it has a new humidity reading to simply update the box on the client's webpage for the new value without reloading the entire webpage. This is a similar request to say a stock price being continually updated by the server without refreshing the whole web page when the price changes. Can this be done, or is it beyond the state-of-the-art?

Thanks for any info,
Doug Ronald, W6DSR
asked May 6 in Rabbit Software by dsronal New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

+1 vote
You can't push the new value from the Rabbit, but you can probably use some Ajax techniques to load a simple JSON structure with "hum" and other variables, and then update just the elements of the web page with the new values.

https://en.wikipedia.org/wiki/Ajax_(programming)

The Samples\tcpip\rabbitweb\thermo_graph.c program demonstrates sending a data structure in JSON format.

Dynamic C doesn't have a sample program for combining the JSON format with Ajax techniques. There is a sample that predates the JSON support in RabbitWeb, using Javascript generation to update multiple fields on a page without having to reload the entire HTML page: Samples/BL4S1xx/TCPIP/rweb_io_sample.c

I don't think you'll be able to run it on a target that isn't one of the BL4S1xx-series SBCs, but you might be able to look through the components for ideas.
answered May 6 by TomCollins Veteran of the Digi Community (2,297 points)
...