watterott ;title =
Ergebnis 1 bis 10 von 10

Thema: Atmega & ESP8266 Webserver

  1. #1
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32

    Atmega & ESP8266 Webserver

    Code:
    'Max7219 Anzeige
    'schmaler font, pro Buchstabe 6 Spalten
    $regfile = "m2560def.dat"
    $crystal = 16000000
    $hwstack = 100
    $swstack = 100
    $framesize = 200
    Baud 56000
    
    Declare Sub Schreiben(byval Ausgabetext As String , Byval Start_spalte As Word)
    'Config Spisoft = Soft , Din = Portd.6 , Dout = Portb.3 , Ss = None , Clock = Portb.5
    
    Config Portl.5 = Output
    Cs Alias Portl.5
    'Config Portb.1 = Output
    
    'Config Portb.2 = Output
    
    Config Watchdog = 8192
    
    
    Cs = 1
    Config Lcdpin = Pin , Db4 = Portg.5 , Db5 = Porte.3 , Db6 = Porth.3 , Db7 = Porth.4 , E = Porth.6 , Rs = Porth.5
    Config Lcd = 16x2
    Cursor Off
    Config Com2 = 14400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
    Open "com2:" For Binary As #1
    Enable Interrupts
    
    
    Declare Sub Am_senden
    Declare Sub Sendhttp
    Dim Adresse As String * 32
    Dim Adressbyte(33) As Byte At Adresse Overlay
     'Adresse = "00110101001010001010011010110000"               'Angabe des Befehls
                                                                                              'Protokoll: Die ersten 26 Bits sind die ID bzw Adresse
                                                                'dann folgt das Bit für die auswahl aller Steckdosen
    Config Porta.1 = Output
    Porta.1 = 0                                                 'dann folgt das Bit für den Zustand der Steckdosen
                                                                'dann folgen 4 Bits zur Bestimmung, welche angesprochen werden soll
    
    
                                                                'alles aus   00110101001010001010011010100000
                                                                'alles an    00110101001010001010011010110000
                                                                'taster1 aus 00110101001010001010011010000000
                                                                'taster1 an  00110101001010001010011010010000
                                                                'taster2 aus 00110101001010001010011010000001
                                                                'taster2 an  00110101001010001010011010010001
                                                                'taster3 aus 00110101001010001010011010000010
                                                                'taster3 an  00110101001010001010011010010010
    
    
    
     On Urxc1 Onrxd1                                            'ISR zum Empfang der einzelnen ASCIIs
    Enable Urxc1
    Dim Weitersprung As Integer
    Dim Onrxdbyte As String * 1
    Dim Contentlength As Integer
    Dim Imstringint As Integer
    Dim Asciicount As Integer
    '________________________________________________________________________________________________________________________
    Dim Inputstring As String * 500                             'Declare Var for Input and outputstring
    Dim Inputbyte(499) As Byte At Inputstring Overlay
    Dim Outputstring As String * 300
    Dim Outputbyte(499) As Byte At Outputstring Overlay
    Dim Outputlaenge As Integer
    '_______________________________
    Const Anzahl_module = 8
    Const Anzahl_spalten = 64
    Dim Display_array(anzahl_spalten) As Byte                   '8 Spalten für jedes Modul
    Dim Temp As Byte , Temp1 As Byte
    Dim Modul As Byte
    Dim Spalte As Word
    Dim Zeile As Byte , Bit_nr As Byte
    Dim Loesch As Byte
    Dim Display_daten As Byte , Display_digit As Byte
    Dim Spalten_nummer As Word , X As Word
    Dim Test As String * 6
    Dim M As Dword
    Dim Losgehtsflag As Bit
    Losgehtsflag = 0
    Dim Z As Byte
    Config Spi = Hard , Master = Yes , Data_order = Msb , Polarity = High , Clockrate = 64
    Spiinit
    
     Gosub Init_max7219
    
    
    
    Gosub Loeschen
    Cls
    Lcd "Webserver"
    
    Dim Led1 As Bit
      Led1 = 0
    Dim Led1int As Integer
    Dim Led2 As Bit
       Led2 = 0
    Dim Led2int As Integer
    Dim Led3 As Bit
       Led3 = 0
    Dim Led3int As Integer
    Dim Led4 As Bit
        Led4 = 0
    Dim Led4int As Integer
    Dim Ip As String * 16
    Dim Ausgabelcd As String * 10
    
    
    
    
    
    
    
    
    
    
    'Config Portc.0 = Input
    'Config Portc.1 = Output
    'Config Portc.2 = Output
    'Sox Alias Pinc.0
    'Clkx Alias Portc.1
    'Csx Alias Portc.2
    'Dim Tempx As Word
    'Dim Temperatur As String * 11
    'Dim Tempx1 As Single
    '_________________________________________________________________________________________
     Enable Interrupts
    
    
    
    
    'Call Schreiben( "Webserver" , 1)
    
    Gosub Esp8266rst
    
    
    '#####################################################  Main-Frame
    Do
    
    
    
    
    Imstringint = Instr(inputstring , "Host")
    If Imstringint > 0 Then
              Cls
              Lcd "Send DATA"
               Waitms 2000
               Gosub Sendhttp
    End If
    
    Loop
    End
    
    
    Sendhttp:
                    Imstringint = Instr(inputstring , "Tenge")
                     If Imstringint > 0 Then
    
                Led1int = Instr(inputstring , "1AN=")
                If Led1int > 0 Then
                Led1 = 1
    
                Else
    
                Led1 = 0
                End If
    
    
                Led2int = Instr(inputstring , "2AN=")
                If Led2int > 0 Then
                Led2 = 1
    
                Else
    
                Led2 = 0
                End If
    
    
                Led3int = Instr(inputstring , "3AN=")
                If Led3int > 0 Then
                Led3 = 1
    
                Else
                Led3 = 0
                End If
    
    
                Led4int = Instr(inputstring , "4AN=")
                If Led4int > 0 Then
                Led4 = 1
                Else
                Led4 = 0
                End If
                End If
    
    
    
    
     Print Inputstring
    Inputstring = ""
     Print "1"
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    
    Print #1 , "HTTP/1.1 200 OK"
    Print #1 , "Content-Language: de"
    Print #1 , "Content-Length:5110"
    Print #1 , "Content-Type: text/html; charset=UTF-8"
    
    Print #1 , "Connection: close"
    Print #1 , "Server: Dirty sunchez"
    
    
    Print #1 , ""
    
    
     Print #1 , "<!doctype Html>"
    
     Print #1 , "<html>"
     Print #1 , "<head>"
    
    
    
    
     '<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAASihoAAAAAAP///wAf8i0ABowOAM/PzwCZmZkAra2t
     'APDw8AC/vb4AE70eAODe3wAcxycAioqKAFRUVAAQnhkACKgTAAR9DAAT8CIARUVFACD1LgAPDw8ALi4tAA6cFwAcHBwAGK0iAHp6egAJ2xcAZmVlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ0GBgcHCQkFBQsLCAgCAhoNDQYGDw8JCQQECwsICAIaGg0NBhsPBwkQBAULCwgIHBoaDQ0bDwcHEAQFBQsLCBwcGhoSGxsbEBAEBAUFCwsOGQAaEhIbGxsQEAQJD
     'AQLDhkAHAMDEhsbEBAECQwEBRMZABwSAxIbGxAQBAcMAAUTGQAOAwMSGxsQEAQHDAAJFhkADgMDEhsbGxAEBgwACRYWExMODhwcGhoNDQYGBwcYFhYTFBsbCgoXFxENBgYHGBgWFhQUDhsKHBcRDQ0GBhUYGBYWFB
     'QbCgoXGhoNDQYVFRgYGxYUGxsKHBsaGg0NARUVGxgWFhMTDg4cGxoaDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" rel="icon" type="image/x-icon" />
     Print #1 , "<meta http-equiv=";
     Print #1 , Chr(34);
     Print #1 , "Refresh";
     Print #1 , Chr(34);
     Print #1 , "Content=";
     Print #1 , Chr(34);
     Print #1 , "300";
     Print #1 , Chr(34);
     Print #1 , "/>"
    
    Print #1 , "<title>Smarthome</title>"
    Print #1 , "<script type=" ; Chr(34) ; "text/javascript" ; Chr(34) ; " src=" ; Chr(34) ; "https://www.gstatic.com/charts/loader.js" ; Chr(34) ; "></script>"
     Print #1 , "<script type=" ; Chr(34) ; "text/javascript" ; Chr(34) ; ">"
     Print #1 , "google.charts.load('current', {'packages':['line']});"
     Print #1 , "google.charts.setOnLoadCallback(drawChart);"
     Print #1 , "function drawChart() {"
     Print #1 , "var data = new google.visualization.DataTable();"
     Print #1 , "data.addColumn('number', 'Time');"
     Print #1 , "data.addColumn('number', 'Temp1');"
     Print #1 , "data.addColumn('number', 'Temp2');"
       Print #1 , "data.addColumn('number', 'Temp3')"
          Print #1 , "data.addRows(["
             Print #1 , "[1,37.8,80.8,41.8],"
                Print #1 , "[20,4.2,6.2,3.4]"
     Print #1 , "]);"
      Print #1 , ""
    
     Print #1 , "var options={"
     Print #1 , "chart: {"
     Print #1 , "title: 'Templog',"
     Print #1 , "subtitle: ''"
     Print #1 , "},"
     Print #1 , "width: 1700,"
     Print #1 , "height: 250,"
     Print #1 , "axes:{"
      Print #1 , "x:{"
     Print #1 , "0:{side: 'top'}"
      Print #1 , "}"
     Print #1 , "}"
      Print #1 , "};"
        Print #1 , "var chart=new google.charts.Line(document.getElementById('line_top_x'));"
          Print #1 , "chart.draw(data,options);"
            Print #1 , "}"
    
     Print #1 , "</script>"
    Print #1 , "<style>"
    Print #1 , ".centered {"
    Print #1 , "position:           absolute;"
    Print #1 , "display:            inline-block;"
    Print #1 , "left:           -250px;"
    Print #1 , "width:          500px;"
    Print #1 , "margin:             0 50%;"
    Print #1 , "}"
    
    Print #1 , "*,:before,:after{"
    Print #1 , "box-sizing:border-box;"
    Print #1 , "margin:0;"
    Print #1 , "padding:0;"
    Print #1 , "/*transition*/"
    Print #1 , "-webkit-transition:.25s ease-in-out;"
    Print #1 , "   -moz-transition:.25s ease-in-out;"
    Print #1 , "     -o-transition:.25s ease-in-out;"
    Print #1 , "        transition:.25s ease-in-out;"
    Print #1 , "outline:none;"
    Print #1 , "font-family:Helvetica Neue,helvetica,arial,verdana,sans-serif;"
    Print #1 , "}"
    Print #1 , "body{"
    Print #1 , "background:#f1f1f1;"
    Print #1 , "}"
    Print #1 , "h1{"
    Print #1 , "margin: -20px -50px;"
    Print #1 , "text-align:center;"
    Print #1 , "font-weight:10;"
    Print #1 , "color:#4b4b4b;"
    Print #1 , "}"
    Print #1 , "#toggles{"
    Print #1 , "width:60px;"
    Print #1 , "margin:50px auto;"
    Print #1 , "text-align:center;"
    Print #1 , "}"
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = "SEND OK"
    Return
    End If
    Wend
    Print "2"
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
     Print "3"
    Print #1 , ".ios-toggle,.ios-toggle:active{"
    Print #1 , "position:absolute;"
    Print #1 , "top:-5000px;"
    Print #1 , "height:0;"
    Print #1 , "width:0;"
    Print #1 , "opacity:0;"
    Print #1 , "border:none;"
    Print #1 , "outline:none;"
    Print #1 , "}"
    Print #1 , ".checkbox-label{"
    Print #1 , "display:block;"
    Print #1 , "position:relative;"
    Print #1 , "padding:10px;"
    Print #1 , "margin-bottom:20px;"
    Print #1 , "font-size:12px;"
    Print #1 , "line-height:16px;"
    Print #1 , "width:100%;"
    Print #1 , "height:36px;"
    Print #1 , "/*border-radius*/"
    Print #1 , "-webkit-border-radius:18px;"
    Print #1 , "   -moz-border-radius:18px;"
    Print #1 , "        border-radius:18px;"
    Print #1 , "background:#f8f8f8;"
    Print #1 , "cursor:pointer;"
    Print #1 , "}"
    Print #1 , ".checkbox-label:before{"
    Print #1 , "content:" ; Chr(39) ; Chr(39) ; ";"
    Print #1 , "display:block;"
    Print #1 , "position:absolute;"
    Print #1 , "z-index:1;"
    Print #1 , "line-height:34px;"
    Print #1 , "text-indent:40px;"
    Print #1 , "height:36px;"
    Print #1 , "width:36px;"
    Print #1 , "/*border-radius*/"
    Print #1 , "-webkit-border-radius:100%;"
    Print #1 , "   -moz-border-radius:100%;"
    Print #1 , "        border-radius:100%;"
    Print #1 , "top:0px;"
    Print #1 , "left:0px;"
    Print #1 , "right:auto;"
    Print #1 , "background:white;"
    
    Print #1 , "-webkit-box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "   -moz-box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "        box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "}"
    
    
    
    Print #1 , ".checkbox-label:after{"
    Print #1 , "content:attr(data-off);"
    Print #1 , "Display:Block;"
    Print #1 , "position:absolute;"
    Print #1 , "z-index:0;"
    Print #1 , "top:0;"
    Print #1 , "left:-300px;"
    Print #1 , "Padding:10px;"
    Print #1 , "height:100%;"
    Print #1 , "width:300px;"
    Print #1 , "text-align:right;"
    Print #1 , "color:#bfbfbf;"
    Print #1 , "white-space:nowrap;"
    Print #1 , "}"
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = "SEND OK"
    Return
    End If
    Wend
     Print "4"
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
        Print "5"
    Print #1 , ".ios-toggle:checked + .checkbox-label{"
     Print #1 , "/*Paket3*/"
    Print #1 , "-webkit-box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "        box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "}"
    
    Print #1 , ".ios-toggle:checked + .checkbox-label:before{"
    Print #1 , "left:calc(100% - 36px);"
    Print #1 , "/*box-shadow*/"
    Print #1 , "-webkit-box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "   -moz-box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "        box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "}"
    Print #1 , ".ios-toggle:checked + .checkbox-label:after{"
    Print #1 , "content:attr(data-on);"
    Print #1 , "left:60px;"
    Print #1 , "width:36px;"
    Print #1 , "}"
    Print #1 , "/* GREEN CHECKBOX */"
    
    
    
    Print #1 , "#checkbox {"
    Print #1 , "/*box-shadow*/"
    Print #1 , "-webkit-box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "        box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "}"
    Print #1 , "#checkbox:checked {"
    Print #1 , "/*box-shadow*/"
    
    
    
    
    
    Print #1 , "-webkit-box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "        box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "}"
    Print #1 , "#checkbox:checked + .checkbox-label:after{"
    Print #1 , "color:rgba(19,191,17,1);"
    Print #1 , "}"
    
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    Return
    'Inputstring = "SEND OK"
    End If
    Wend
     Print "6"
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
          Print "7"
    Print #1 , ".submitter {"
    Print #1 , "    height:48px;"
    Print #1 , "    width:100px;"
    Print #1 , "    margin: -20px -50px;"
    Print #1 , "    top:50%;"
    Print #1 , "    left:50%;"
    Print #1 , "}"
    
    
    Print #1 , "</style>"
     Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = "SEND OK"
    Return
    End If
    Wend
    Print "2,5"
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    Print #1 , "</head>"
    Print #1 , "<body>"
    
       Print #1 , "<div id=" ; Chr(34) ; "line_top_x" ; Chr(34) ; "></div>"
    
    Print #1 , " <Form Action=" ; Chr(34) ; "/" ; Chr(34) ; " method=POST" ; ">"
    
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = "SEND OK"
    Return
    End If
    Wend
     Print "8"
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    'Inputstring = ">"
    Return
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
      Print "9"
    
    If Led1 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED1=AN" ; Chr(34) ; " name=" ; Chr(34) ; "1AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led1 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED1=AN" ; Chr(34) ; " name=" ; Chr(34) ; "1AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
    
          Print #1 , "<h1>Alle Funksteckdosen</h1>"
    Print #1 , "<BR>"
    If Led2 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED2=AN" ; Chr(34) ; " name=" ; Chr(34) ; "2AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led2 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED2=AN" ; Chr(34) ; " name=" ; Chr(34) ; "2AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
          Print #1 , "<h1>Weltherrschaft besitzen</h1>"
    Print #1 , "<BR>"
    
          If Led3 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED3=AN" ; Chr(34) ; " name=" ; Chr(34) ; "3AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led3 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED3=AN" ; Chr(34) ; " name=" ; Chr(34) ; "3AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
    
    Print #1 , "<h1>Alles zerstoeren</h1>"
    Print #1 , "<BR>"
    
      Print #1 , "<br>"
     Print #1 , "<br>"
     Print #1 , "<br>"
     Print #1 , "<br>"
    
    
    
    Print #1 , "    <input type=" ; Chr(34) ; "text" ; Chr(34) ; " name=" ; Chr(34) ; "field1" ; Chr(34) ; " class=" ; Chr(34) ; "submitter" ; Chr(34) ; "/>"
    Print #1 , "    <br>"
    Print #1 , "<br><br>"
    Print #1 , "<input type=" ; Chr(34) ; "submit" ; Chr(34) ; " value=" ; Chr(34) ; "send" ; Chr(34) ; " class=" ; Chr(34) ; "submitter" ; Chr(34) ; "/>"
    
    
    
    
    
    
    
    
    
    
    
    
     Print #1 , "<br>"
     Print #1 , "<br>"
    
     Print #1 , "</body>"
     Print #1 , "</html>"
    
    
    
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 40 Then
    Return
    'Inputstring = "SEND OK"
    End If
    Wend
    Print "10"
     Inputstring = ""
    Waitms 2000
              Print #1 , "AT+CIPCLOSE=0"
    
               Cls
    
    Inputstring = ""
    
    
     If Led1 = 1 Then
     'Adresse = "00110101001010001010011010110000"
    ' Adresse = "00110101001010001010011010010000"
     Adresse = "00110101001010001010011010110000"               'Angabe des Befehls
     Call Am_senden
    Else
     Adresse = "00110101001010001010011010100000"               'Angabe des Befehls
     Call Am_senden
    End If
    
    '___________________________________________________________________________________
    '___________________________________________________________________________________
    
    
    Return
    
    '#####################################################  Main-Frame
    
    
    
    
    
    Esp8266rst:
    
    Lcd "Init"
     Wait 3
     Print #1 , "ATE0"
     Wait 1
     Print #1 , "AT+RST"
     Wait 1
     Print #1 , "AT+SLEEP=0"
     Waitms 100
     Print #1 , "AT+CWMODE=3"
     Waitms 100
    
     Print #1 , "AT+CWLAP"
    
     Wait 6
    
    Wait 6
    'Print #1 , "AT+UART=14400,8,1,0,0"
    Wait 6
    
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
     Wait 6
    
     Print #1 , "AT+CWJAP=";
     Print #1 , Chr(34);
     Print #1 , "FRITZ!Box 7412";
     Print #1 , Chr(34);
     Print #1 , ",";
     Print #1 , Chr(34);
     Print #1 , "87032725232952315623";
     Print #1 , Chr(34)
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
    
    
     'Print "At+CWASP=" Chr(22) "1234567" Chr(22) "," Chr(22) "1234567890" Chr(22) ",5,3"
     Print #1 , "AT+CWSAP=";
     Print #1 , Chr(34);
     Print #1 , "Testserver1.2";
     Print #1 , Chr(34);
     Print #1 , ",";
     Print #1 , Chr(34);
     Print #1 , "1234567890";
     Print #1 , Chr(34);
     Print #1 , ",5,3"
    
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
    
     Print #1 , "AT+RFPOWER=82"
    
     Waitms 100
    
     Print #1 , "AT+CIPMUX=1"
     Waitms 100
     Print #1 , "AT+CIPSERVER=1,80"                             'Name und Passwort
        Wait 1
       Waitms 100
           Print Inputstring
      Inputstring = ""
      Asciicount = 0
       Print #1 , "AT+CIFSR"
     Waitms 100
     Cls
     Waitms 100
    
     Ip = Mid(inputstring , 87 , 14)
     Waitms 100
     Lcd "IP" ; Ip
     Locate 2 , 1
     Lcd "Port80"
     Waitms 200
     Print Inputstring
    
        Inputstring = ""
      Asciicount = 0
    
    Return
    
    
    
    
    Sub Schreiben(ausgabetext As String , Start_spalte As Word)
       Local Lang As Byte
       Local Count As Byte
       Local Text As String * 1
       Local Tabelleneinsprung As Word
    
    
       Lang = Len(ausgabetext)
       Spalten_nummer = Start_spalte
       For Count = 1 To Lang                                    'nacheinander die einzelnen Buchstaben durchgehen
          Text = Mid(ausgabetext , Count , 1)                   'Einzelbuchstaben herauspicken
          Tabelleneinsprung = Asc(text)                         'Tabelle berechnen minus 32 zeichen.
          Select Case Text
             Case "Ä" : Tabelleneinsprung = &H8E
             Case "Ö" : Tabelleneinsprung = &H99
             Case "Ü" : Tabelleneinsprung = &H9A
             Case "ä" : Tabelleneinsprung = &H84
             Case "ü" : Tabelleneinsprung = &H81
             Case "ö" : Tabelleneinsprung = &H94
             Case "ß" : Tabelleneinsprung = &HE1
          End Select
          Tabelleneinsprung = Tabelleneinsprung - 32
          Tabelleneinsprung = Tabelleneinsprung * 6
          For X = 1 To 6                                        'das bitmuster spaltenweise in den Speicher schreiben (6 Spalten)
             Display_array(spalten_nummer) = Lookup(tabelleneinsprung , Font_6x8)
             Incr Spalten_nummer : Incr Tabelleneinsprung
          Next X
       Next Count
    
    
       'Ausgabe an die Module und den neuen Speicherinnhalt anzeigen lassen
       For Zeile = 1 To 8                                       'nacheinander die Zeilen an allen Modulen aktualisieren
          Spalte = 1
          Cs = 0
          For Modul = 1 To Anzahl_module                        '6 x max 7219 Module
             Temp1 = 0
             For Z = 0 To 7
                Shift Temp1 , Left , 1
                Bit_nr = Zeile - 1
                Temp = Display_array(spalte).bit_nr
                Temp1 = Temp1 + Temp
                Incr Spalte
             Next Z
             Spiout Zeile , 1                                   'MSB
             Spiout Temp1 , 1                                   'LSB
          Next Modul
          Cs = 1
       Next Zeile
    End Sub
    
    
    Sub Am_senden
    
                                                   'Intertechno IT-1500  3er Set  mit Fernbedienung
    Dim I As Integer
    Dim W As Integer
    Dim Binvariable As Bit
    
    
    For W = 0 To 10                                             'den Befehl 30x mal wiederholen
    
       Porta.1 = 1                                              'SyncBit
       Waitus 275
       Porta.1 = 0
       Waitus 2675
    
    For I = 1 To 32
     Binvariable = Adressbyte(i)
      If Binvariable = 0 Then
       Porta.1 = 1                                              'Senden fuer "0"
       Waitus 275
       Porta.1 = 0
       Waitus 275
       Porta.1 = 1
       Waitus 275
       Porta.1 = 0
       Waitus 1225
      End If
    
      If Binvariable = 1 Then
       Porta.1 = 1                                              'Senden fuer "1"
       Waitus 275
       Porta.1 = 0
       Waitus 1225
       Porta.1 = 1
       Waitus 275
       Porta.1 = 0
       Waitus 275
      End If
    Next I
    
       Next W
    End Sub
    
    
    
    Temperaturmessung:
    'Csx = 0
    Waitms 100
    'Shiftin Sox , Clkx , Tempx , 0 , 16 , 100
    'Csx = 1
    'Shift Tempx , Right , 3
    'Tempx = Tempx And &B0000111111111111
    'Tempx1 = Tempx * 0.25
    'Tempx1 = Tempx1 - 1                                         'Sensor Abgleich
    'Print "Temperatur " ; Fusing(tempx1 , "#.##")
    
      '    Test = Fusing(tempx1 , "#.##" )
    
                                                               'all Schreiben(test , 1)
    Return
    
    
    
    
    Init_max7219:                                               ' Initialisieren des MAX7219
       Display_digit = &H0C : Display_daten = &H00              ' Shutdown On
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
       Waitms 5
       Display_digit = &H09 : Display_daten = &H00              ' kein decode "B" für alle Digits
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
       Waitms 5
       Display_digit = &H0A : Display_daten = &H0F              ' Helligkeit 0-F
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
       Waitms 5
       Display_digit = &H0B : Display_daten = 7                 ' Anzahl Digits 8
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
       Waitms 5
       Display_digit = &H0F : Display_daten = 0                 ' Test Off
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
       Waitms 5
       Display_digit = &H0C : Display_daten = 1                 ' Shutdown Off
       Cs = 0
       Waitms 5
       Spiout Display_digit , 1
       Spiout Display_daten , 1
       Cs = 1
      Waitms 5
    Return
    
    
    
    
    Loeschen:
       Temp = 0
       For Modul = 1 To Anzahl_module                           '6 Module angeschlossen
          For Zeile = 1 To 8                                    '8x8 LED-Array löschen
             Cs = 0
             Spiout Zeile , 1
             Spiout Temp , 1
             Cs = 1
          Next Zeile
       Next Modul
    Return
    
    
    Font_6x8:                                                   '6x8font
       Data &H00 , &H00 , &H00 , &H00 , &H00 , &H00             ' &H20
       Data &H00 , &H00 , &H06 , &H5F , &H06 , &H00             ' &H21
       Data &H00 , &H07 , &H03 , &H00 , &H07 , &H03             ' &H22
       Data &H00 , &H24 , &H7E , &H24 , &H7E , &H24             ' &H23
       Data &H00 , &H24 , &H2B , &H6A , &H12 , &H00             ' &H24
       Data &H00 , &H63 , &H13 , &H08 , &H64 , &H63             ' &H25
       Data &H00 , &H36 , &H49 , &H56 , &H20 , &H50             ' &H26
       Data &H00 , &H00 , &H07 , &H03 , &H00 , &H00             ' &H27
       Data &H00 , &H00 , &H3E , &H41 , &H00 , &H00             ' &H28
       Data &H00 , &H00 , &H41 , &H3E , &H00 , &H00             ' &H29
       Data &H00 , &H08 , &H3E , &H1C , &H3E , &H08             ' &H2A
       Data &H00 , &H08 , &H08 , &H3E , &H08 , &H08             ' &H2B
       Data &H00 , &H00 , &HE0 , &H60 , &H00 , &H00             ' &H2C
       Data &H00 , &H08 , &H08 , &H08 , &H08 , &H08             ' &H2D
       Data &H00 , &H00 , &H60 , &H60 , &H00 , &H00             ' &H2E
       Data &H00 , &H20 , &H10 , &H08 , &H04 , &H02             ' &H2F
       Data &H00 , &H3E , &H51 , &H49 , &H45 , &H3E             ' &H30
       Data &H00 , &H00 , &H42 , &H7F , &H40 , &H00             ' &H31
       Data &H00 , &H62 , &H51 , &H49 , &H49 , &H46             ' &H32
       Data &H00 , &H22 , &H49 , &H49 , &H49 , &H36             ' &H33
       Data &H00 , &H18 , &H14 , &H12 , &H7F , &H10             ' &H34
       Data &H00 , &H2F , &H49 , &H49 , &H49 , &H31             ' &H35
       Data &H00 , &H3C , &H4A , &H49 , &H49 , &H30             ' &H36
       Data &H00 , &H01 , &H71 , &H09 , &H05 , &H03             ' &H37
       Data &H00 , &H36 , &H49 , &H49 , &H49 , &H36             ' &H38
       Data &H00 , &H06 , &H49 , &H49 , &H29 , &H1E             ' &H39
       Data &H00 , &H00 , &H6C , &H6C , &H00 , &H00             ' &H3A
       Data &H00 , &H00 , &HEC , &H6C , &H00 , &H00             ' &H3B
       Data &H00 , &H08 , &H14 , &H22 , &H41 , &H00             ' &H3C
       Data &H00 , &H24 , &H24 , &H24 , &H24 , &H24             ' &H3D
       Data &H00 , &H00 , &H41 , &H22 , &H14 , &H08             ' &H3E
       Data &H00 , &H02 , &H01 , &H59 , &H09 , &H06             ' &H3F
       Data &H00 , &H3E , &H41 , &H5D , &H55 , &H1E             ' &H40
       Data &H00 , &H7E , &H11 , &H11 , &H11 , &H7E             ' &H41
       Data &H00 , &H7F , &H49 , &H49 , &H49 , &H36             ' &H42
       Data &H00 , &H3E , &H41 , &H41 , &H41 , &H22             ' &H43
       Data &H00 , &H7F , &H41 , &H41 , &H41 , &H3E             ' &H44
       Data &H00 , &H7F , &H49 , &H49 , &H49 , &H41             ' &H45
       Data &H00 , &H7F , &H09 , &H09 , &H09 , &H01             ' &H46
       Data &H00 , &H3E , &H41 , &H49 , &H49 , &H7A             ' &H47
       Data &H00 , &H7F , &H08 , &H08 , &H08 , &H7F             ' &H48
       Data &H00 , &H00 , &H41 , &H7F , &H41 , &H00             ' &H49
       Data &H00 , &H30 , &H40 , &H40 , &H40 , &H3F             ' &H4A
       Data &H00 , &H7F , &H08 , &H14 , &H22 , &H41             ' &H4B
       Data &H00 , &H7F , &H40 , &H40 , &H40 , &H40             ' &H4C
       Data &H00 , &H7F , &H02 , &H04 , &H02 , &H7F             ' &H4D
       Data &H00 , &H7F , &H02 , &H04 , &H08 , &H7F             ' &H4E
       Data &H00 , &H3E , &H41 , &H41 , &H41 , &H3E             ' &H4F
       Data &H00 , &H7F , &H09 , &H09 , &H09 , &H06             ' &H50
       Data &H00 , &H3E , &H41 , &H51 , &H21 , &H5E             ' &H51
       Data &H00 , &H7F , &H09 , &H09 , &H19 , &H66             ' &H52
       Data &H00 , &H26 , &H49 , &H49 , &H49 , &H32             ' &H53
       Data &H00 , &H01 , &H01 , &H7F , &H01 , &H01             ' &H54
       Data &H00 , &H3F , &H40 , &H40 , &H40 , &H3F             ' &H55
       Data &H00 , &H1F , &H20 , &H40 , &H20 , &H1F             ' &H56
       Data &H00 , &H3F , &H40 , &H3C , &H40 , &H3F             ' &H57
       Data &H00 , &H63 , &H14 , &H08 , &H14 , &H63             ' &H58
       Data &H00 , &H07 , &H08 , &H70 , &H08 , &H07             ' &H59
       Data &H00 , &H71 , &H49 , &H45 , &H43 , &H00             ' &H5A
       Data &H00 , &H00 , &H7F , &H41 , &H41 , &H00             ' &H5B
       Data &H00 , &H02 , &H04 , &H08 , &H10 , &H20             ' &H5C
       Data &H00 , &H00 , &H41 , &H41 , &H7F , &H00             ' &H5D
       Data &H00 , &H04 , &H02 , &H01 , &H02 , &H04             ' &H5E
       Data &H80 , &H80 , &H80 , &H80 , &H80 , &H80             ' &H5F
       Data &H00 , &H00 , &H03 , &H07 , &H00 , &H00             ' &H60
       Data &H00 , &H20 , &H54 , &H54 , &H54 , &H78             ' &H61
       Data &H00 , &H7F , &H44 , &H44 , &H44 , &H38             ' &H62
       Data &H00 , &H38 , &H44 , &H44 , &H44 , &H28             ' &H63
       Data &H00 , &H38 , &H44 , &H44 , &H44 , &H7F             ' &H64
       Data &H00 , &H38 , &H54 , &H54 , &H54 , &H08             ' &H65
       Data &H00 , &H08 , &H7E , &H09 , &H09 , &H00             ' &H66
       Data &H00 , &H18 , &HA4 , &HA4 , &HA4 , &H7C             ' &H67
       Data &H00 , &H7F , &H04 , &H04 , &H78 , &H00             ' &H68
       Data &H00 , &H00 , &H00 , &H7D , &H00 , &H00             ' &H69
       Data &H00 , &H40 , &H80 , &H84 , &H7D , &H00             ' &H6A
       Data &H00 , &H7F , &H10 , &H28 , &H44 , &H00             ' &H6B
       Data &H00 , &H00 , &H00 , &H7F , &H40 , &H00             ' &H6C
       Data &H00 , &H7C , &H04 , &H18 , &H04 , &H78             ' &H6D
       Data &H00 , &H7C , &H04 , &H04 , &H78 , &H00             ' &H6E
       Data &H00 , &H38 , &H44 , &H44 , &H44 , &H38             ' &H6F
       Data &H00 , &HFC , &H44 , &H44 , &H44 , &H38             ' &H70
       Data &H00 , &H38 , &H44 , &H44 , &H44 , &HFC             ' &H71
       Data &H00 , &H44 , &H78 , &H44 , &H04 , &H08             ' &H72
       Data &H00 , &H08 , &H54 , &H54 , &H54 , &H20             ' &H73
       Data &H00 , &H04 , &H3E , &H44 , &H24 , &H00             ' &H74
       Data &H00 , &H3C , &H40 , &H20 , &H7C , &H00             ' &H75
       Data &H00 , &H1C , &H20 , &H40 , &H20 , &H1C             ' &H76
       Data &H00 , &H3C , &H60 , &H30 , &H60 , &H3C             ' &H77
       Data &H00 , &H6C , &H10 , &H10 , &H6C , &H00             ' &H78
       Data &H00 , &H9C , &HA0 , &H60 , &H3C , &H00             ' &H79
       Data &H00 , &H64 , &H54 , &H54 , &H4C , &H00             ' &H7A
       Data &H00 , &H08 , &H3E , &H41 , &H41 , &H00             ' &H7B
       Data &H00 , &H00 , &H00 , &H77 , &H00 , &H00             ' &H7C
       Data &H00 , &H00 , &H41 , &H41 , &H3E , &H08             ' &H7D
       Data &H00 , &H02 , &H01 , &H02 , &H01 , &H00             ' &H7E
       Data &H00 , &H3C , &H26 , &H23 , &H26 , &H3C             ' &H7F
       Data &H00 , &H1E , &HA1 , &HE1 , &H21 , &H12             ' &H80
       Data &H00 , &H3D , &H40 , &H20 , &H7D , &H00             ' &H81
       Data &H00 , &H38 , &H54 , &H54 , &H55 , &H09             ' &H82
       Data &H00 , &H20 , &H55 , &H55 , &H55 , &H78             ' &H83
       Data &H00 , &H20 , &H55 , &H54 , &H55 , &H78             ' &H84
       Data &H00 , &H20 , &H55 , &H55 , &H54 , &H78             ' &H85
       Data &H00 , &H20 , &H57 , &H55 , &H57 , &H78             ' &H86
       Data &H00 , &H1C , &HA2 , &HE2 , &H22 , &H14             ' &H87
       Data &H00 , &H38 , &H55 , &H55 , &H55 , &H08             ' &H88
       Data &H00 , &H38 , &H55 , &H54 , &H55 , &H08             ' &H89
       Data &H00 , &H38 , &H55 , &H55 , &H54 , &H08             ' &H8A
       Data &H00 , &H00 , &H01 , &H7C , &H41 , &H00             ' &H8B
       Data &H00 , &H00 , &H01 , &H7D , &H41 , &H00             ' &H8C
       Data &H00 , &H00 , &H01 , &H7C , &H40 , &H00             ' &H8D
       Data &H00 , &H70 , &H29 , &H24 , &H29 , &H70             ' &H8E
       Data &H00 , &H78 , &H2F , &H25 , &H2F , &H78             ' &H8F
       Data &H00 , &H7C , &H54 , &H54 , &H55 , &H45             ' &H90
       Data &H00 , &H34 , &H54 , &H7C , &H54 , &H58             ' &H91
       Data &H00 , &H7E , &H09 , &H7F , &H49 , &H49             ' &H92
       Data &H00 , &H38 , &H45 , &H45 , &H39 , &H00             ' &H93
       Data &H00 , &H38 , &H45 , &H44 , &H39 , &H00             ' &H94
       Data &H00 , &H39 , &H45 , &H44 , &H38 , &H00             ' &H95
       Data &H00 , &H3C , &H41 , &H21 , &H7D , &H00             ' &H96
       Data &H00 , &H3D , &H41 , &H20 , &H7C , &H00             ' &H97
       Data &H00 , &H9C , &HA1 , &H60 , &H3D , &H00             ' &H98
       Data &H00 , &H3D , &H42 , &H42 , &H3D , &H00             ' &H99
       Data &H00 , &H3C , &H41 , &H40 , &H3D , &H00             ' &H9A
       Data &H80 , &H70 , &H68 , &H58 , &H38 , &H04             ' &H9B
       Data &H00 , &H48 , &H3E , &H49 , &H49 , &H62             ' &H9C
       Data &H00 , &H7E , &H61 , &H5D , &H43 , &H3F             ' &H9D
       Data &H00 , &H22 , &H14 , &H08 , &H14 , &H22             ' &H9E
       Data &H00 , &H40 , &H88 , &H7E , &H09 , &H02             ' &H9F
       Data &H00 , &H20 , &H54 , &H55 , &H55 , &H78             ' &HA0
       Data &H00 , &H00 , &H00 , &H7D , &H41 , &H00             ' &HA1
       Data &H00 , &H38 , &H44 , &H45 , &H39 , &H00             ' &HA2
       Data &H00 , &H3C , &H40 , &H21 , &H7D , &H00             ' &HA3
       Data &H00 , &H7A , &H09 , &H0A , &H71 , &H00             ' &HA4
       Data &H00 , &H7A , &H11 , &H22 , &H79 , &H00             ' &HA5
       Data &H00 , &H08 , &H55 , &H55 , &H55 , &H5E             ' &HA6
       Data &H00 , &H4E , &H51 , &H51 , &H4E , &H00             ' &HA7
       Data &H00 , &H30 , &H48 , &H4D , &H40 , &H20             ' &HA8
       Data &H3E , &H41 , &H5D , &H4B , &H55 , &H3E             ' &HA9
       Data &H04 , &H04 , &H04 , &H04 , &H04 , &H1C             ' &HAA
       Data &H00 , &H17 , &H08 , &H4C , &H6A , &H50             ' &HAB
       Data &H00 , &H17 , &H08 , &H34 , &H2A , &H78             ' &HAC
       Data &H00 , &H00 , &H30 , &H7D , &H30 , &H00             ' &HAD
       Data &H00 , &H08 , &H14 , &H00 , &H08 , &H14             ' &HAE
       Data &H00 , &H14 , &H08 , &H00 , &H14 , &H08             ' &HAF
       Data &H44 , &H11 , &H44 , &H11 , &H44 , &H11             ' &HB0
       Data &HAA , &H55 , &HAA , &H55 , &HAA , &H55             ' &HB1
       Data &HBB , &HEE , &HBB , &HEE , &HBB , &HEE             ' &HB2
       Data &H00 , &H00 , &H00 , &HFF , &H00 , &H00             ' &HB3
       Data &H08 , &H08 , &H08 , &HFF , &H00 , &H00             ' &HB4
       Data &H00 , &H70 , &H28 , &H25 , &H29 , &H70             ' &HB5
       Data &H00 , &H70 , &H29 , &H25 , &H29 , &H70             ' &HB6
       Data &H00 , &H70 , &H29 , &H25 , &H28 , &H70             ' &HB7
       Data &H3E , &H41 , &H5D , &H55 , &H41 , &H3E             ' &HB8
       Data &H0A , &HFB , &H00 , &HFF , &H00 , &H00             ' &HB9
       Data &H00 , &HFF , &H00 , &HFF , &H00 , &H00             ' &HBA
       Data &H0A , &HFA , &H02 , &HFE , &H00 , &H00             ' &HBB
       Data &H0A , &H0B , &H08 , &H0F , &H00 , &H00             ' &HBC
       Data &H00 , &H18 , &H24 , &H66 , &H24 , &H00             ' &HBD
       Data &H00 , &H29 , &H2A , &H7C , &H2A , &H29             ' &HBE
       Data &H08 , &H08 , &H08 , &HF8 , &H00 , &H00             ' &HBF
       Data &H00 , &H00 , &H00 , &H0F , &H08 , &H08             ' &HC0
       Data &H08 , &H08 , &H08 , &H0F , &H08 , &H08             ' &HC1
       Data &H08 , &H08 , &H08 , &HF8 , &H08 , &H08             ' &HC2
       Data &H00 , &H00 , &H00 , &HFF , &H08 , &H08             ' &HC3
       Data &H08 , &H08 , &H08 , &H08 , &H08 , &H08             ' &HC4
       Data &H08 , &H08 , &H08 , &HFF , &H08 , &H08             ' &HC5
       Data &H00 , &H20 , &H56 , &H55 , &H56 , &H79             ' &HC6
       Data &H00 , &H70 , &H2A , &H25 , &H2A , &H71             ' &HC7
       Data &H00 , &H0F , &H08 , &H0B , &H0A , &H0A             ' &HC8
       Data &H00 , &HFE , &H02 , &HFA , &H0A , &H0A             ' &HC9
       Data &H0A , &H0B , &H08 , &H0B , &H0A , &H0A             ' &HCA
       Data &H0A , &HFA , &H02 , &HFA , &H0A , &H0A             ' &HCB
       Data &H00 , &HFF , &H00 , &HFB , &H0A , &H0A             ' &HCC
       Data &H0A , &H0A , &H0A , &H0A , &H0A , &H0A             ' &HCD
       Data &H0A , &HFB , &H00 , &HFB , &H0A , &H0A             ' &HCE
       Data &H00 , &H5D , &H22 , &H22 , &H22 , &H5D             ' &HCF
       Data &H00 , &H22 , &H55 , &H59 , &H30 , &H00             ' &HD0
       Data &H00 , &H08 , &H7F , &H49 , &H41 , &H3E             ' &HD1
       Data &H00 , &H7C , &H55 , &H55 , &H55 , &H44             ' &HD2
       Data &H00 , &H7C , &H55 , &H54 , &H55 , &H44             ' &HD3
       Data &H00 , &H7C , &H55 , &H55 , &H54 , &H44             ' &HD4
       Data &H00 , &H00 , &H00 , &H07 , &H00 , &H00             ' &HD5
       Data &H00 , &H00 , &H44 , &H7D , &H45 , &H00             ' &HD6
       Data &H00 , &H00 , &H45 , &H7D , &H45 , &H00             ' &HD7
       Data &H00 , &H00 , &H45 , &H7C , &H45 , &H00             ' &HD8
       Data &H08 , &H08 , &H08 , &H0F , &H00 , &H00             ' &HD9
       Data &H00 , &H00 , &H00 , &HF8 , &H08 , &H08             ' &HDA
       Data &HFF , &HFF , &HFF , &HFF , &HFF , &HFF             ' &HDB
       Data &HF0 , &HF0 , &HF0 , &HF0 , &HF0 , &HF0             ' &HDC
       Data &H00 , &H00 , &H00 , &H77 , &H00 , &H00             ' &HDD
       Data &H00 , &H00 , &H45 , &H7D , &H44 , &H00             ' &HDE
       Data &H0F , &H0F , &H0F , &H0F , &H0F , &H0F             ' &HDF
       Data &H00 , &H3C , &H42 , &H43 , &H3D , &H00             ' &HE0
       Data &H00 , &HFE , &H4A , &H4A , &H34 , &H00             ' &HE1
       Data &H00 , &H3C , &H43 , &H43 , &H3D , &H00             ' &HE2
       Data &H00 , &H3D , &H43 , &H42 , &H3C , &H00             ' &HE3
       Data &H00 , &H32 , &H49 , &H4A , &H31 , &H00             ' &HE4
       Data &H00 , &H3A , &H45 , &H46 , &H39 , &H00             ' &HE5
       Data &H00 , &HFC , &H20 , &H20 , &H1C , &H00             ' &HE6
       Data &H00 , &HFE , &HAA , &H28 , &H10 , &H00             ' &HE7
       Data &H00 , &HFF , &HA5 , &H24 , &H18 , &H00             ' &HE8
       Data &H00 , &H3C , &H40 , &H41 , &H3D , &H00             ' &HE9
       Data &H00 , &H3C , &H41 , &H41 , &H3D , &H00             ' &HEA
       Data &H00 , &H3D , &H41 , &H40 , &H3C , &H00             ' &HEB
       Data &H00 , &H9C , &HA0 , &H61 , &H3D , &H00             ' &HEC
       Data &H00 , &H04 , &H08 , &H71 , &H09 , &H04             ' &HED
       Data &H00 , &H00 , &H02 , &H02 , &H02 , &H00             ' &HEE
       Data &H00 , &H00 , &H07 , &H03 , &H00 , &H00             ' &HEF
       Data &H00 , &H00 , &H08 , &H08 , &H08 , &H00             ' &HF0
       Data &H00 , &H00 , &H24 , &H2E , &H24 , &H00             ' &HF1
       Data &H00 , &H24 , &H24 , &H24 , &H24 , &H24             ' &HF2
       Data &H05 , &H17 , &H0A , &H34 , &H2A , &H78             ' &HF3
       Data &H00 , &H06 , &H09 , &H7F , &H01 , &H7F             ' &HF4
       Data &H00 , &H22 , &H4D , &H55 , &H59 , &H22             ' &HF5
       Data &H00 , &H08 , &H08 , &H2A , &H08 , &H08             ' &HF6
       Data &H00 , &H00 , &H08 , &H18 , &H18 , &H00             ' &HF7
       Data &H00 , &H06 , &H09 , &H09 , &H06 , &H00             ' &HF8
       Data &H00 , &H00 , &H08 , &H00 , &H08 , &H00             ' &HF9
       Data &H00 , &H00 , &H08 , &H00 , &H00 , &H00             ' &HFA
       Data &H00 , &H02 , &H0F , &H00 , &H00 , &H00             ' &HFB
       Data &H00 , &H09 , &H0F , &H05 , &H00 , &H00             ' &HFC
       Data &H00 , &H09 , &H0D , &H0A , &H00 , &H00             ' &HFD
       Data &H00 , &H3C , &H3C , &H3C , &H3C , &H00             ' &HFE
       Data &H00 , &H00 , &H00 , &H00 , &H00 , &H00             ' &HFF
    
    
    Onrxd1:
    Onrxdbyte = Chr(udr1)
    'Print Onrxdbyte;                                            'Hier wird jedes ASCII zum String Addiert
    Inputstring = Inputstring + Onrxdbyte
    Return
    
    Return


    3 Schalter die erst dann den Zustand übernehmen, wenn man im Formular (Editfeld) ein Passwort eingibt.

    Klicken Sie auf die Grafik für eine größere Ansicht 

