Skip to content
  • Blog
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Community Forum

  1. Home
  2. Categories
  3. Téléinfo
  4. Téléinfo
  5. Données absentes mysql

Données absentes mysql

Scheduled Pinned Locked Moved Téléinfo
2 Posts 1 Posters 983 Views 1 Watching
  • 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
    PapyMoP Offline
    PapyMo
    wrote on last edited by
    #1

    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
    • PapyMoP Offline
      PapyMoP Offline
      PapyMo
      wrote on last edited by
      #2

      ... 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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      1

      Online

      5.8k

      Users

      565

      Topics

      5.3k

      Posts

      Top Topics

      Popular Tags

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

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Blog
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups