Shop OBEX P1 Docs P2 Docs Learn Events
HTML code to render a variable from Web_ServerW5100 — Parallax Forums

HTML code to render a variable from Web_ServerW5100

MoskogMoskog Posts: 554
edited 2014-07-11 16:47 in Accessories
Hello again!
After lot of successful programming the Spinneret in a huge Ventilation project, (controlling almost 10 eldery ventilation systems in a same number of different facillities) we are finally realizing we have to begin using SD-cards instead of Propeller memory only. The project could not have been done without the help from Mike G and his tutorials and also inputs from our doggie veterinarian has been very valuable.
The project is based on controlling and status-reading through the network from a Visual Basic application or simply using a web browser for fast and simple access. Its been a very interesting project, both for learning programming technics, in Spin and VB, and also for making something very useful. The project is a cooporation between me and LA6WNA who also appears in the forums frequently.

So the problem, that is probably not so complicated, is how to render a dynamic value from the spin object when reading a static HTML-page from the Spinnerets SD card.
Let us say [for an example] we want to read the Version number of the WebServer_W5100.spin when accessing the html-page.

Comments

  • Mike GMike G Posts: 2,702
    edited 2014-07-11 03:35
    IMO, the easiest method is AJAX. Most of the work is done in JavaScript. The attached is a example which works with the WebServer_W5100.

    There are two htm pages one is the application entry point, index.htm. The other, sint.htm, contains the JavaScript. Click the Get Integer button to invoke the AJAX request. RenderDynamic contains the SPIN code that generates the XML response.

    Take a look at the HTML source in sint.htm, specifically the JavaScript.
  • MoskogMoskog Posts: 554
    edited 2014-07-11 12:24
    Thanks, Mike,
    Think I will figure out something out of that, I probably have an outdated version of WebServer_W5100 as some of the examples (like sint.xml in render_dynamic) is not present. (Version date aug 26 2013). However, I found some pretty interesting things in epin.htm that use pinstate.xml that looks familiar to my previously vb-programming.

    Thanks so much again for quick response!
Sign In or Register to comment.