MQTT corrompu dans Tasmota



  • @redge76 said in MQTT corrompu dans Tasmota:
    Bonjour,

    Aléatoirement, Tasmota envoie des json qui semblent corrompus.
    Voici 2 exemples
    Coté home assistant, j'ai ceci dans le log:

    2020-09-08 19:13:03 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_10AFED/SENSOR: b'{"Time":"2020-09-08T20:13:00","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":437.044,"Yesterday":0.390,"Today":436.654,"Period":4,"Power":540,"Current":2.000,"Load":6,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"BASE":427467,"PTEC":"TH..","IINST":2,"IMAX":90,"PAPP":540,"HHPHC":"A","MOTDETAT":0}}'
    2020-09-08 19:13:32 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_10AFED/SENSOR: b'{"Time":"2020-09-08T20:13:30","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":437.048,"Yesterday":0.390,"Today":436.658,"Period":4,"Power":530,"Current":2.000,"Load":6,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"BASE":427471,"PTEC":"TH..","IINST":2,"IMAX":90,"PAPP":530,"HHPHC":"A","MOTDETAT":0,"MOTD\x05TAT":0}}'
    

    On peut voir qu'a la fin, l'étiquette MOTDETAT est répétée mais avec le "E" corrompu. (C'est bizarre que ca soit la partie données qui ait un problème)

    Coté Tasmota j'ai:

    18:25:43 MQT: tele/tasmota_10AFED/STATE = {"Time":"2020-09-08T18:25:42","Uptime":"0T01:51:50","UptimeSec":6710,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":108,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"pouet","BSSId":"2C:56:DC:CB:55:4A","Channel":1,"RSSI":100,"Signal":-26,"LinkCount":1,"Downtime":"0T00:00:05"}}
    18:25:43 MQT: tele/tasmota_10AFED/SENSOR = {"Time":"2020-09-08T18:25:43","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":9.302,"Yesterday":0.390,"Today":8.912,"Period":17,"Power":1800,"Current":7.000,"Load":23,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"BASE":426549,"PTEC":"TH..","IINST":7,"IMAX":90,"PAPP":1800,"HHPHC":"A","MOTDETAT":0,"OF":"BASE","MOTDEAT":0,"ISOUBASE":426455}}
    18:25:45 TIC: [1]* BASE=000426551
    18:25:45 TIC: Base:426551
    18:25:45 TIC: [18]* IINST=014
    18:25:45 TIC: Current 014, now 14
    18:25:45 TIC: [16]* PAPP=03480
    18:25:45 TIC: Power 03480, now 3480
    18:25:46 TIC: [1]* BASE=000426552
    18:25:46 TIC: Base:426552
    18:25:48 TIC: [1]* BASE=000426553
    18:25:48 TIC: Base:426553
    18:25:49 TIC: [1]* BASE=000426555
    18:25:49 TIC: Base:426555
    18:25:49 TIC: [18]* IINST=012
    18:25:49 TIC: Current 012, now 12
    18:25:49 TIC: [16]* PAPP=03490
    18:25:49 TIC: Power 03490, now 3490
    18:25:51 TIC: [18]* IINST=007
    18:25:51 TIC: Current 007, now 7
    18:25:51 TIC: [16]* PAPP=01800
    18:25:51 TIC: Power 01800, now 1800
    18:25:52 TIC: [1]* BASE=000426556
    18:25:52 TIC: Base:426556
    18:25:53 TIC: [1]* BASE=000426557
    18:25:53 TIC: Base:426557
    18:25:55 TIC: [1]* BASE=000426558
    18:25:55 TIC: Base:426558
    18:25:57 TIC: [16]* PAPP=01790
    18:25:57 TIC: Power 01790, now 1790
    18:25:59 TIC: [1]* BASE=000426560
    18:25:59 TIC: Base:426560
    18:26:02 TIC: [1]* BASE=000426561
    18:26:02 TIC: Base:426561
    18:26:03 MQT: tele/tasmota_10AFED/HASS_STATE = {"Version":"8.5.0.1(sensors)","BuildDateTime":"2020-09-07T21:03:46","Module or Template":"NodeMCU-teleinfo","RestartReason":"Software Watchdog","Uptime":"0T01:52:11","Hostname":"teleinfo","IPAddress":"192.168.1.149","RSSI":"100","Signal (dBm)":"-26","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:05","MqttCount":1,"LoadAvg":106}
    18:26:03 TIC: [1]* BASE=000426562
    18:26:03 TIC: Base:426562
    18:26:05 TIC: [18]* IINST=014
    18:26:05 TIC: Current 014, now 14
    18:26:06 TIC: [1]* BASE=000426564
    18:26:06 TIC: Base:426564
    18:26:07 TIC: [16]* PAPP=03470
    18:26:07 TIC: Power 03470, now 3470
    18:26:08 TIC: [1]* BASE=000426565
    18:26:08 TIC: Base:426565
    18:26:09 TIC: [1]* BASE=000426567
    18:26:09 TIC: Base:426567
    18:26:10 TIC: [1]* BASE=000426568
    18:26:10 TIC: Base:426568
    18:26:11 TIC: [18]* IINST=007
    18:26:11 TIC: Current 007, now 7
    18:26:11 TIC: [16]* PAPP=01810
    18:26:11 TIC: Power 01810, now 1810
    18:26:12 TIC: [1]* BASE=000426569
    18:26:12 TIC: Base:426569
    18:26:12 MQT: tele/tasmota_10AFED/STATE = {"Time":"2020-09-08T18:26:12","Uptime":"0T01:52:20","UptimeSec":6740,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":100,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"pouet","BSSId":"2C:56:DC:CB:55:4A","Channel":1,"RSSI":100,"Signal":-26,"LinkCount":1,"Downtime":"0T00:00:05"}}
    18:26:12 MQT: tele/tasmota_10AFED/SENSOR = {"Time":"2020-09-08T18:26:12","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":9.322,"Yesterday":0.390,"Today":8.932,"Period":20,"Power":1810,"Current":7.000,"Load":23,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"BASE":426569,"PTEC":"TH..","IINST":7,"IMAX":90,"PAPP":1810,"HHPHC":"A","MOTDETAT":0,"OF":"BASE","MOTDEAT":0,"ISOUBASE":426455}}
    18:26:15 TIC: [1]* BASE=000426570
    

    (a noter que c'est pas toujours MOTDETAT qui trinque....)

    18:36:53 MQT: tele/tasmota_10AFED/STATE = {"Time":"2020-09-08T18:36:53","Uptime":"0T02:03:01","UptimeSec":7381,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":104,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"pouet","BSSId":"2C:56:DC:CB:55:4A","Channel":1,"RSSI":100,"Signal":-26,"LinkCount":1,"Downtime":"0T00:00:05"}}
    18:36:53 MQT: tele/tasmota_10AFED/SENSOR = {"Time":"2020-09-08T18:36:53","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":9.575,"Yesterday":0.390,"Today":9.185,"Period":4,"Power":550,"Current":2.000,"Load":6,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"BASE":426822,"PTEC":"TH..","IINST":2,"IMAX":90,"PAPP":550,"HHPHC":"A","MOTDETAT":0,"OF":"BASE","MOTDEAT":0,"ISOUBASE":426815,"PTARIF":"BASE"}}
    

    Quelqu'un a déja vu cela ?



  • Par ex j'ai actuellement rien qui remonte dans home assistant:
    Même si la valeur de PAPP est "bonne", le fait que le json semble corrompu fait que je n'ai rien qui remonte jusqu'a l'entity. (en gros il y a rien qui bouge dans HASS)
    Si je redémarre mon ESP, ca fonctionne pendant un moment puis ca plante.
    J'ai deja essayé de changer de carte ESP et ca me change rien (je suis passé d'une Wemos Mini D1 à une carte NodeMCU)
    J'ai aussi utilisé plusieurs alims/cables différents.

    2020-09-09 14:16:51 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_10AFED/SENSOR: b'{"Time":"2020-09-09T15:16:47","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":7.776,"Yesterday":5.774,"Today":1.612,"Period":2,"Power":360,"Current":1.000,"Load":3,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"PAPP":360,"HHPHC":"A","MOTDETAT":0,"BASE":435536,"PTEC":"TH..","IINST":1,"IMAX":90,"ISOUPTEC":"TH..","MOTD\x05TAT":0,"ISOUBASE":435250,"OPTAR\tF":"BASE","OF":"BASE"}}'
    

    Et dans la console de Tasmota:

    15:16:17 MQT: tele/tasmota_10AFED/STATE = {"Time":"2020-09-09T15:16:17","Uptime":"0T01:23:55","UptimeSec":5035,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":134,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"pouet","BSSId":"2C:56:DC:CB:55:4A","Channel":1,"RSSI":100,"Signal":-14,"LinkCount":1,"Downtime":"0T00:00:02"}}
    15:16:17 MQT: tele/tasmota_10AFED/SENSOR = {"Time":"2020-09-09T15:16:17","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":7.774,"Yesterday":5.774,"Today":1.610,"Period":3,"Power":340,"Current":1.000,"Load":3,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"PAPP":340,"HHPHC":"A","MOTDETAT":0,"BASE":435534,"PTEC":"TH..","IINST":1,"IMAX":90,"ISOUPTEC":"TH..","MOTDTAT":0,"ISOUBASE":435250,"OPTAR	F":"BASE","OF":"BASE"}}
    15:16:17 TIC: [16]* PAPP=00330
    15:16:17 TIC: Power 00330, now 330
    15:16:22 TIC: [16]* PAPP=00350
    15:16:22 TIC: Power 00350, now 350
    15:16:23 TIC: [16]* PAPP=00340
    15:16:23 TIC: Power 00340, now 340
    15:16:25 TIC: [16]* PAPP=00320
    15:16:25 TIC: Power 00320, now 320
    15:16:27 TIC: [1]* BASE=000435535
    15:16:27 TIC: Base:435535
    15:16:28 TIC: [16]* PAPP=00330
    15:16:28 TIC: Power 00330, now 330
    15:16:29 TIC: [16]* PAPP=00350
    15:16:29 TIC: Power 00350, now 350
    15:16:31 TIC: [16]* PAPP=00360
    15:16:31 TIC: Power 00360, now 360
    15:16:32 TIC: [16]* PAPP=00370
    15:16:32 TIC: Power 00370, now 370
    15:16:35 TIC: [16]* PAPP=00340
    15:16:35 TIC: Power 00340, now 340
    15:16:39 TIC: [1]* BASE=000435536
    15:16:39 TIC: Base:435536
    15:16:39 TIC: [16]* PAPP=00320
    15:16:39 TIC: Power 00320, now 320
    15:16:41 MQT: tele/tasmota_10AFED/HASS_STATE = {"Version":"8.5.0.1(sensors)","BuildDateTime":"2020-09-07T21:03:46","Module or Template":"NodeMCU-teleinfo","RestartReason":"Hardware Watchdog","Uptime":"0T01:24:19","Hostname":"teleinfo","IPAddress":"192.168.1.25","RSSI":"100","Signal (dBm)":"-14","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:02","MqttCount":1,"LoadAvg":84}
    15:16:43 TIC: [16]* PAPP=00360
    15:16:43 TIC: Power 00360, now 360
    15:16:47 MQT: tele/tasmota_10AFED/STATE = {"Time":"2020-09-09T15:16:47","Uptime":"0T01:24:25","UptimeSec":5065,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":78,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"pouet","BSSId":"2C:56:DC:CB:55:4A","Channel":1,"RSSI":100,"Signal":-17,"LinkCount":1,"Downtime":"0T00:00:02"}}
    15:16:47 MQT: tele/tasmota_10AFED/SENSOR = {"Time":"2020-09-09T15:16:47","ENERGY":{"TotalStartTime":"2020-09-07T19:58:31","Total":7.776,"Yesterday":5.774,"Today":1.612,"Period":2,"Power":360,"Current":1.000,"Load":3,"ADCO":"022064197471","OPTARIF":"BASE","ISOUSC":30,"PAPP":360,"HHPHC":"A","MOTDETAT":0,"BASE":435536,"PTEC":"TH..","IINST":1,"IMAX":90,"ISOUPTEC":"TH..","MOTDTAT":0,"ISOUBASE":435250,"OPTAR	F":"BASE","OF":"BASE"}}
    


  • Et le "information" de Tasmota me dit:

    Program Version	8.5.0.1(sensors)
    Build Date & Time	2020-09-07T21:03:46
    Core/SDK Version	2_7_4_1/2.2.2-dev(38a443e)
    Uptime	0T00:05:05
    Flash write Count	113 at 0xFB000
    Boot Count	90
    Restart Reason	**Hardware Watchdog**
    Friendly Name 1	builtin led
    

    Ce hardware watchdot ne semble se déclencher que quand j'ai un firmware tasmota avec la teleinfo activée.



  • Bon alors avec un ESP32 ca marche parfaitement. (les autres composants restent les mêmes)
    Donc je ne sais pas. J'ai essayé avec 2 cartes ESP8266 différentes avec à chaque fois les mêmes symptômes.
    Je ne sais pas s'il faut accuser le soft ou le hardware....



  • @redge76 Salut, j'ai vu ça sur mon montage à moi.
    Globalement, il y a deux choses:

    • Tout d'abord, avant d'ajouter les données dans la télé info, il n'y a pas de vérification des étiquettes pour savoir si elles veulent dire quelque chose quand on active certaines options. Une erreur de lecture et hop, l'output est pourri jusqu'au prochain reboot. Voilà la modif que j'ai effectué pour corriger ça dans le code de Tasmota:
    iff --git a/tasmota/xnrg_15_teleinfo.ino b/tasmota/xnrg_15_teleinfo.ino
    index e87d899f..9a50b0f3 100755
    --- a/tasmota/xnrg_15_teleinfo.ino
    +++ b/tasmota/xnrg_15_teleinfo.ino
    @@ -359,6 +359,20 @@ void ResponseAppendTInfo(char sep)
             me = me->next;
    
             if (me->name && me->value && *me->name && *me->value) {
    +            int ilabel ;
    +            char labelName[16];
    +            // Find the label index
    +            for ( ilabel = 1 ; ilabel < LABEL_END ; ilabel++) {
    +                GetTextIndexed(labelName, sizeof(labelName), ilabel, kLabel);
    +                if (!strcmp(labelName, me->name)) {
    +                    break;
    +                }
    +            }
    +
    +            if (ilabel>=LABEL_END) {
    +                continue;
    +            }
    +
                 isNumber = true;
                 p = me->value;
    
    • Ensuite, j'avais plein de problème avec mes résistances et les soudures, j'ai changé pour mettre une résistance de 1k pour R1 à la place de celle de 4.7k dans le montage, et depuis j'ai beaucoup moins de problèmes.

    Rémy


Log in to reply