ESP8266 rapport erreur Plugin _P127_Teleinfo

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
T3rorX
Normal user
Posts: 1
Joined: 03 Jan 2019, 05:16

ESP8266 rapport erreur Plugin _P127_Teleinfo

#1 Post by T3rorX » 03 Jan 2019, 14:28

Bonjour,

Je réfléchis à mettre en place un ESP8266 dans mon local compteur ERDF, mais impossible de compiler avec Atom.

Voici les erreurs
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino: In function 'boolean Plugin_127(byte, EventStruct*, String&)':
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino:189:49: error: incompatible types in assignment of 'int' to 'unsigned int [32]'
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino:245:14: warning: unused variable 'log' [-Wunused-variable]
sprintf_P(log, PSTR("%s%s using port %u"), "HTTP : connecting to ", host, port);
^
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino:45:15: warning: unused variable 'connectionState' [-Wunused-variable]
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino: In function 'boolean P127_sendtoHTTP(String, int, String)':
H:/GitHub/ESPEasy/src/_P127_Teleinfo.ino:585:1: warning: control reaches end of non-void function [-Wreturn-type]
*** [.pioenvs\esp32test_1M8_partition\src\ESPEasy.ino.cpp.o] Error 1


_P127_teleinfo.ino Pris sur https://github.com/letscontrolit/ESPEas ... Playground

Code: Select all

//#######################################################################################################
//#################################### Plugin 127: Teleinfo #############################################
//#################################### This plugin transmits data of energy counter to HTTP server  #####
//#################################### Compatible with jeedom plugin Teleinfo                       #####
//#######################################################################################################

#define PLUGIN_127
#define PLUGIN_ID_127         127
#define PLUGIN_NAME_127       "Teleinfo"


#define P127_BUFFER_SIZE 128
boolean Plugin_127_init = false;
int P127_CYCLE = 0;
String P127_SendData = "";
String P127_URL = "";
int P127_PORT = 80;
String P127_HOST = "";

