<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Andreas,</p>
    <p>hatte mich damals hier eingeklinkt, weil ich auch die
      Ventil-Funktion nutzen wollte. Geht hat momentan noch nicht ohne
      Hilfs-Script - hat insofern schon was damit zu tuen - hätte
      vielleicht damals einen neuen Thread starten sollen - sorry!</p>
    <p>MfG Torsten<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Am 07.10.2016 um 20:03 schrieb Andreas
      Goetz:<br>
    </div>
    <blockquote
      cite="mid:8C897FEF-D537-4D96-A5DF-EC039B54782F@gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <br class="">
      <div>
        <blockquote type="cite" class="">
          <div class="">On 7 Oct 2016, at 20:00, Christian Schnellrieder
            <<a moz-do-not-send="true"
              href="mailto:schnellrieder.cs@gmail.com" class="">schnellrieder.cs@gmail.com</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <div dir="ltr" class="">time war schon immer importiert.</div>
          </div>
        </blockquote>
        <div><br class="">
        </div>
        Dann klinke ich mich mal aus. Hat mit dem Thema dieses Threads
        nichts zu tun und artet in Rätselraten aus :(</div>
      <div><br class="">
        <blockquote type="cite" class="">
          <div class="">
            <div dir="ltr" class="">
              <div class="">Was ich nicht verstehe wie du die Daten
                selbst übergibst. Warum nicht einfach einen POST direkt
                an die middleware?</div>
              <div class=""><br class="">
              </div>
              <div class="">Grüße</div>
              <div class=""><br class="">
              </div>
            </div>
            <br class="">
            <div class="gmail_quote">
              <div dir="ltr" class="">Andreas Goetz <<a
                  moz-do-not-send="true" href="mailto:cpuidle@gmail.com"
                  class="">cpuidle@gmail.com</a>> schrieb am Fr., 7.
                Okt. 2016 um 19:56 Uhr:<br class="">
              </div>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div style="word-wrap:break-word" class="gmail_msg">Ich
                  verstehe das Problem nicht- Du hast das Skript
                  unterbrochen. Der Syntax Error ist ja weg seitdem Du
                  time auch importierst?
                  <div class="gmail_msg"><br class="gmail_msg">
                  </div>
                  <div class="gmail_msg">Welcher Fehler? Bei welchem-
                    vollständigen und möglichst minimalem- Skript?</div>
                  <div class="gmail_msg"><br class="gmail_msg">
                  </div>
                  <div class="gmail_msg">Viele Grüße, Andreas</div>
                </div>
                <div style="word-wrap:break-word" class="gmail_msg">
                  <div class="gmail_msg"><br class="gmail_msg">
                    <div class="gmail_msg"><br class="gmail_msg">
                      <div class="gmail_msg">
                        <blockquote type="cite" class="gmail_msg">
                          <div class="gmail_msg">On 7 Oct 2016, at
                            07:37, Andreas Götz <<a
                              moz-do-not-send="true"
                              href="mailto:cpuidle@gmail.com"
                              class="gmail_msg" target="_blank">cpuidle@gmail.com</a>>
                            wrote:</div>
                          <br class="gmail_msg
                            m_9178977153941496292Apple-interchange-newline">
                          <div class="gmail_msg">
                            <div dir="auto" class="gmail_msg">
                              <div class="gmail_msg">Google ist Dein
                                Freund- hat nix mit VZ zu tun:</div>
                              <div class="gmail_msg"><br
                                  class="gmail_msg">
                              </div>
                              <div class="gmail_msg"><a
                                  moz-do-not-send="true"
href="http://stackoverflow.com/questions/510348/how-can-i-make-a-time-delay-in-python"
                                  class="gmail_msg" target="_blank">http://stackoverflow.com/questions/510348/how-can-i-make-a-time-delay-in-python</a><br
                                  class="gmail_msg">
                                <br class="gmail_msg">
                                Viele Grüße,
                                <div class="gmail_msg">Andreas</div>
                              </div>
                              <div class="gmail_msg"><br
                                  class="gmail_msg">
                                Am 07.10.2016 um 01:37 schrieb Torsten
                                <<a moz-do-not-send="true"
                                  href="mailto:t.wisgalla@gmx.de"
                                  class="gmail_msg" target="_blank">t.wisgalla@gmx.de</a>>:<br
                                  class="gmail_msg">
                                <br class="gmail_msg">
                              </div>
                              <blockquote type="cite" class="gmail_msg">
                                <div class="gmail_msg">
                                  <p class="gmail_msg">Hallo zusammen,</p>
                                  <p class="gmail_msg">habe nun nach
                                    längerem Studium dieses kleine
                                    Python-Script geschrieben, welcher
                                    bis zur print-Ausgabe des
                                    PUMP-STATUS(alle 30sec) auch
                                    funktioniert:<br class="gmail_msg">
                                  </p>
                                  <p class="gmail_msg"><b
                                      class="gmail_msg"><i
                                        class="gmail_msg">#!/usr/bin/python</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">mysqlHost =
                                        '127.0.0.1'</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">mysqlPort =
                                        '3306'</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">mysqlLogin =
                                        'root'</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">mysqlPass =
                                        'raspberry'</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">mysqlDatabase
                                        = "volkszaehler"</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">import
                                        RPi.GPIO as GPIO</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">import sys,
                                        time, os, re</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">import MySQLdb</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">GPIO.setmode(GPIO.BOARD)</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">GPIO.setup(29,
                                        <a moz-do-not-send="true"
                                          href="http://gpio.in/"
                                          class="gmail_msg"
                                          target="_blank">GPIO.IN</a>)</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">while True:</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">      input =
                                        GPIO.input(29)</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">     
                                        print("PUMP-STATUS:  " +
                                        str(input))</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">      db =
                                        MySQLdb.connect(host=mysqlHost,
                                        port=int(mysqlPort),
                                        user=mysqlLogin,
                                        passwd=mysqlPass)</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">      cursor =
                                        db.cursor()</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg">     
                                        cursor.execute("INSERT INTO
                                        data(channel_id(34)) (timestamp,
                                        value) VALUES (%s,%s);",
                                        (Timestamp, str(input))</i></b><b
                                      class="gmail_msg"><i
                                        class="gmail_msg"><br
                                          class="gmail_msg">
                                      </i></b><b class="gmail_msg"><i
                                        class="gmail_msg"> 
                                        time.sleep(30.0)</i></b></p>
                                  <p class="gmail_msg">Problem ist jetzt
                                    die Übertragung des Status in die
                                    Datenbank. Wenn ich das Script jetzt
                                    starte kommt folgendes:</p>
                                  <b class="gmail_msg"><i
                                      class="gmail_msg">pi@raspberrypi:~
                                      $ sudo /test01.py</i></b><b
                                    class="gmail_msg"><i
                                      class="gmail_msg"><br
                                        class="gmail_msg">
                                    </i></b><b class="gmail_msg"><i
                                      class="gmail_msg">  File
                                      "/test01.py", line 23</i></b><b
                                    class="gmail_msg"><i
                                      class="gmail_msg"><br
                                        class="gmail_msg">
                                    </i></b><b class="gmail_msg"><i
                                      class="gmail_msg">   
                                      time.sleep(30.0)</i></b><b
                                    class="gmail_msg"><i
                                      class="gmail_msg"><br
                                        class="gmail_msg">
                                    </i></b><b class="gmail_msg"><i
                                      class="gmail_msg">       ^</i></b><b
                                    class="gmail_msg"><i
                                      class="gmail_msg"><br
                                        class="gmail_msg">
                                    </i></b><b class="gmail_msg"><i
                                      class="gmail_msg">SyntaxError:
                                      invalid syntax</i></b> <br
                                    class="gmail_msg">
                                  <br class="gmail_msg">
                                  Können die Profis helfen? Wollte es
                                  eben gerne selbst versuchen - jetzt
                                  wird die Luft aber immer dünner.<br
                                    class="gmail_msg">
                                  <br class="gmail_msg">
                                  MfG und besten Dank - Torsten<br
                                    class="gmail_msg">
                                  <p class="gmail_msg"><br
                                      class="gmail_msg">
                                  </p>
                                  <br class="gmail_msg">
                                  <div class="gmail_msg
                                    m_9178977153941496292moz-cite-prefix">Am
                                    09.09.2016 um 23:16 schrieb Torsten
                                    Wisgalla:<br class="gmail_msg">
                                  </div>
                                  <blockquote type="cite"
                                    class="gmail_msg">
                                    <div class="gmail_msg
                                      m_9178977153941496292mail_android_message"
style="line-height:1;padding:0.5em">Hi Christian, die Pumpe(GPIO) war
                                      auch nach 18:47 noch an! Und die
                                      erneute Anzeige, dass sie wieder
                                      an ist(18:48) ist nur dadurch zu
                                      Stande gekommen, dass ich den GPIO
                                      einmal ganz kurz aus- und wieder
                                      angeschaltet habe. Zu beachten ist
                                      ebenfalls, das Intervall: 60,
                                      eingestellt ist - also der Graph
                                      zeitlich verzögert dargestellt
                                      wird.<br class="gmail_msg">
                                      Dazu bitte meine vorletzte Mail
                                      lesen!<br class="gmail_msg">
                                      MfG - Torsten <br
                                        class="gmail_msg">
                                      -- <br class="gmail_msg">
                                      Diese Nachricht wurde von meinem
                                      Android Mobiltelefon mit GMX Mail
                                      gesendet.</div>
                                    <div
                                      class="m_9178977153941496292mail_android_quote
                                      gmail_msg"
                                      style="line-height:1;padding:0.3em">Am
                                      09.09.16, 11:58, Christian
                                      Schnellrieder <<a
                                        moz-do-not-send="true"
                                        href="http://schnellrieder.cs/"
                                        class="gmail_msg"
                                        target="_blank">schnellrieder.cs</a>@<a
                                        moz-do-not-send="true"
                                        href="http://gmail.com/"
                                        class="gmail_msg"
                                        target="_blank">gmail.com</a>>
                                      schrieb:
                                      <blockquote class="gmail_quote
                                        gmail_msg" style="margin:0.8ex
                                        0pt 0pt 0.8ex;border-left:1px
                                        solid
                                        rgb(204,204,204);padding-left:1ex">
                                        <div class="gmail_msg"> Aber das
                                          sagt die Grafik aus...
                                          <div class="gmail_msg">
                                            Zwischen 18:46 und 18:47 war
                                            die Pumpe an. Ab 18:48 an...
                                            dauer noch unbekannt bis zum
                                            nächsten Wechsel. </div>
                                          <div class="gmail_msg"> <br
                                              class="gmail_msg">
                                          </div>
                                          <div class="gmail_msg"> <br
                                              class="gmail_msg">
                                          </div>
                                          <div class="gmail_msg"> Grüße
                                          </div>
                                        </div>
                                        <br class="gmail_msg">
                                        <div class="gmail_quote
                                          gmail_msg">
                                          <div class="gmail_msg">
                                            Torsten Wisgalla <<a
                                              moz-do-not-send="true"
                                              href="mailto:t.wisgalla@gmx.de"
                                              class="gmail_msg"
                                              target="_blank">t.wisgalla@gmx.de</a>>
                                            schrieb am Fr., 9. Sep. 2016
                                            um 11:46 Uhr:<br
                                              class="gmail_msg">
                                          </div>
                                          <blockquote class="gmail_quote
                                            gmail_msg" style="margin:0 0
                                            0 0.8ex;border-left:1.0px
                                            rgb(204,204,204)
                                            solid;padding-left:1.0ex">
                                            <div class="gmail_msg">
                                              <div class="gmail_msg">
                                                <div
                                                  style="line-height:1;padding:0.5em"
                                                  class="gmail_msg"> Das
                                                  nach Ende des
                                                  Rechtecks der GPIO
                                                  immer noch an war. Der
                                                  Graph würde nur auf 1
                                                  bleiben, wenn der GPIO
                                                  ständig gelpulst
                                                  würde.<br
                                                    class="gmail_msg">
                                                  Haben wir, denke ich
                                                  geklärt - vz kann
                                                  momentan über GPIO nur
                                                  Impulse - keine
                                                  Dauersignale.<br
                                                    class="gmail_msg">
                                                  Gruß Torsten<br
                                                    class="gmail_msg">
                                                  --<br
                                                    class="gmail_msg">
                                                  Diese Nachricht wurde
                                                  von meinem Android
                                                  Mobiltelefon mit GMX
                                                  Mail gesendet. </div>
                                                <div
                                                  style="line-height:1;padding:0.3em"
                                                  class="gmail_msg"> </div>
                                              </div>
                                            </div>
                                            <div class="gmail_msg">
                                              <div class="gmail_msg">
                                                <div
                                                  style="line-height:1;padding:0.3em"
                                                  class="gmail_msg"> Am
                                                  09.09.16, 09:22,
                                                  Christian
                                                  Schnellrieder <<a
                                                    moz-do-not-send="true"
href="http://schnellrieder.cs/" class="gmail_msg" target="_blank">schnellrieder.cs</a>@<a
moz-do-not-send="true" href="http://gmail.com/" class="gmail_msg"
                                                    target="_blank">gmail.com</a>>
                                                  schrieb: </div>
                                              </div>
                                            </div>
                                            <div class="gmail_msg">
                                              <div class="gmail_msg">
                                                <div
                                                  style="line-height:1;padding:0.3em"
                                                  class="gmail_msg">
                                                  <blockquote
                                                    class="gmail_quote
                                                    gmail_msg"
                                                    style="margin:0.8ex
                                                    0.0pt 0.0pt
                                                    0.8ex;border-left:1.0px
                                                    solid
                                                    rgb(204,204,204);padding-left:1.0ex">
                                                    <div
                                                      class="gmail_msg">
                                                      Hallo Torsten.
                                                      <div
                                                        class="gmail_msg">
                                                        <br
                                                          class="gmail_msg">
                                                      </div>
                                                      <div
                                                        class="gmail_msg">
                                                        Eine Frage zu
                                                        der Grafik: </div>
                                                      <div
                                                        class="gmail_msg">
                                                        Was genau stimmt
                                                        da aus deiner
                                                        Sicht nun nicht?
                                                      </div>
                                                      <div
                                                        class="gmail_msg">
                                                        <br
                                                          class="gmail_msg">
                                                      </div>
                                                      <div
                                                        class="gmail_msg">
                                                        <br
                                                          class="gmail_msg">
                                                      </div>
                                                      <div
                                                        class="gmail_msg">
                                                        Grüße<br
                                                          class="gmail_msg">
                                                        <div
                                                          class="gmail_msg">
                                                          <br
                                                          class="gmail_msg">
                                                        </div>
                                                        <div
                                                          class="gmail_msg">
                                                          <img
                                                          moz-do-not-send="true"
                                                          alt="pasted1"
src="http://attachment/Y2lkOjE1NzBkZDI0N2QzZDBjYWQyMjAy"
                                                          style="max-width:100.0%"
class="gmail_msg">
                                                          <div
                                                          class="gmail_msg">
                                                          <br
                                                          class="gmail_msg">
                                                          </div>
                                                          <div
                                                          class="gmail_quote
                                                          gmail_msg">
                                                          <blockquote
                                                          class="gmail_quote
                                                          gmail_msg"
                                                          style="margin:0
                                                          0 0
                                                          0.8ex;border-left:1.0px
rgb(204,204,204) solid;padding-left:1.0ex">
                                                          <div
                                                          class="gmail_msg">
                                                          <br
                                                          class="gmail_msg">
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <div
                                                      class="gmail_msg">
                                                      --<br
                                                        class="gmail_msg">
                                                    </div>
                                                    <div
                                                      class="gmail_msg">
                                                      <p
                                                        class="gmail_msg">
                                                        Von meinem
                                                        Smartphone
                                                        versendet </p>
                                                    </div>
                                                  </blockquote>
                                                </div>
                                              </div>
                                            </div>
                                          </blockquote>
                                        </div>
                                        <div class="gmail_msg"> --<br
                                            class="gmail_msg">
                                        </div>
                                        <div class="gmail_msg">
                                          <p class="gmail_msg"> Von
                                            meinem Smartphone versendet
                                          </p>
                                        </div>
                                      </blockquote>
                                    </div>
                                  </blockquote>
                                  <br class="gmail_msg">
                                </div>
                              </blockquote>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br class="gmail_msg">
                    </div>
                  </div>
                </div>
              </blockquote>
            </div>
            <div dir="ltr" class="">-- <br class="">
            </div>
            <div data-smartmail="gmail_signature" class="">
              <p dir="ltr" class="">Von meinem Smartphone versendet</p>
            </div>
          </div>
        </blockquote>
      </div>
      <br class="">
    </blockquote>
    <br>
  </body>
</html>