B4R Question Wemos D1 R2 - LED on/off via web browser

Mark Read

Well-Known Member
Licensed User
Longtime User
I am new to B4R, so please excuse my mistakes.

I would be very gratefull for some help with this code. It sort of works but I have to press the button twice to turn on or off the LED.

B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 1200
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    
    'Wemos D1 R2
    ' Pin    GPIO    Function
    '____    ______    ___________
    ' D0    GPIO16
    ' D1    GPIO5    SCL
    ' D2    GPIO4    SDA
    ' D3    GPIO0
    ' D4    GPIO2    BUILTIN_LED
    ' D5    GPIO14    SCK
    ' D6    GPIO12    MISO
    ' D7    GPIO13    MOSI
    ' D8    GPIO15
    ' A0    A0
    
    Private bc As ByteConverter
    Private Serial1 As Serial
    Private wifi As ESP8266WiFi
    Private server As WiFiServerSocket
    Private astream As AsyncStreams
    Private LEDPin As Pin
    
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    Log(wifi.StartAccessPoint("Wemos_Server"))
    Log(wifi.AccessPointIp)
    RunNative("SetAP", Null)
    Log(wifi.AccessPointIp)
    Log(wifi.LocalIp)
    server.Initialize(80, "server_NewConnection")
    LEDPin.Initialize(2, LEDPin.MODE_OUTPUT)
    server.Listen
End Sub


#if C
void SetAP(B4R::Object* o) {
   WiFi.mode(WIFI_AP);
}
#end if

Sub Server_NewConnection (NewSocket As WiFiSocket)
    astream.Initialize( NewSocket.Stream, "astream_NewData", "astream_Error")
    Log("New connection..")
    'DisplayWebpage
End Sub

Sub astream_NewData (Buffer() As Byte)
    Log("new data: ", Buffer)
            
    If bc.IndexOf(Buffer, "GET") <> -1 Then                        'Browser opened and logged in
        
    End If
    
    If bc.IndexOf(Buffer, "LEDON") <> -1 Then
        LEDPin.DigitalWrite(False)
        
    Else if bc.IndexOf(Buffer, "LEDOFF") <> -1 Then
        LEDPin.DigitalWrite(True)
        
    End If
    DisplayWebpage
    
End Sub

Sub DisplayWebpage
    Log("Sending webpage")
    Dim html1, html2, html3 As String
    
    'Prepare default strings for webpage
    html1="<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto;  padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%;  background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>"
    html2=""
    html3="</div></body></html>"
    Dim LEDStatus As Boolean=LEDPin.DigitalRead
    
    If LEDStatus=True Then
        ' the LED is off so the button needs To say turn it on
        html2 = "<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>"
    Else
        ' the LED is on so the button needs To say turn it off
        html2 = "<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>"
    End If
    
    Log("***********************************************************")
    Log(html1)
    Log(html2)
    Log(html3)
    Log("***********************************************************")
        
    
    astream.Write("HTTP/1.1 200").Write(CRLF).Write("Content-Type: text/html").Write(CRLF).Write(CRLF).Write(html1).Write(CRLF).Write(html2).Write(CRLF).Write(html3).Write(CRLF)
    'astream.Write("HTTP/1.1 200 OK").Write(CRLF).Write("Content-Type: text/html").Write(CRLF).Write(CRLF)
    'astream.Write(html1).Write(CRLF)
    'astream.Write(html2).Write(CRLF)
    'astream.Write(html3).Write(CRLF)
    
    CallSubPlus("CloseConnection", 200, 0)
End Sub

Sub astream_Error
    Log("Astream error")
    server.Listen
End Sub

Private Sub CloseConnection(u As Byte)
    Log("Close connection")
    If server.Socket.Connected Then
        server.Socket.Stream.Flush
        server.Socket.Close
    End If
End Sub

Many thanks
 

Mark Read

Well-Known Member
Licensed User
Longtime User
This is the log after startup: (Also the webpage shows the content 4 times!)

New connection..
new data: GET / HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent:
Sending webpage
***********************************************************
<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>
<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>
</div></body></html>
***********************************************************
new data: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chr
Sending webpage
***********************************************************
<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>
<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>
</div></body></html>
***********************************************************
new data: ome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/
Sending webpage
***********************************************************
<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>
<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>
</div></body></html>
***********************************************************
new data: webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en
Sending webpage
***********************************************************
<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>

<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>
</div></body></html>
***********************************************************
Close connection
Astream error
New connection..
new data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux
Sending webpage
***********************************************************
<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>
<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>
</div></body></html>
***********************************************************
Close connection
Astream error
New connection..
Close connection
Astream error
Close connection
Close connection

B4R 2.2, Arduino 1.8.5, Android 4.4.4 Tablet
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Changed the Newdata sub to:

