Community Forum
    • Blog
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Données absentes mysql

    Scheduled Pinned Locked Moved Téléinfo
    2 Posts 1 Posters 585 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PapyMoP Offline
      PapyMo
      last edited by

      Re: configuration MySQL
      Bonjour,

      Comme suite à l'acquisition d'une interface PitInfo, qui fonctionne très bien, sur un RasPi 4 j'ai installé :

      • Apache
      • PHP
      • MariaDB
      • phpMyAdmin
        … et teleinfo…
        Mon intention est de remplir la BDD avec les données de mon Linky.
        Bien… ce n'est pas top, je reçois bien les trames mais seulement le champ date est mis à jour dans la BDD… Je pense qu'il s'agit d'une erreur de paramétrage quelque part… je demande une piste à suivre… si vous en avez une…

      Je mets une copie de la sortie… par avance merci.

      pi@pi-lamp:~/teleinfo $ teleinfo
      teleinfo v1.0.8
      -- Serial Stuff -- 
      tty device     : /dev/ttyS0
      flowcontrol    : none
      baudrate is    : 1200
      parity is      : even
      databits are   : 7
      -- MySql Stuff -- 
      mySQL insert   : Enabled
      Server is      : localhost:3306
      Database is    : enedis
      Login is       : teleinfo
      Password is    : teleinfo
      Table is       : DbiTeleinfo
      -- Other Stuff -- 
      network is     : 192.168.0.255
      udp port is    : 1201
      mode is        : receive
      fetch value is : 
      nolock is      : no
      verbose is     : yes
      
      Opened Socket
      Curl Initialized
      Binded on port 1201
      Inits succeded, waiting network frame
      ------------------- Received 159 char Frame.ADCO 061861179678 S
      OPTARIF HC.. <
      ISOUSC 45 ?
      HCHC 009545895 3
      HCHP 000236194 ,
      PTEC HP..  
      IINST 003 Z
      IMAX 090 H
      PAPP 00840 -
      HHPHC A ,
      MOTDETAT 000000 B
      
      -------------------Frame OK
      INSERT INTO DbiTeleinfo
        (DATE)
      VALUES
        (NOW());
      
      teleinfo 1.0.8 Statistics
      ==========================
      Frames Sent         : 0
      Frames checked      : 1
      Frames OK           : 1
      Checksum errors     : 0
      Frame format Errors : 0
      Frame size Errors   : 0
      MySQL init OK       : 1
      MySQL init errors   : 0
      MySQL connect OK    : 1
      MySQL connect errors: 0
      MySQL queries OK    : 1
      MySQL queries errors: 0
      EmonCMS total post  : 0
      EmonCMS post OK     : 0
      EmonCMS post errors : 0
      EmonCMS timeout     : 0
      --------------------------
      Succeded to do my job
      pi@pi-lamp:~/teleinfo $ 
      
      
      1 Reply Last reply Reply Quote
      • PapyMoP Offline
        PapyMo
        last edited by

        ... et bien j'ai trouvé...
        Je trouvais dommage de mettre un raspi pour broadcaster le message de téléinfo même si c’était un raspi zéro.
        J'ai donc utilisé WifInfo avec un WEMOS et effectué les modifications suivantes :

        /* ======================================================================
        Function: NewFrame 
        Purpose : callback when we received a complete teleinfo frame
        Input   : linked list pointer on the concerned data
        Output  : - 
        Comments: it's called only if one data in the frame is different than
                  the previous frame
        ====================================================================== */
        void UpdatedFrame(ValueList * me)
        {
          char buff[32];
          
          // Light the RGB LED (purple)
          if ( config.config & CFG_RGB_LED) {
            LedRGBON(COLOR_MAGENTA);
        
            // led off after delay
            rgb_ticker.once_ms(BLINK_LED_MS, LedOff, RGB_LED_PIN);
          }
        
          sprintf_P( buff, PSTR("Updated Frame (%ld Bytes free)"), ESP.getFreeHeap() );
          Debugln(buff);
        
        /* */
          // Envoi d'une trame en broadcast
          // Got at least one ?
          if (me) {
            WiFiUDP myudp;
            IPAddress ip = WiFi.localIP();
        
            // start UDP server
            myudp.begin(1201);
            ip[3] = 255;
        
            // transmit broadcast package
            myudp.beginPacket(ip, 1201);
        
            // start of frame
            myudp.write(TINFO_STX);
        
            // Loop thru the node
            while (me->next) {
              me = me->next;
              // prepare line and write it
              // sprintf_P( buff, PSTR("%s %s %c\n"),me->name, me->value, me->checksum );
              sprintf_P( buff, PSTR("\n%s %s %c\r"),me->name, me->value, me->checksum );
              myudp.write( buff);
            }
        
            // End of frame
            myudp.write(TINFO_ETX);
            myudp.endPacket();
            myudp.flush();
        
          }
        

        j'ai juste modifié la "fabrication de la trame UDP.
        Maintenant ça fonctionne et ma BDD se rempli correctement.
        La trame udp est seulement transmise à l'occasion d'une évolution d'une valeur.

        ...
        INSERT INTO DbiTeleinfo
          (DATE,ADCO,OPTARIF,ISOUSC,HCHC,HCHP,PTEC,IINST1,IMAX1,PAPP,HHPHC,MOTDETAT)
        VALUES
          (NOW(),'xxxxxxxxxxxx','HC..','45','009607033','000293332','HP..','003','090','00780','A','000000');
        ...
        

        Merci à Charles pour le travail effectué.

        Nouveau sur le raspi, si quelqu'un peut me proposer des outils efficaces pour programmer et debugger dans un environnement confortable...

        Bonne journée.

        1 Reply Last reply Reply Quote
        • First post
          Last post

        3

        Online

        5.7k

        Users

        534

        Topics

        5.0k

        Posts

        Top Topics

        • Denky 4 - Domoticz - Triphasé -
          Nicolas BernaertsN
          Nicolas Bernaerts
          0
          7
          249

        • Denky D4 et Linky Standard TInfo Rx Non Configuré
          CharlesC
          Charles
          0
          5
          282

        • CC1101
          CharlesC
          Charles
          0
          2
          117

        Popular Tags

        teleinfo
        24 topics
        arduino
        19 topics
        remora
        16 topics
        esp8266
        10 topics
        arduipi
        10 topics
        wifinfo
        7 topics
        raspberry
        7 topics
        broadcast
        7 topics
        Copyright © 2022 Charles-Henri Hallard | Return to blog page | Powered by NodeBB