Name:	webserver.png 
Hits:	32 
Größe:	63,8 KB 
ID:	371
    Geändert von Sk8erboi (18.01.2017 um 22:10 Uhr)

  2. #2
    Administrator Avatar von DON
    Registriert seit
    19.11.2016
    Ort
    Herford
    Beiträge
    371
    Genau das brauchen wir Bascom mit ESP8266 das selbe versuche Ich mal mit Lua.
    Leider sind die "AT" befehle verschwunden wenn man Lua drauf macht müste mit Arduino das selbe sein.
    Ein Mensch mag noch so herausragende Fähigkeiten haben – wenn er arrogant und selbstsüchtig ist, sind sie nichts wert.
    Konfuzius


  3. #3
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32
    Ich glaube, die AT-Command-Firmware bleibt bei Arduino erhalten.
    Zumindest hab ich etwas davon gelesen aber es nie selbst versucht.

  4. #4
    Premium-User Avatar von darasol
    Registriert seit
    02.11.2016
    Beiträge
    61
    Nur zum Verständnis :P Das ganze funktioniert jetzt mit einem ESP8266 mit der Standard AT-Firmware der Seriell an nem Atmega hängt ?

  5. #5
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32
    ja richtig

  6. #6
    Premium-User Avatar von darasol
    Registriert seit
    02.11.2016
    Beiträge
    61
    Sauber Danke. Genau das was gefehlt hat. Gute Leistung

  7. #7
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32
    Du solltest die Baudrate des esp8266 anpassen

    AT+UART=Baudrate,8,1,0,0 'für 8N1
    mein Arduino war bei 115200 Baud über seinen Limits.
    Da UART0 dem FT232 und der USB-Schnittstelle gehört, habe ich in der ISR einfach jedes Empfangende Byte von UART1
    an UART0 gesendet.
    Mit "ATE1" quittiert der ESP mit der Rückgabe des Bytes, sodass man per USB alles mitlesen kann.
    Bei ganz hohen Baudraten sollte man es vielleicht entfernen, da es zu Störungen führen kann und die ISR zeitlich zu lang macht.

    Dann sollte man noch irgendwo timeouts einfügen.
    Code:
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Wend
    Waitms 20
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    Waitms 20
    Hab beim Firefox das Problem, dass er immer wieder eine Verbindung aufbaut und dann einfach aufhört.
    Das Programm steht dann für immer in der Schleife und empfängt kein ">" bzw "Send ok"

    Nicht oft, aber es stört.
    Ich arbeite mit Watchdog und werde das in den nächsten Tagen noch ändern.

    Warum das so ist, habe ich auch rausgefunden.

    Print #1 , "Content-Length: 4600"
    Der Firefox erwartet dadurch mehr Zeichen(Bytes) als ich sende.
    Ihn stört es nicht, ob die Verbindung vom esp8266 unterbrochen wurde.



    Die Lösung wäre; alle ausgehenden Bytes zu zählen und im Vorfeld bei Content-Length anzugeben.
    Eine "dreckige Lösung" wäre, einfach die oben genannten Timeouts einzufügen.
    der ESP antwortet einfach mit "ERROR" wenn er etwas empfängt aber die Verbindung nicht mehr besteht.

    Wenn du das Projekt erweiterst, denke daran: TCP maximal irgendwas mit 1400 Bytes pro Paket.
    Die Erfahrung habe ich mit Wireshark gemacht nachdem viele Zeichen meiner HTML verschwanden und verschluckt wurden.
    Zwischen den Paketen immer:
    Warten bis "SEND OK" vom vorherigen Paket eingegangen ist
    und beim Übertragen dann auf das ">" warten.
    CIPSENDEX .... "\0" gibt dem ESP den Befehl die empfangenen Daten abzusenden.
    Heißt soviel wie "hier ist Ende, Feuer frei"
    Geändert von Sk8erboi (10.01.2017 um 20:38 Uhr)

  8. #8
    Premium-User Avatar von darasol
    Registriert seit
    02.11.2016
    Beiträge
    61
    Warten bis "SEND OK" vom vorherigen Paket eingegangen ist
    und beim Übertragen dann auf das ">" warten.
    CIPSENDEX .... "\0" gibt dem ESP den Befehl die empfangenen Daten abzusenden.
    Heißt soviel wie "hier ist Ende, Feuer frei"
    Das mit den Pausen hab ich schon mal wo gelesen. Da der ESP wohl Probleme macht wenn neuer Input kommt bevor er mit OK geantwortet hat hat. Der ESP überspringt das dann wohl und meldet sich nur mit "Busy..." Oder meintest du was anderes? Also mal unabhängig vom Firefox wie ich das verstanden habe. Der ESP ist da wohl manchmal etwas träge.

  9. #9
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32
    Es gibt mehrere Möglichkeiten, die Datenpakete zu senden.

    1: Cipsend,Kanal,Bytemenge Man gibt die Bytes an, die man anschließend dem ESP seriell sendet. (max 2048)
    2: Cipsendbuf,Kanal,Bytemenge Man Buffert (schlickt dem ESP seriell) die Daten in der Zeit, wo der ESP mit dem Versenden des TCP-Paketes beschäftigt ist.
    Vorteil hier: Dies ist sehr performant
    3:Cipsendex,,Kanal,Bytemenge ...\0 Man sendet so lange bis Anzahl der gesendeten Bytes=Bytemenge ODER Bytekombination "\0" gesendet bzw vom ESP empfangen wurde.

    In jedem Fall, mag der ESP keine Bytes die nicht deklariert wurden.
    Weder eines zu wenig, noch eines zuviel.
    auch keines, nach "\0"
    -> Sonst ist er verärgert und gibt an, dass er doch beschäftigt sei.

    Wenn man also ankündigt, dass man 2000 Bytes an den ESP schickt, sollte man dies auch machen!
    Auch kann man während der Zeit keine AT-Commands senden.
    Geändert von Sk8erboi (11.01.2017 um 10:46 Uhr)

  10. #10
    Platinenputzer Avatar von Sk8erboi
    Registriert seit
    08.11.2016
    Ort
    Koblenz
    Alter
    29
    Beiträge
    32
    Code:
    dim weitersprung as Integer
    Code:
    Inputstring = ""
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    
    
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = ">"
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    
    Print #1 , "HTTP/1.1 200 OK"
    Print #1 , "Content-Language: de"
    'Print #1 , "Content-Length: 4600" '3260 "
    Print #1 , "Content-Type: text/html; charset=UTF-8"
    
    Print #1 , "Connection: close"
    Print #1 , "Server: Dirty sunchez"
    
    
    Print #1 , ""
    
    
     Print #1 , "<!doctype Html>"
    
     Print #1 , "<html>"
     Print #1 , "<head>"
    
     '<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAASihoAAAAAAP///wAf8i0ABowOAM/PzwCZmZkAra2t
     'APDw8AC/vb4AE70eAODe3wAcxycAioqKAFRUVAAQnhkACKgTAAR9DAAT8CIARUVFACD1LgAPDw8ALi4tAA6cFwAcHBwAGK0iAHp6egAJ2xcAZmVlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ0GBgcHCQkFBQsLCAgCAhoNDQYGDw8JCQQECwsICAIaGg0NBhsPBwkQBAULCwgIHBoaDQ0bDwcHEAQFBQsLCBwcGhoSGxsbEBAEBAUFCwsOGQAaEhIbGxsQEAQJD
     'AQLDhkAHAMDEhsbEBAECQwEBRMZABwSAxIbGxAQBAcMAAUTGQAOAwMSGxsQEAQHDAAJFhkADgMDEhsbGxAEBgwACRYWExMODhwcGhoNDQYGBwcYFhYTFBsbCgoXFxENBgYHGBgWFhQUDhsKHBcRDQ0GBhUYGBYWFB
     'QbCgoXGhoNDQYVFRgYGxYUGxsKHBsaGg0NARUVGxgWFhMTDg4cGxoaDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" rel="icon" type="image/x-icon" />
     Print #1 , "<meta http-equiv=";
     Print #1 , Chr(34);
     Print #1 , "Refresh";
     Print #1 , Chr(34);
     Print #1 , "Content=";
     Print #1 , Chr(34);
     Print #1 , "90";
     Print #1 , Chr(34);
     Print #1 , "/>"
    
    Print #1 , "<title>Mathias Tenge Smarthome</title>"
    Print #1 , "<style>"
    Print #1 , "*,:before,:after{"
    Print #1 , "box-sizing:border-box;"
    Print #1 , "margin:0;"
    Print #1 , "padding:0;"
    Print #1 , "/*transition*/"
    Print #1 , "-webkit-transition:.25s ease-in-out;"
    Print #1 , "   -moz-transition:.25s ease-in-out;"
    Print #1 , "     -o-transition:.25s ease-in-out;"
    Print #1 , "        transition:.25s ease-in-out;"
    Print #1 , "outline:none;"
    Print #1 , "font-family:Helvetica Neue,helvetica,arial,verdana,sans-serif;"
    Print #1 , "}"
    Print #1 , "body{"
    Print #1 , "background:#f1f1f1;"
    Print #1 , "}"
    Print #1 , "h1{"
    Print #1 , "margin: -20px -50px;"
    Print #1 , "text-align:center;"
    Print #1 , "font-weight:10;"
    Print #1 , "color:#4b4b4b;"
    Print #1 , "}"
    Print #1 , "#toggles{"
    Print #1 , "width:60px;"
    Print #1 , "margin:50px auto;"
    Print #1 , "text-align:center;"
    Print #1 , "}"
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = "SEND OK"
    End If
    Wend
    
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = ">"
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    
    Print #1 , ".ios-toggle,.ios-toggle:active{"
    Print #1 , "position:absolute;"
    Print #1 , "top:-5000px;"
    Print #1 , "height:0;"
    Print #1 , "width:0;"
    Print #1 , "opacity:0;"
    Print #1 , "border:none;"
    Print #1 , "outline:none;"
    Print #1 , "}"
    Print #1 , ".checkbox-label{"
    Print #1 , "display:block;"
    Print #1 , "position:relative;"
    Print #1 , "padding:10px;"
    Print #1 , "margin-bottom:20px;"
    Print #1 , "font-size:12px;"
    Print #1 , "line-height:16px;"
    Print #1 , "width:100%;"
    Print #1 , "height:36px;"
    Print #1 , "/*border-radius*/"
    Print #1 , "-webkit-border-radius:18px;"
    Print #1 , "   -moz-border-radius:18px;"
    Print #1 , "        border-radius:18px;"
    Print #1 , "background:#f8f8f8;"
    Print #1 , "cursor:pointer;"
    Print #1 , "}"
    Print #1 , ".checkbox-label:before{"
    Print #1 , "content:" ; Chr(39) ; Chr(39) ; ";"
    Print #1 , "display:block;"
    Print #1 , "position:absolute;"
    Print #1 , "z-index:1;"
    Print #1 , "line-height:34px;"
    Print #1 , "text-indent:40px;"
    Print #1 , "height:36px;"
    Print #1 , "width:36px;"
    Print #1 , "/*border-radius*/"
    Print #1 , "-webkit-border-radius:100%;"
    Print #1 , "   -moz-border-radius:100%;"
    Print #1 , "        border-radius:100%;"
    Print #1 , "top:0px;"
    Print #1 , "left:0px;"
    Print #1 , "right:auto;"
    Print #1 , "background:white;"
    
    Print #1 , "-webkit-box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "   -moz-box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "        box-shadow:0 3px 3px rgba(0,0,0,.2),0 0 0 2px #dddddd;"
    Print #1 , "}"
    
    
    
    Print #1 , ".checkbox-label:after{"
    Print #1 , "content:attr(data-off);"
    Print #1 , "Display:Block;"
    Print #1 , "position:absolute;"
    Print #1 , "z-index:0;"
    Print #1 , "top:0;"
    Print #1 , "left:-300px;"
    Print #1 , "Padding:10px;"
    Print #1 , "height:100%;"
    Print #1 , "width:300px;"
    Print #1 , "text-align:right;"
    Print #1 , "color:#bfbfbf;"
    Print #1 , "white-space:nowrap;"
    Print #1 , "}"
    
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = "SEND OK"
    End If
    Wend
    
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = ">"
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    Print #1 , ".ios-toggle:checked + .checkbox-label{"
     Print #1 , "/*Paket3*/"
    Print #1 , "-webkit-box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "        box-shadow:inset 0 0 0 20px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "}"
    
    Print #1 , ".ios-toggle:checked + .checkbox-label:before{"
    Print #1 , "left:calc(100% - 36px);"
    Print #1 , "/*box-shadow*/"
    Print #1 , "-webkit-box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "   -moz-box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "        box-shadow:0 0 0 2px transparent,0 3px 3px rgba(0,0,0,.3);"
    Print #1 , "}"
    Print #1 , ".ios-toggle:checked + .checkbox-label:after{"
    Print #1 , "content:attr(data-on);"
    Print #1 , "left:60px;"
    Print #1 , "width:36px;"
    Print #1 , "}"
    Print #1 , "/* GREEN CHECKBOX */"
    
    
    
    Print #1 , "#checkbox {"
    Print #1 , "/*box-shadow*/"
    Print #1 , "-webkit-box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "        box-shadow:inset 0 0 0 0px rgba(19,191,17,1),0 0 0 2px #dddddd;"
    Print #1 , "}"
    Print #1 , "#checkbox:checked {"
    Print #1 , "/*box-shadow*/"
    
    
    
    
    
    Print #1 , "-webkit-box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "   -moz-box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "        box-shadow:inset 0 0 0 18px rgba(19,191,17,1),0 0 0 2px rgba(19,191,17,1);"
    Print #1 , "}"
    Print #1 , "#checkbox:checked + .checkbox-label:after{"
    Print #1 , "color:rgba(19,191,17,1);"
    Print #1 , "}"
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = "SEND OK"
    End If
    Wend
    
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = ">"
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    
    Print #1 , ".submitter {"
    Print #1 , "    height:48px;"
    Print #1 , "    width:100px;"
    Print #1 , "    margin: -20px -50px;"
    Print #1 , "    top:50%;"
    Print #1 , "    left:50%;"
    Print #1 , "}"
    Print #1 , "</style>"
    Print #1 , "</head>"
    Print #1 , "<body>"
    
    Print #1 , " <Form Action=" ; Chr(34) ; "/" ; Chr(34) ; " method=POST" ; ">"
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = "SEND OK"
    End If
    Wend
    
    
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    Weitersprung = 0
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = ">"
    End If
    Imstringint = Instr(inputstring , ">")
    Waitms 20
    Wend
    
    
    If Led1 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED1=AN" ; Chr(34) ; " name=" ; Chr(34) ; "1AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led1 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED1=AN" ; Chr(34) ; " name=" ; Chr(34) ; "1AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox1" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
    
          Print #1 , "<h1>Alle Funksteckdosen</h1>"
    Print #1 , "<BR>"
    If Led2 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED2=AN" ; Chr(34) ; " name=" ; Chr(34) ; "2AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led2 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED2=AN" ; Chr(34) ; " name=" ; Chr(34) ; "2AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox2" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
          Print #1 , "<h1>Weltherrschaft besitzen</h1>"
    Print #1 , "<BR>"
    
          If Led3 = 0 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED3=AN" ; Chr(34) ; " name=" ; Chr(34) ; "3AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " unchecked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
         End If
    
      If Led3 = 1 Then
    Print #1 , "  <div id=" ; Chr(34) ; "toggles" ; Chr(34) ; "> "
    Print #1 , "  <input type=" ; Chr(34) ; "checkbox" ; Chr(34) ; " value=" ; Chr(34) ; "LED3=AN" ; Chr(34) ; " name=" ; Chr(34) ; "3AN" ; Chr(34) ; " id=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "ios-toggle" ; Chr(34) ; " checked/>"
    Print #1 , "  <label for=" ; Chr(34) ; "checkbox3" ; Chr(34) ; " class=" ; Chr(34) ; "checkbox-label" ; Chr(34) ; " data-off=" ; Chr(34) ; "off" ; Chr(34) ; " data-on=" ; Chr(34) ; "on" ; Chr(34) ; "></label>"
    
          End If
    
    Print #1 , "<h1>Alles zerstoeren</h1>"
    Print #1 , "<BR>"
    
      Print #1 , "<br>"
     Print #1 , "<br>"
     Print #1 , "<br>"
     Print #1 , "<br>"
    
    
    
    Print #1 , "    <input type=" ; Chr(34) ; "text" ; Chr(34) ; " name=" ; Chr(34) ; "field1" ; Chr(34) ; " class=" ; Chr(34) ; "submitter" ; Chr(34) ; ">"
    Print #1 , "    <br>"
    Print #1 , "<br><br>"
    Print #1 , "<input type=" ; Chr(34) ; "submit" ; Chr(34) ; " value=" ; Chr(34) ; "send" ; Chr(34) ; " class=" ; Chr(34) ; "submitter" ; Chr(34) ; "/>"
    
    
    
    
    
    
    
    
     Print #1 , "<br>"
     Print #1 , "<br>"
    
     Print #1 , "</body>"
     Print #1 , "</html>"
    
    
    
    
    Weitersprung = 0
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Weitersprung = Weitersprung + 1
    If Weitersprung > 10 Then
    Inputstring = "SEND OK"
    End If
    Wend
    
    Waitms 10
              Print #1 , "AT+CIPCLOSE=0"
    
     Cls
    Locate 2 , 1
     Lcd "Port80"
    
    
    
    
    
    '___________________________________________________________________________________
    '___________________________________________________________________________________
    
    End If
    
    Loop
    End
    '#####################################################  Main-Frame
    
    
    
    
    
    Esp8266rst:
     Wait 3
     Print #1 , "ATE1"
     Wait 1
     Print #1 , "AT+RST"
     Wait 1
     Print #1 , "AT+SLEEP=0"
     Waitms 100
     Print #1 , "AT+CWMODE=3"
     'Waitms 100
     'Print #1 , "AT+UART=115200,8,1,0,0"
    
     Waitms 100
    
     Print #1 , "AT+CWLAP"
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
     Wait 6
    
     Print #1 , "AT+CWJAP=";
     Print #1 , Chr(34);
     Print #1 , "FRITZ!Box 7412";
     Print #1 , Chr(34);
     Print #1 , ",";
     Print #1 , Chr(34);
     Print #1 , "87032725232952315623";
     Print #1 , Chr(34)
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
    
    
     'Print "At+CWASP=" Chr(22) "1234567" Chr(22) "," Chr(22) "1234567890" Chr(22) ",5,3"
     Print #1 , "AT+CWSAP=";
     Print #1 , Chr(34);
     Print #1 , "Testserver1.2";
     Print #1 , Chr(34);
     Print #1 , ",";
     Print #1 , Chr(34);
     Print #1 , "1234567890";
     Print #1 , Chr(34);
     Print #1 , ",5,3"
    
    
     Wait 6
    
    Wait 6
    
    Wait 6
    
    
     Print #1 , "AT+RFPOWER=82"
    
     Waitms 100
    
     Print #1 , "AT+CIPMUX=1"
     Waitms 100
     Print #1 , "AT+CIPSERVER=1,80"                             'Name und Passwort
        Wait 1
       Waitms 100
           Print Inputstring
      Inputstring = ""
      Asciicount = 0
       Print #1 , "AT+CIFSR"
     Waitms 100
     Cls
     Ip = Mid(inputstring , 87 , 14)
     Lcd "IP" ; Ip
     Locate 2 , 1
     Lcd "Port80"
     Call Schreiben(ip , 1)
     Print Inputstring
        Inputstring = ""
      Asciicount = 0
    
    Return
    läuft bei mir gut

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •