As the title says... Chat on...

User avatar
By be80be
#27630 Could some one show how I would use this to show up on My esp2866 -12
Code: Select all<!DOCTYPE html>
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title> HTML5 Slider </title>
  <script type="text/javascript">
  function showValue(num){
           var result = document.getElementById('result');     
           result.innerHTML = num;
  }
  </script>
  </head>
  <body>
   
  <input type="range" id="sliderBar" min="0" max="100" step="10" value="0" onChange="showValue(this.value);"/>
  <div id="result" style="height:20px;width:30px;border:1px solid #999">
  </div>
  </body>
   
  </html>
User avatar
By be80be
#27666 Ok I figured how to get my slider to show up on the server. How do I write a function to grab the slider output.
I'm learning
This part has the value change in it.
Code: Select allonChange="showValue(slider.value);"/>\n')

Code: Select all-- create a server
    -- 30s time out for a inactive client
    sv=net.createServer(net.TCP, 30)   

    -- server listen on 80,
    -- if data received, print data to console,
    -- then send "hello world" to remote.
    sv:listen(80,function(c)
      c:on("receive", function(c, pl)
         print(pl)
      end)
c:send('<!DOCTYPE html>\n')
 c:send('<html xmlns="http://www.w3.org/1999/xhtml">\n')
 c:send('<head>\n')
 c:send('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n')
 c:send('<title> HTML5 Slider </title>\n')
 c:send('<script type="text/javascript">\n')
  c:send('function showValue(num){\n')
  c:send('var result = document.getElementById("result");\n')     
  c:send('result.innerHTML = num;\n')
  c:send('}\n')
  c:send('</script>\n')
  c:send('</head>\n')
  c:send('<body>\n')
  c:send('<input type="range" id="sliderBar" min="0" max="100" step="10" value="0" onChange="showValue(slider.value);"/>\n')
  c:send('<div id="result" style="height:20px;width:30px;border:1px solid #999">\n')
  c:send('</div>\n')
  c:send('</body>\n')
  c:send('</html>\n')
  end)
User avatar
By forlotto
#30028 Yeah it is tough to get any solid answers for stuff the best suggestion I can give is a lot of reading personally I am stuck myself but I make a little bit of progress after reading more and more right now I am onto reading PHP scripting because I want to setup a website as a digital timer more or less that will send out requests to my nodemcu but as far as the nodemcu goes I am not sure how to set up the server so that it will.
Allow my device to be connected to via my IP so that it is visible may have to port fwd specific ports on my router or somehow allow everything to flow through port 80.
Allow Write 1 or 0 (on/off) to gpio pins
Allow read of all pins status on page load
I need to figure a lot out I have complete lack of know how but hey it is my project so I don't expect people to do the work for me but some examples would be rather helpful so you can look and go ohhhh this part is done. But I suppose inventing the wheel one may learn more on the plus side but to retain it all you have to use it often. This is maybe my 3rd or fourth project that I ever wanted to do that involved programming of any sort lol so for not really being a programmer I consider what has been done so far an accomplishment www.icepik.tk