boolean Plugin_127(byte function, struct EventStruct *event, String& string)
{
  boolean success = false;
  static byte connectionState = 0;

  switch (function)
  {

    case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_127;
        Device[deviceCount].SendDataOption = false;
        Device[deviceCount].TimerOption = false;
        Device[deviceCount].Ports = 0;
        Device[deviceCount].PullUpOption = false;
        Device[deviceCount].InverseLogicOption = false;
        Device[deviceCount].FormulaOption = false;
        Device[deviceCount].Custom = true;
        Device[deviceCount].ValueCount = 0;
        break;
      }

    case PLUGIN_GET_DEVICENAME:
      {
        string = F(PLUGIN_NAME_127);
        break;
      }

    case PLUGIN_GET_DEVICEVALUENAMES:
      {

        break;
      }

    case PLUGIN_WEBFORM_LOAD:
      {




        char deviceTemplate[2][128];
        LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));

        string += F("<TR><TD>Host:<TD><input type='text' size='64' maxlength='128' name='Plugin_127_host' value='");
        string += deviceTemplate[0];
        string += F("'>");
        char tmpString[128];
        sprintf_P(tmpString, PSTR("<TR><TD>Port:<TD><input type='text' name='Plugin_127_port' value='%u'>"), Settings.TaskDevicePluginConfig[event->TaskIndex][0]);
        string += tmpString;
        string += F("<TR><TD>Start url:<TD><input type='text' size='64' maxlength='128' name='Plugin_127_url' value='");
        string += deviceTemplate[1];
        string += F("'>");
        success = true;
        break;
      }

    case PLUGIN_WEBFORM_SAVE:
      {

        String plugin1 = WebServer.arg("Plugin_127_port");
        Settings.TaskDevicePluginConfig[event->TaskIndex][0] = plugin1.toInt();

        char deviceTemplate[2][128];
        char argc[25];

        String arg = F("Plugin_127_host");
        arg.toCharArray(argc, 25);
        String tmpString = WebServer.arg(argc);
        strncpy(deviceTemplate[0], tmpString.c_str(), sizeof(deviceTemplate[0]));

        arg = F("Plugin_127_url");
        arg.toCharArray(argc, 25);
        tmpString = WebServer.arg(argc);
        strncpy(deviceTemplate[1], tmpString.c_str(), sizeof(deviceTemplate[1]));

        Settings.TaskDeviceID[event->TaskIndex] = 1; // temp fix, needs a dummy value

        SaveCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
        success = true;
        break;
      }


    case PLUGIN_INIT: // ok
      {
        char deviceTemplate[2][128];
        LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
        P127_HOST = String(deviceTemplate[0]);
        P127_PORT = int(Settings.TaskDevicePluginConfig[event->TaskIndex][0]);
        P127_URL = String(deviceTemplate[1]);
        Serial.begin(1200, SERIAL_7E1); //Liaison série avec les paramètres
        Plugin_127_init = true;
        success = true;
        break;
      }


    case PLUGIN_SERIAL_IN:
      {
        uint8_t serial_buf[P127_BUFFER_SIZE];
        int RXWait = 10;
        int timeOut = RXWait;
        size_t bytes_read = 0;
        char log[40];


        while (timeOut > 0)
        {
          while (Serial.available()) {
            if (bytes_read < P127_BUFFER_SIZE) {
              serial_buf[bytes_read] = Serial.read();
              bytes_read++;
            }
            else {
              Serial.read();  // when the buffer is full, just read remaining input, but do not store...

            }
            timeOut = RXWait; // if serial received, reset timeout counter
          }
          delay(1);
          timeOut--;
        }

        if (bytes_read == P127_BUFFER_SIZE)  // if we have a full buffer, drop the last position to stuff with string end marker
        {
          while (Serial.available()) { // read possible remaining data to avoid sending rubbish...
            Serial.read();
          }
          bytes_read--;
          // and log buffer full situation
          // strcpy_P(log, PSTR("Teleinfo: serial buffer full!"));
          // addLog(LOG_LEVEL_ERROR, log);
        }
        serial_buf[bytes_read] = 0; // before logging as a char array, zero terminate the last position to be safe.
        //	char log[P127_BUFFER_SIZE + 40];
        //	sprintf_P(log, PSTR("Ser2N: S>: %s"), (char*)serial_buf);
        //	addLog(LOG_LEVEL_DEBUG, log);

        // We can also use the rules engine for local control!


        String message = (char*)serial_buf;
        int NewLinePos = message.indexOf("\r\n");
        if (NewLinePos > 0) {
          message = message.substring(0, NewLinePos);
        }
        String eventString = "";

        // message.replace("\r", "");
        if (message.length() > 5) {
          int indexValue = message.indexOf(" ");
          String nameValue = message.substring(1, indexValue);
          String value = message.substring(indexValue + 1, message.length() - 3);
          String checksum = message.substring(message.length() - 2);

          //  UserVar[event->BaseVarIndex] = value.toInt();

          if (P127_CYCLE == 0) {
            if (P127_checksum(nameValue, value, checksum)) {

              eventString = F("Teleinfo#");
              eventString += nameValue;
              eventString += F("=");
              eventString += value;
              P127_SendData += nameValue + "=" + value + "&";

            }

          }

          if (nameValue == "ADCO") {
            if (P127_CYCLE < 8) {
              P127_CYCLE++;
            } else {
              if (  P127_checksum(nameValue, value, checksum) ) {
                eventString = F("Teleinfo#SendData");
                P127_CYCLE = 0;
                P127_sendtoHTTP(P127_HOST, P127_PORT, P127_URL + P127_SendData);
                P127_SendData = "";

              }
            }
          }

          if (eventString.length() > 0) {
            rulesProcessing(eventString);
          }

        }

        success = true;
        break;

      }

  }
  return success;
}

boolean P127_checksum(String valuename, String value, String checksum) {
  String data = "";
  int i;
  char sum = 0;
  char sumchar;
  sumchar = checksum.charAt(0);
  data = valuename + " " + value;
  for (i = 0; i < data.length(); i++) {
    sum = sum + data.charAt(i);
  }
  sum = (sum & 0x3F) + 0x20;

  if (sum == sumchar) {
    return true;
  } else {
    return false;
  }
}


