View previous topic :: View next topic |
Author |
Message |
Tubeampman
Joined: 27 Feb 2006 Posts: 100 Location: Bodo
|
Posted: Mon May 16, 2016 12:44 am Post subject: Html Problem |
|
|
Hi
am trying to make a web relay controller with an AVR & ESP8266.
When the esp relays the following code from the Avr to a browser, the buttons appear in the browser.
But how can i get the $ON and $OFF to get sendt back from the browser to the esp when i click a button?.
i have bee reading and trying to understand this, but find it difficult.
The <form> must have something to do with it as far as i can tell.
<!DOCTYPE html>
<html>
<body>
<h1>Relay Controller</h1>
<form action=''/submit' method='GET'>
<input type="button" onclick="alert('$ON')" value="ON "><br><br>
<input type="button" onclick="alert('$OFF')" value="OFF">
</body>
</html>
Best regards
Øyvind |
|
Back to top |
|
|
george2002
Joined: 23 Nov 2005 Posts: 74 Location: Krakow
|
Posted: Sat Feb 25, 2017 9:35 am Post subject: |
|
|
I'm also curious about how to do that because i want to input SSID and Password from page to ESP8266, on internet there are lots of samples how to get something from internet to ESP8266 but there no info about that how to get info from page to ESP8266 if anyone have any info i would be grateful
Best Regards
George2002 _________________ Hi 4 all |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sat Feb 25, 2017 6:38 pm Post subject: Tutorial |
|
|
http://randomnerdtutorials.com/esp8266-web-server/
Found it in bascomforum.de
Is the ESP8266 driven by LUA, AT-commands or with Arduino C?
On the main page of www.mcselec.com there is a link to a weatherstation. Weatherstation 4.0 has full communication between an Arduino Mega 2560 in Bascom and an ESP8266 in Arduino C.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
george2002
Joined: 23 Nov 2005 Posts: 74 Location: Krakow
|
Posted: Sat Feb 25, 2017 8:05 pm Post subject: |
|
|
Hello Ben and thanks for the link, i saw that page elier but i need drive ESP8266 by AT commands from AVR Atmega128 so no LUA or arduino C but Bascom code that will set page and next read input SSID and Password from page and set the ESP8266 is what will help me
1. Set ESP8266 as AP and when user connect to ESP8266 then show page with SSID and Password input
2.when user input SSID and Password then set ESP8266 in station mode and next i will handle next steps _________________ Hi 4 all |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Sun Feb 26, 2017 2:04 am Post subject: |
|
|
This is no different to setting the IP , gateway , password and so on
I do this in my web servers I even sent text to the RS232 port from web pages
have a look at my web server blogs.
Regards Paul |
|
Back to top |
|
|
|