B4X:
Sub astream_NewData (Buffer() As Byte)
    Log("new data: ", Buffer)
            
    If bc.IndexOf(Buffer, "GET") <> -1 Then                        'Browser opened and logged in
        Log("Reacting to 'GET'")
        DisplayWebpage
    End If
    
    If bc.IndexOf(Buffer, "LEDON") <> -1 Then
        LEDPin.DigitalWrite(False)
        Log("Reacting to 'LEDON'")
        DisplayWebpage
    Else if bc.IndexOf(Buffer, "LEDOFF") <> -1 Then
        LEDPin.DigitalWrite(True)
        Log("Reacting to 'LEDOFF'")
        DisplayWebpage
    End If
    
    
End Sub

and removed the webpage log. The statup log for first connection from browser shows:

New connection..
new data: GET / HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent:
Reacting to 'GET'
Sending webpage to browser..
new data: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chr
new data: ome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/
new data: webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en
new data: -US;q=0.4,en;q=0.2
Close connection
Astream error
New connection..
new data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux
Reacting to 'GET'
Sending webpage to browser..
new data: ; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Sa
new data: fari/537.36
Accept: */*
Referer: http://192.168.4.1/
Accept-Encoding: gzip, deflate, sdch
Accept
new data: -Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2
Close connection
Astream error
New connection..

and the button is only visible once. Pressing the button builds the page on the browser under the original instead of replacing it ????
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Pressing the button again gives me then three buttons, as if the page is scrolling upwards.
 
Upvote 0

miker2069

Active Member
Licensed User
Longtime User
Could you perhaps change how you trigger the led to something like http://your-ip/?on or http://your-ip/?off it's going to be much easier just parsing the url line verse attempt to sort through the form data...plus you can get into memory issues by trying to do a lot of string parsing and manipulation.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Could you perhaps change how you trigger the led to something like http://your-ip/?on or http://your-ip/?off it's going to be much easier just parsing the url line verse attempt to sort through the form data...plus you can get into memory issues by trying to do a lot of string parsing and manipulation.

I am not really doing any parsing at all, just checking if the byte contains one word.

I'm noticing that you read the status of the output pin(the led driver). I never tried this. Use a flag you change every command get.

I thought I was: LEDStatus as boolean.

I am off with the flu at present. No Easter for me. My program is at work. When I return I will post further info. I have had to rewrite the sub
astream_NewData, as it seems to be critical in which order things are called.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
So after a long illness, I am back to work. I have managed to get my app working. The working code is below:

B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 1200
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
  
    'Wemos D1 R2
    ' Pin    GPIO    Function
    '____    ______    ___________
    ' D0    GPIO16
    ' D1    GPIO5    SCL
    ' D2    GPIO4    SDA
    ' D3    GPIO0
    ' D4    GPIO2    BUILTIN_LED
    ' D5    GPIO14    SCK
    ' D6    GPIO12    MISO
    ' D7    GPIO13    MOSI
    ' D8    GPIO15
    ' A0    A0
  
    Private bc As ByteConverter
    Private Serial1 As Serial
    Private wifi As ESP8266WiFi
    Private server As WiFiServerSocket
    Private astream As AsyncStreams
    Private LEDPin As Pin
    Dim LEDStatus As Boolean
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    Log(wifi.StartAccessPoint("Wemos_Server"))
    Log(wifi.AccessPointIp)
    RunNative("SetAP", Null)
    Log(wifi.AccessPointIp)
    Log(wifi.LocalIp)
    server.Initialize(80, "server_NewConnection")
    LEDPin.Initialize(14, LEDPin.MODE_OUTPUT)
    server.Listen
End Sub


#if C
void SetAP(B4R::Object* o) {
   WiFi.mode(WIFI_AP);
}
#end if

Sub Server_NewConnection (NewSocket As WiFiSocket)
    astream.Initialize( NewSocket.Stream, "astream_NewData", "astream_Error")
    astream.WaitForMoreDataDelay = 100
    astream.MaxBufferSize = 1200  ' was 400
    'Log("New connection..")
End Sub

Sub astream_NewData (Buffer() As Byte)
    Log("***********************************************************")
    Log("Stack buffer usage: ",StackBufferUsage)
    Log(" ")
    Log("New data: ", Buffer, CRLF)
    Log(" ")
    Log("***********************************************************")
    Log(" ")
      
    If bc.IndexOf(Buffer, "GET") <> -1 Then                     
        If bc.IndexOf(Buffer, "GET /LEDON") <> -1 Then
            Log("[LEDON]  LED status was ", LEDPin.DigitalRead)
            LEDPin.DigitalWrite(True)
            Log("  LED status is ", LEDPin.DigitalRead)
            'DisplayWebpage
            'CallSubPlus("CloseConnection", 200, 0)
        Else If bc.IndexOf(Buffer, "GET /LEDOFF") <> -1 Then
            Log("[LEDOFF]  LED status was ", LEDPin.DigitalRead)
            LEDPin.DigitalWrite(False)
            Log("  LED status is ", LEDPin.DigitalRead)
            'DisplayWebpage
            'CallSubPlus("CloseConnection", 200, 0)
        Else
          
        End If
      
        DisplayWebpage                                    'Browser opened and logged in  / HTTP/1.1
        CallSubPlus("CloseConnection", 200, 0)
      
    End If
    'CallSubPlus("CloseConnection", 200, 0)
End Sub

Sub DisplayWebpage
  
    Dim html1, html2, html3 As String
  
    'Prepare default strings for webpage
    html1="<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto;  padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%;  background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>"
    html2=""
    html3="</div></body></html>"
  
    LEDStatus=LEDPin.DigitalRead
  
    Log("___________________________________________________________")
    Log(" ")
    'Log("  LED status is ", LEDStatus)
          
    If LEDStatus=True Then
        ' the LED is on so the button needs To say turn it off
        html2 = "<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>"
    Else if LEDStatus=False Then
        ' the LED is off so the button needs To say turn it on
        html2 = "<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>"
    End If
      
    astream.Write("HTTP/1.1 200").Write(CRLF).Write(CRLF)
    astream.Write(html1).Write(CRLF)
    astream.Write(html2).Write(CRLF)
    astream.Write(html3).Write(CRLF)
  
    Log("  Sending webpage to browser..")
    Log(" ")
    'Log(html1)
    Log(html2)
    'Log(html3)
    Log(" ")
    Log("___________________________________________________________")
  
  
End Sub

Sub astream_Error
    'Log("Astream error")
    server.Listen
End Sub

Private Sub CloseConnection(u As Byte)
    'Log("Close connection")
    If server.Socket.Connected Then
        server.Socket.Stream.Flush
        server.Socket.Close
    End If
End Sub

The main problem was the checking of the buffer. Before I had this:

B4X:
If bc.IndexOf(Buffer, "LEDON") <> -1 Then

which I changed to this:

B4X:
If bc.IndexOf(Buffer, "GET /LEDON") <> -1 Then

as the buffer contained "Referer: http://192.168.4.1/LEDOFF?", which caused things to go wrong. Now the whole thing works.

Just for interest, the arduino code:

/*
* Sketch: ESP8266_LED_Control_02C
* Now with added CSS and a single button
* Control an LED from a web browser
* Intended to be run on an ESP8266
*
* connect to the ESP8266 AP then
* use web broswer to go to 192.168.4.1
*
*/