boolean P127_sendtoHTTP(String hostname, int port, String url) {
  char log[80];
  boolean success = false;
  char host[128];

  hostname.toCharArray(host, 128);
  sprintf_P(log, PSTR("%s%s using port %u"), "HTTP : connecting to ", host, port);
  addLog(LOG_LEVEL_DEBUG, log);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  if (!client.connect(host, port))
  {
    connectionFailures++;
    strcpy_P(log, PSTR("HTTP : connection failed"));
    addLog(LOG_LEVEL_ERROR, log);
    return false;
  }
  statusLED(true);
  if (connectionFailures)
    connectionFailures--;

  url.toCharArray(log, 80);
  addLog(LOG_LEVEL_DEBUG_MORE, log);

  String hostName = host;

  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Connection: close\r\n\r\n");

  unsigned long timer = millis() + 200;
  while (!client.available() && millis() < timer)
    delay(1);

  // Read all the lines of the reply from server and print them to Serial
  while (client.available()) {
    String line = client.readStringUntil('\n');
    line.toCharArray(log, 80);
    addLog(LOG_LEVEL_DEBUG_MORE, log);
    if (line.substring(0, 15) == "HTTP/1.1 200 OK")
    {
      strcpy_P(log, PSTR("HTTP : Succes!"));
      addLog(LOG_LEVEL_DEBUG, log);
      success = true;
    }
    delay(1);
  }
  strcpy_P(log, PSTR("HTTP : closing connection"));
  addLog(LOG_LEVEL_DEBUG, log);

  client.flush();
  client.stop();
}
Merci de votre aide.

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#2 Post by gmella » 26 Mar 2020, 18:57

Bonjour,

Je teste depuis quelques semaines mon compteur Linky avec le plugin que tu cites sur lequel j'ai fait pas mal de modifications. C'est stable en remontant même les infos toutes les 20s à mon controlleur domoticz.

Je n'ai pas encore fait de pull request et j'hesite à faire un nouveau plugin. Mais je vais essayer de contribuer un peu plus dans ce super projet qu'est EspEasy.

En attendant voila le code si cela peut servir et relancer les échanges:
https://github.com/gmella/ESPEasyPlugin ... leinfo.ino

Attention comme mentionné c'est en mode STANDARD donc a completer pour supporter les deux modes...

Thanks a lot for ESPEasy ! I enjoy and use it more and more.
Merci aussi à Charles Hallard pour sa lib et autres infos.
Guillaume

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#3 Post by guy67400 » 02 Apr 2020, 22:10

Hi,

Thank you for your work on Plugin _P127_Teleinfo - I'm interested in this plugin for non-Linky meter (Landis+Gyr meter)
When I try to compile 20200328 (Platformio 4.3.2a1 on VS code), I got following error (not related to P127 plugin):
How did you compile the project ? Would you please be so kind to share the tools / the binary you did use ?

Thank you

******************************************************************************

Bonjour,

Merci pour ce travail. Je suis moi même intéressé par ce plugin utilisé avec un compteur non linky.
Lorsque j'essaye de compiler la version 20200328, j'ai l'erreur :



