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
    31

    Atmega & ESP8266 Webserver

    Code:
    $regfile = "m2560def.dat"
    $crystal = 16000000
    $hwstack = 80
    $swstack = 80
    $framesize = 80
    Baud 19200
    
    
    
    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 = 19200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
    Open "com2:" For Binary As #1
    Enable Interrupts
    
    
    
     On Urxc1 Onrxd1                                            'ISR zum Empfang der einzelnen ASCIIs
    Enable Urxc1
    
    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
    '_______________________________
    
    Dim Losgehtsflag As Bit
    Losgehtsflag = 0
    
    
    Cls
    Lcd "Webserver Tenge"
    
    Dim Led1 As Bit
    Dim Led1int As Integer
    Dim Led2 As Bit
    Dim Led2int As Integer
    Dim Led3 As Bit
    Dim Led3int As Integer
    Dim Led4 As Bit
    Dim Led4int As Integer
    Dim Ip As String * 16
    Dim Ausgabelcd As String * 10
    
    Led1 = 0
    Led2 = 0
    Led3 = 0
    Led4 = 0
    
     Enable Interrupts
    Gosub Esp8266rst
    
    Do
    
    
    
    
    Imstringint = Instr(inputstring , "Host:")
    If Imstringint > 0 Then
    
    
       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
    
    Inputstring = ""
    Print #1 , "AT+CIPSENDEX=0,2000"
    
    
    
    
    Imstringint = Instr(inputstring , ">")
    While Imstringint = 0
    Imstringint = Instr(inputstring , ">")
    
    Wend
    Waitms 30
    
    
    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>"
     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:150px auto 0 auto;"
    Print #1 , "text-align:center;"
    Print #1 , "font-weight:200;"
    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 , "}"
    
    
    Inputstring = ""
    Print #1 , "\0";
    
    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
    
    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 , "}"
    
    
    
    Inputstring = ""
    Print #1 , "\0";
    
    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
    
    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 , "}"
    
    
    
    Inputstring = ""
    Print #1 , "\0";
    
    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
    
    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) ; "index.html" ; Chr(34) ; ">"
    
    
         Inputstring = ""
    Print #1 , "\0";
    
    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
    
    
    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
    
    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
    
          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 , "<BR><BR><BR><BR><BR><BR><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>"
    
    
    
    
    
    
    
    
    Inputstring = ""
    Print #1 , "\0";
    
    Imstringint = Instr(inputstring , "SEND OK")
    While Imstringint = 0
    Imstringint = Instr(inputstring , "SEND OK")
    Waitms 20
    Wend
    
    
              Print #1 , "AT+CIPCLOSE=0"
              Waitms 500
    
    
    
    
    
    
    
    '___________________________________________________________________________________
    '___________________________________________________________________________________
    
    End If
    
    Loop
    End
    
    
    
    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+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"
    
     Print Inputstring
        Inputstring = ""
      Asciicount = 0
    
    Return
    
    
    
    
    
      Onrxd1:
    Onrxdbyte = Chr(udr1)
    Print Onrxdbyte;                                            'Hier wird jedes ASCII zum String Addiert
    Inputstring = Inputstring + Onrxdbyte
    Asciicount = Asciicount + 1
    
    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:	28 
Größe:	63,8 KB 
ID:	371
    Geändert von Sk8erboi (07.01.2017 um 19:33 Uhr)

  2. #2
    Administrator Avatar von DON
    Registriert seit
    19.11.2016
    Ort
    Herford
    Beiträge
    366
    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
    31
    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
    55
    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
    31
    ja richtig

  6. #6
    Premium-User Avatar von darasol
    Registriert seit
    02.11.2016
    Beiträge
    55
    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
    31
    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
    55
    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
    31
    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
    31
    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
  •