#include <ESP8266WiFi.h>
const char WiFiPassword[] = "";
const char AP_NameChar[] = "LEDControl" ;

WiFiServer server(80);

String header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
String html_1 = "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'/><meta charset='utf-8'><style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>";
String html_2 = "";
String html_4 = "</div></body></html>";

String request = "";
int LED_Pin = BUILTIN_LED;

void setup()
{
pinMode(LED_Pin, OUTPUT);
digitalWrite(LED_Pin, HIGH); //Built in LED is off when HIGH!

Serial.begin(115200);
delay(10);

boolean conn = WiFi.softAP(AP_NameChar, WiFiPassword);
server.begin();

} // void setup()



void loop()
{

// Check if a client has connected
WiFiClient client = server.available();
if (!client) { return; }

Serial.println();
Serial.println();
Serial.print("Client connected");

// Read the first line of the request
request = client.readStringUntil('\r');

if ( request.indexOf("LEDOFF") > 0 ) { digitalWrite(LED_Pin, HIGH); }
else if ( request.indexOf("LEDON") > 0 ) { digitalWrite(LED_Pin, LOW); }


// Get the LED pin status and create the LED status message
if (digitalRead(LED_Pin) == HIGH)
{
// the LED is off so the button needs to say turn it on
html_2 = "<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>";
}
else
{
// the LED is on so the button needs to say turn it off
html_2 = "<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>";
}


client.flush();

client.print( header );
client.print( html_1 );
client.print( html_2 );
client.print( html_4);

delay(5);
// The client will actually be disconnected when the function returns and 'client' object is destroyed

} // void loop()
 
Last edited:
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
This was the info from the logs (helps to read them sometimes - Post#2 Erel!!)

***********************************************************
Stack buffer usage: 473

New data: GET /LEDOFF? HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.4.1/LEDON?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

[LEDOFF] LED status was 1
LED status is 0
___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 377

New data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: */*
Referer: http://192.168.4.1/LEDOFF?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 473

New data: GET /LEDON? HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.4.1/LEDOFF?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

[LEDON] LED status was 0
LED status is 1
___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 376

New data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: */*
Referer: http://192.168.4.1/LEDON?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 473

New data: GET /LEDOFF? HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.4.1/LEDON?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

[LEDOFF] LED status was 1
LED status is 0
___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 377

New data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: */*
Referer: http://192.168.4.1/LEDOFF?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 473

New data: GET /LEDON? HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.4.1/LEDOFF?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

[LEDON] LED status was 0
LED status is 1
___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 376

New data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: */*
Referer: http://192.168.4.1/LEDON?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 473

New data: GET /LEDOFF? HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.4.1/LEDON?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

[LEDOFF] LED status was 1
LED status is 0
___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
***********************************************************
Stack buffer usage: 377

New data: GET /favicon.ico HTTP/1.1
Host: 192.168.4.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; SM-T560 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36
Accept: */*
Referer: http://192.168.4.1/LEDOFF?
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-AT,de-DE;q=0.8,de;q=0.6,en-US;q=0.4,en;q=0.2

***********************************************************

___________________________________________________________

Sending webpage to browser..

<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>

___________________________________________________________
 
Upvote 0
Top