Submodule path 'tools/sdk/lwip2/builder': checked out '354887a25f83064dc0c795e11704190845812713'
Submodule 'lwip2-src' (https://git.savannah.nongnu.org/git/lwip.git) registered for path 'tools/sdk/lwip2/builder/lwip2-src'
Cloning into 'C:/Users/guy/.platformio/packages/_tmp_installing-apq8gd0u-package/tools/sdk/lwip2/builder/lwip2-src'...
remote: Counting objects: 51280, done.
remote: Compressing objects: 100% (12186/12186), done.
remote: Total 51280 (delta 38698), reused 50936 (delta 38448)
Receiving objects: 100% (51280/51280), 10.06 MiB | 478.00 KiB/s, done.
Resolving deltas: 100% (38698/38698), done.
error: Server does not allow request for unadvertised object 159e31b689577dbf69cf0683bbaffbd71fa5ee10
Fetched in submodule path 'tools/sdk/lwip2/builder/lwip2-src', but it did not contain 159e31b689577dbf69cf0683bbaffbd71fa5ee10. Direct fetching of that commit failed.
Submodule path 'tools/sdk/ssl/bearssl': checked out '89454af34e3e61ddfc9837f3da5a0bc8ed44c3aa'
Failed to recurse into submodule path 'tools/sdk/lwip2/builder'
Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', '--branch', '2.6.3', 'https://github.com/esp8266/Arduino.git', 'C:\\Users\\guy\\.platformio\\packages\\_tmp_installing-apq8gd0u-package']
The terminal process terminated with exit code: 1

Comment avez vous pu contourner ce problème ?
Vous serait il possible de partager le fichier source ? les version de logiciels que vous avez utilisé ?

Merci

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#4 Post by gmella » 03 Apr 2020, 09:34

Hello,

I work on a linux machine using the arduino IDE (arduino-1.8.9). I find it ok for most tries I performed following classical use : load esp8266 platform support and use library manager for most projects.
I never tried Platformio and this may be a good opportunity.

But coming back to my setup to build various espeasy flavors I must be complete giving the whole summary:
  • git clone espeasy repository
  • move, copy or link ESPEasy/src to ESPEasy/ESPEasy so the arduino IDE does not complain when you open the project with ESPEasy/ESPEasy/ESPEasy.ino
  • copy/synchronize ESPEasy/lib content to my main ARDUINO/libraries
Sometimes some libraries build failed on my machine because of the case sensitive filesystem. I just rename files or fix includes and that works arround (ok I miss to notiofy back to author to fix that for others..).

I will be very happy to join a team work with other ESPEasy users. For this time it could be on the support for the HISTORIQUE mode for your Landis+Gyr meter I guess.

All that said, let me know how I can help more.

TD-er
Core team member
Posts: 2369
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#5 Post by TD-er » 03 Apr 2020, 10:19

Help is always appreciated.
If you can contribute to help coding, you can always fork the Git repository and create a pull request.

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#6 Post by gmella » 03 Apr 2020, 10:43

Hello TD-er,

That's the plan. I already forked the repo and plan to make a pull request. I replied to guy67400 message and sure we will make a pull request as soon as it is compatible with both mode.

I didn't get in touch with the first author of the plugin I rework but leave some comment in my previous source link . Then I would appreciate comments on two questions:
- should we take a new plugin id in the playground for such rewrite ?
- should we go backward on the part that read the serial data ? instead of using an existing Library

Anyway I put my finger in the machine and will continue to push it now as much as I can. I then wait guy67400' reply

Best regards,

TD-er
Core team member
Posts: 2369
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#7 Post by TD-er » 03 Apr 2020, 11:36

Well the plugin ID's on the playground are not that official.
A general rule of thumb, when you render the settings incompatible, I would suggest a new value (max 255)
If plugins on the playground are good enough and/or useful for others, they will be included in the main repository.

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#8 Post by guy67400 » 03 Apr 2020, 22:26

Thank you for your reply gmella,

I spend this afternoon following your advices, fighting with arduino IDE compiler and finally I achieved to compile successfully the 20200327 package.

I will now include the P127 plugin, and will come back to you with my findings using the plugin on my hardware (Wemos D1 mini), to monitor my "old" electricity meter.
I will do this in the coming days

Thank you again for your help.

Best regards

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#9 Post by gmella » 04 Apr 2020, 18:32

Hello guy67400,

Nice to see that you get ready to build an espeasy package. I succeeded to test it on both TIC protocols, then performed a pull request on the main repo.
In the mean time, please find my last version on https://github.com/gmella/ESPEasyPluginPlayground , copy it next to ESPEasy.ino ( where I added #define USES_P127 )

Bonne chance !
--
Guillaume

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#10 Post by guy67400 » 04 Apr 2020, 22:29

Thank you for your latest version.

I succeded to compile previous version with some changes, and try your new filewith similar compilation problems :
My setup :
- I used the package 20200328,
- added P_127 in the ESPeasy/ESPeasy folder,
- #define USES_P127 in plugin_sets.h,
- added https://github.com/marco402/LibTeleinfo ... es/Wifinfo in Libraries
( with "mySyslog.h" and "Wifinfo.h" commented in LibTeleinfo.h)
- hardware is D1 mini, HWserial0 (no serial log)

Compilation errors :
- _P127_Teleinfo:92:26: error: no matching function for call to 'TInfo::init(bool)' tinfo.init(true);
- __P127_Teleinfo:97:27: error: no matching function for call to 'TInfo::init(bool)' tinfo.init(false);
(Compilation is OK if I change tinfo.init(true); to tinfo.init(); and remove the standard mode (just keep my need). I had similar error with previous version )

- _P127_Teleinfo:121:21: error: 'TAILLE_MAX_VALUE' was not declared in this scope char cvalue[TAILLE_MAX_VALUE];
(Compilation is OK if I add #define TAILLE_MAX_VALUE 98 as defined in LibTeleinfo.h . I had similar error with previous version )

I suspect I'm not using the same LibTeleinfo.h file as you do ?

Any way, with the changes I uploaded the bin in a Wemos D1 mini, and will test reception of the Teleinfo data tomorrow.

By the way, what is "I2C adress" and "Channel" in device tack setting ?

Thanks for your support
Regards

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#11 Post by gmella » 05 Apr 2020, 11:07

Hello,

Giving your mention about I2C adress and Channel, I never saw such things. I updated my ESPEasy package. I pulled the head mega branch this morning and I discovered the points. Many changes occured but I succeeded to read again a counter leaving those field with default values but selecting again HW Serial0. This make the proper GPIO selected in GPIO <-TX field. For that I do also have to disable javascript else I was not able to edit the device seting page properly.
I'm sure that these points will be fixed in the future.

On the other part, I also think that your ARDUINO/libraries/LibTeleInfo directory does not include the proper files which must be next files : without #include "mySyslog.h" and #include "Wifinfo.h"
I suspect that you copied these files in the ESPEasy subdirectories but they must be present into the main Arduino libraries. If it is the point, you should be quite near to get a working reader :)

Regards,
Guillaume

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#12 Post by guy67400 » 05 Apr 2020, 18:41

Hello,

Thank you for the P127 update and your directions.
I succeded to compile and download ESPeasy with P127.

Config :
- D1 mini
- HWserial0 swap (use GPIO13/D7 for serial teleinfo data input pin)
- "send to controler" disabled

Findings :
Connection to the meter, PAPP is updated sometimes once at power up, then no more reading.....it seems ESP8266 is at the edge of speed and memory capability (software crash ?).
When I browse though ESP webpages (my computer connected to ESP though IP adress of ESP), I regularly get the message "Low memory. Cannot display webpage :-("
, and many times there is timeout = no page display.

To go further in analysis of what ESP does,
Is it possible to query the "teleinfo" values using http command to ESPeasy
(for exemple, on Wifiinfo software, It is possible to send the command EspIP:Port/control?cmd=taskvalueset,x,x,%IINST1%)

Regards

Guy

seb82
Normal user
Posts: 34
Joined: 05 Sep 2018, 10:56

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#13 Post by seb82 » 05 Apr 2020, 22:49

@guy67400, the error you get while trying to compile with platformio is due to a change in a library that affects building of core 2.6.3. I believe TD-er even opened an issue about it some months. It was fix but there has not been a stable release since then. You can use the latest version with that change under [core_2_6_3] in plaftformio_core_defs.ini [core_2_6_3]

Code: Select all

platform_packages         =
	;framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
Just remember this is not stable.
The good thing with platformio is that is it a lot faster to compile, which is clearly an advantage when developping (Arduino IDE is supposed to do some kind of cache for the libraries as well but I was never able to make it work under Windows).

For my part, I am using the Wifinfo example with this version of the library : https://github.com/theGressier/LibTeleinfo (compiled with last esp core 2.6.3) with a D1 mini that just fits under the Linky cover.
It has been running perfectly stable for 10 days now - even when accessing the web interface which used to be painfull sometimes - with 34 KB free memory.
This version is for "mode historique", not "mode standard".
Looking at the code for examples for a new project, I must say that Charles Hallard who originally wrote the Teleinfo library did a great job even though this is a few years old now.

@gmella, thanks for your work. It is good to have a working teleinfo plugin for ESP Easy. It could be useful sometime.

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#14 Post by guy67400 » 06 Apr 2020, 19:56

Hello seb82
Thank you for your comments.
Indeed I also use wifiinfo for some month now, but one ennoying problem with Wifinfo is that, in case of power failure, my pi3 with domoticz takes some time to setup Wifi AP, and Wifinfo who start fast does not see Wifi AP, does not connect, and there is no rules mechanism (update me if I'm wrong) you can setup to have "auto reconnection" in that case.


Hello gmella
I made some more investigation, and it seems that there is no problem accessing the webpages of Esp_teleinfo, in case the teleinfo data are not received by the wemos D1 mini.
If it can help, I would suggest to use a gating mechanism :
- when Esp_teleinfo need the teleinfo frame, it set one gpio that enable the data input to the serial0 pin
- when the frame has been received, gpio is reset, and this block the data coming to serial0 input.
- this is done at the rate selected to send data to controler - like that ESP is only buzzy receiving serial data when it need them, not all the time.
This could be easely done with one gpio and one diode, connected to serial0 pin (hardware wemos D1 mini + teleinfo adapter using SFH620A)
1st and last byte received by ESPeasy could be corrupted (as the start/stop could happen in the middle of one byte) and the 1st received frame would be corrupted, but the STX/ETX would synchronize the reception on the next full frame

Regards

Guy

gmella
Normal user
Posts: 7
Joined: 26 Mar 2020, 18:37

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#15 Post by gmella » 06 Apr 2020, 20:52

Hello guy67400,

Not sure to understand why such gating mechanism. I just performed additional test on a D1 mini without any issue. The load is quite low 5% for 10s interval.
The only stop I got in my past tries was the use of software serial reading (I read similar bug that prevent such use).

I think that reading rate must be high enough so the esp can read an loop ever every labels. These are stored in memory and plugin just read the two selected values given the two selected names. With current implementation, I can read default labels (PAPP changes when I connect a load) or other ones ISOUSC...
Here is a sample log line I get In Tools/Log after changing the labem :

Code: Select all

1861523: P127 : Init HISTORIQUE mode 1200_7E1 RX=13 reading ISOUSC,BASE
In any cases, a checksum is performed before storing data so we can trust data without more analysis.

Since HISTORIQUE mode is at 1200bauds, I wonder if putting an higher timeout inside the PLUGIN_TEN_PER_SECOND could help for a better reading and hopefully reduce the load.

Thank you seb82 for your comments. I should give a try to platformio in the future.

From the beginning I think that using an internal serial data reading could help to get a self contained plugin. This could help to move into the standard plugin if it reach acceptance level. I also think that Hallard Lib repo missed a lot of pull request. Anyway, nice to see the community work moving!

I also use a PZEM004 plugin to monitor my PV production. I hope to get a single ESP8266 able to read multiples PZEM and my Linky.

Kind regards,
Guillaume

seb82
Normal user
Posts: 34
Joined: 05 Sep 2018, 10:56

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#16 Post by seb82 » 06 Apr 2020, 21:38

@guy67400, yes indeed I got the same issue at startup with Wifinfo. For the time being I added a delay before wifi startup:

Code: Select all

// start Wifi connect or soft AP
  delay(60000); // XXX délai avant connexion wifi pour laisser démarrer le routeur
  WifiHandleConn(true);
Not a very nice fix but it works well (and I can also cut the power supply of my D1 mini hosting Wifinfo).
I plan to look at the wifi part of the code deeper for another project so maybe I will be able to figure out why it does not reconnect. Unless I decide to use some of ESP Easy code :D

guy67400
Normal user
Posts: 8
Joined: 14 Sep 2016, 23:55
Location: Strasbourg

Re: ESP8266 rapport erreur Plugin _P127_Teleinfo

#17 Post by guy67400 » 07 Apr 2020, 05:29

Hello seb82
Thank you for this fix - I will implement it if I can not get ESPinfo to work as expected

Hello gmella
From your log record, I guess that your mains is mode "monophasé" => total byte on the teleinfo frame around 120 - 140 bytes

My mains is "triphasé" + "Hc/Hp" => total bytes on teleinfo frame 251 bytes ( I made some records of the frames to verify this number)

Could this difference explain the problem I have ?
Should I change some items in the source ? 'TAILLE_MAX_VALUE' ?
( I have very basic software knowledge, not able to fully understand the code in P_127 and the code in teleinfo library)

Thank you for your help

Guy

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests