Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perdida de tramas entre mosquitto y el agente IoT #649

Open
hecuru opened this issue Mar 31, 2022 · 6 comments
Open

Perdida de tramas entre mosquitto y el agente IoT #649

hecuru opened this issue Mar 31, 2022 · 6 comments

Comments

@hecuru
Copy link

hecuru commented Mar 31, 2022

Buenos días.
Tenemos una instalación con la estructura :
Mosquitto - IoTAgent JSON - Orion - Draco - MySQL
En principio toda la estructura funciona correctamente y no nos aparecen errores en ningún punto de la secuencia. Sin embargo, no todos los datos que llegan a mosquitto llegan a almacenarse en la base de datos final. De hecho, parece que las tramas que no llegan a registrase en la base de datos ni siquiera llegan al agente IoT.
Para aportar un poco más de información por si nos pueden ayudar, podemos añadir:

1.- La secuancia de tramas que llegan a mosquitto ( v 2.0.12 ) tiene dos tipos: 'Gr II/Trame' y 'Gr II/IoT'. La frecuencia de entrada de tramas es de al menos 1 por segundo. Un ejemplo de una secuencia de tramas sería la siguiente:
Gr II/Trame {"Time":"2022-03-31T06:44:20","Type":"ED","Category":"RP","Value":"RPA01001161"} Gr II/IoT {"Time":"2022-03-31T06:44:21","Type":"ED","Value":"0.6879947","Unit":"MWH","Category":"E","Tag":"ElecUsine"} Gr II/IoT {"Time":"2022-03-31T06:44:22","Type":"ED","Value":"77.28602","Unit":"MWH","Category":"E","Tag":"ElecExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:44:24","Type":"ED","Value":"41.07764","Unit":"MWH","Category":"E","Tag":"ElecTambour"} Gr II/IoT {"Time":"2022-03-31T06:44:25","Type":"ED","Value":"12.720429","Unit":"MWH","Category":"E","Tag":"ElecElevateurAChaud"} Gr II/Trame {"Time":"2022-03-31T06:44:25","Type":"ED","Category":"RP","Value":"RPA01001162"} Gr II/IoT {"Time":"2022-03-31T06:44:26","Type":"ED","Value":"25.84754","Unit":"MWH","Category":"E","Tag":"ElecMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:44:27","Type":"ED","Value":"24.22457","Unit":"MWH","Category":"E","Tag":"ElecCompresseur"} Gr II/IoT {"Time":"2022-03-31T06:44:29","Type":"ED","Value":"17.08625","Unit":"MWH","Category":"E","Tag":"ElecVentilateurFlamme"} Gr II/IoT {"Time":"2022-03-31T06:44:30","Type":"ED","Value":"1153.5","Unit":"Kg","Category":"F","Tag":"FioulSecheur"} Gr II/Trame {"Time":"2022-03-31T06:44:30","Type":"ED","Category":"RP","Value":"RPA01001163"} Gr II/IoT {"Time":"2022-03-31T06:44:31","Type":"ED","Value":"36.0326","Unit":"L","Category":"F","Tag":"FioulChaudiere"} Gr II/IoT {"Time":"2022-03-31T06:44:32","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:44:33","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:44:35","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarTambour"} Gr II/Trame {"Time":"2022-03-31T06:44:35","Type":"ED","Category":"RP","Value":"RPA01001164"} Gr II/IoT {"Time":"2022-03-31T06:44:36","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarElevateurChaud"} Gr II/IoT {"Time":"2022-03-31T06:44:37","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarDepotage"} Gr II/IoT {"Time":"2022-03-31T06:44:38","Type":"ED","Value":"14.42","Unit":"DEGC","Category":"M","Tag":"MetTExt"} Gr II/IoT {"Time":"2022-03-31T06:44:39","Type":"ED","Value":"5.87747E-39","Unit":"MM","Category":"M","Tag":"MetPluviometrie"} Gr II/Trame {"Time":"2022-03-31T06:44:40","Type":"ED","Category":"RP","Value":"RPA01001165"} Gr II/IoT {"Time":"2022-03-31T06:44:41","Type":"ED","Value":"77.0","Unit":"POUR","Category":"M","Tag":"MetHygrometrie"} Gr II/IoT {"Time":"2022-03-31T06:44:42","Type":"ED","Value":"5.87747E-39","Unit":"DEG","Category":"M","Tag":"MetDirectionVent"} Gr II/IoT {"Time":"2022-03-31T06:44:43","Type":"ED","Value":"5.87747E-39","Unit":"MS","Category":"M","Tag":"MetVitesseVent"} Gr II/IoT {"Time":"2022-03-31T06:44:44","Type":"ED","Value":"161.4","Unit":"DEGC","Category":"T","Tag":"TmpDepotage"} Gr II/Trame {"Time":"2022-03-31T06:44:45","Type":"ED","Category":"RP","Value":"RPA01001166"} Gr II/IoT {"Time":"2022-03-31T06:44:45","Type":"ED","Value":"136.1","Unit":"DEGC","Category":"T","Tag":"TmpCuveBitume1"} Gr II/IoT {"Time":"2022-03-31T06:44:47","Type":"ED","Value":"89.4","Unit":"DEGC","Category":"T","Tag":"TmpCuveBitume2"} Gr II/IoT {"Time":"2022-03-31T06:44:48","Type":"ED","Value":"60.8","Unit":"DEGC","Category":"T","Tag":"TmpCuveFioul"} Gr II/IoT {"Time":"2022-03-31T06:44:49","Type":"ED","Value":"0.6","Unit":"%","Category":"H","Tag":"HDoseur1"} Gr II/Trame {"Time":"2022-03-31T06:44:50","Type":"ED","Category":"RP","Value":"RPA01001167"} Gr II/IoT {"Time":"2022-03-31T06:44:50","Type":"ED","Value":"11.0","Unit":"%","Category":"H","Tag":"HDoseur2"} Gr II/IoT {"Time":"2022-03-31T06:44:51","Type":"ED","Value":"11.6","Unit":"%","Category":"H","Tag":"HRecycle1"} Gr II/IoT {"Time":"2022-03-31T06:44:53","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TDoseur1"} Gr II/IoT {"Time":"2022-03-31T06:44:54","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TDoseur2"} Gr II/Trame {"Time":"2022-03-31T06:44:55","Type":"ED","Category":"RP","Value":"RPA01001168"} Gr II/IoT {"Time":"2022-03-31T06:44:55","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TRecycle1"} Gr II/IoT {"Time":"2022-03-31T06:44:56","Type":"ED","Value":"127.6092","Unit":"A","Category":"A","Tag":"AmpExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:44:58","Type":"ED","Value":"71.3174","Unit":"A","Category":"A","Tag":"AmpTambour"} Gr II/IoT {"Time":"2022-03-31T06:44:59","Type":"ED","Value":"48.0431","Unit":"A","Category":"A","Tag":"AmpCompresseur"} Gr II/Trame {"Time":"2022-03-31T06:45:00","Type":"ED","Category":"RP","Value":"RPA01001169"} Gr II/IoT {"Time":"2022-03-31T06:45:00","Type":"ED","Value":"25.5625","Unit":"A","Category":"A","Tag":"AmpElevateur"} Gr II/IoT {"Time":"2022-03-31T06:45:01","Type":"ED","Value":"13.2712","Unit":"A","Category":"A","Tag":"AmpMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:45:02","Type":"ED","Value":"37.541","Unit":"DEGDEC","Category":"G","Tag":"Latitude"} Gr II/IoT {"Time":"2022-03-31T06:45:04","Type":"ED","Value":"-6.136402","Unit":"DEGDEC","Category":"G","Tag":"Longitude"} Gr II/IoT {"Time":"2022-03-31T06:45:05","Type":"ED","Value":"47.7","Unit":"m3","Category":"N","Tag":"NCuve1"} Gr II/Trame {"Time":"2022-03-31T06:45:05","Type":"ED","Category":"RP","Value":"RPA01001170"} Gr II/IoT {"Time":"2022-03-31T06:45:06","Type":"ED","Value":"19.2","Unit":"m3","Category":"N","Tag":"NCuve2"} Gr II/IoT {"Time":"2022-03-31T06:45:07","Type":"ED","Value":"0.0","Unit":"m3","Category":"N","Tag":"NCuveFioul"} Gr II/IoT {"Time":"2022-03-31T06:45:08","Type":"ED","Value":"5.87747E-39","Unit":"%","Category":"EV","Tag":"O2"} Gr II/IoT {"Time":"2022-03-31T06:45:10","Type":"ED","Value":"5.87747E-39","Unit":"%","Category":"EV","Tag":"CO"} Gr II/Trame {"Time":"2022-03-31T06:45:10","Type":"ED","Category":"RP","Value":"RPA01001171"} Gr II/IoT {"Time":"2022-03-31T06:45:11","Type":"ED","Value":"5.87747E-39","Unit":"%","Category":"EV","Tag":"CO2"} Gr II/IoT {"Time":"2022-03-31T06:45:12","Type":"ED","Value":"5.87747E-39","Unit":"PPM","Category":"EV","Tag":"PPMC0"} Gr II/IoT {"Time":"2022-03-31T06:45:13","Type":"ED","Value":"5.87747E-39","Unit":"MgM3","Category":"EV","Tag":"PPMPrefitre"} Gr II/IoT {"Time":"2022-03-31T06:45:14","Type":"ED","Value":"5.87747E-39","Unit":"MgM3","Category":"EV","Tag":"PPMCheminee"} Gr II/Trame {"Time":"2022-03-31T06:45:15","Type":"ED","Category":"RP","Value":"RPA01001172"} Gr II/Trame {"Time":"2022-03-31T06:45:20","Type":"ED","Category":"RP","Value":"RPA01001173"} Gr II/Trame {"Time":"2022-03-31T06:45:25","Type":"ED","Category":"RP","Value":"RPA01001174"} Gr II/IoT {"Time":"2022-03-31T06:45:25","Type":"ED","Value":"0.6919946","Unit":"MWH","Category":"E","Tag":"ElecUsine"} Gr II/IoT {"Time":"2022-03-31T06:45:26","Type":"ED","Value":"77.2889","Unit":"MWH","Category":"E","Tag":"ElecExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:45:28","Type":"ED","Value":"41.07934","Unit":"MWH","Category":"E","Tag":"ElecTambour"} Gr II/IoT {"Time":"2022-03-31T06:45:29","Type":"ED","Value":"12.721017","Unit":"MWH","Category":"E","Tag":"ElecElevateurAChaud"} Gr II/Trame {"Time":"2022-03-31T06:45:30","Type":"ED","Category":"RP","Value":"RPA01001175"} Gr II/IoT {"Time":"2022-03-31T06:45:30","Type":"ED","Value":"25.84785","Unit":"MWH","Category":"E","Tag":"ElecMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:45:31","Type":"ED","Value":"24.22544","Unit":"MWH","Category":"E","Tag":"ElecCompresseur"} Gr II/IoT {"Time":"2022-03-31T06:45:32","Type":"ED","Value":"17.08625","Unit":"MWH","Category":"E","Tag":"ElecVentilateurFlamme"} Gr II/IoT {"Time":"2022-03-31T06:45:34","Type":"ED","Value":"1153.5","Unit":"Kg","Category":"F","Tag":"FioulSecheur"} Gr II/IoT {"Time":"2022-03-31T06:45:35","Type":"ED","Value":"36.34362","Unit":"L","Category":"F","Tag":"FioulChaudiere"} Gr II/Trame {"Time":"2022-03-31T06:45:35","Type":"ED","Category":"RP","Value":"RPA01001176"} Gr II/IoT {"Time":"2022-03-31T06:45:36","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:45:37","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:45:39","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarTambour"} Gr II/Trame {"Time":"2022-03-31T06:45:40","Type":"ED","Category":"RP","Value":"RPA01001177"} Gr II/IoT {"Time":"2022-03-31T06:45:40","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarElevateurChaud"} Gr II/IoT {"Time":"2022-03-31T06:45:41","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarDepotage"} Gr II/IoT {"Time":"2022-03-31T06:45:42","Type":"ED","Value":"14.339999","Unit":"DEGC","Category":"M","Tag":"MetTExt"} Gr II/IoT {"Time":"2022-03-31T06:45:44","Type":"ED","Value":"5.87747E-39","Unit":"MM","Category":"M","Tag":"MetPluviometrie"} Gr II/IoT {"Time":"2022-03-31T06:45:45","Type":"ED","Value":"77.0","Unit":"POUR","Category":"M","Tag":"MetHygrometrie"} Gr II/Trame {"Time":"2022-03-31T06:45:45","Type":"ED","Category":"RP","Value":"RPA01001178"} Gr II/IoT {"Time":"2022-03-31T06:45:46","Type":"ED","Value":"5.87747E-39","Unit":"DEG","Category":"M","Tag":"MetDirectionVent"} Gr II/IoT {"Time":"2022-03-31T06:45:47","Type":"ED","Value":"5.87747E-39","Unit":"MS","Category":"M","Tag":"MetVitesseVent"} Gr II/IoT {"Time":"2022-03-31T06:45:49","Type":"ED","Value":"161.1","Unit":"DEGC","Category":"T","Tag":"TmpDepotage"} Gr II/IoT {"Time":"2022-03-31T06:45:50","Type":"ED","Value":"136.1","Unit":"DEGC","Category":"T","Tag":"TmpCuveBitume1"} Gr II/Trame {"Time":"2022-03-31T06:45:50","Type":"ED","Category":"RP","Value":"RPA01001179"} Gr II/IoT {"Time":"2022-03-31T06:45:51","Type":"ED","Value":"89.0","Unit":"DEGC","Category":"T","Tag":"TmpCuveBitume2"} Gr II/IoT {"Time":"2022-03-31T06:45:52","Type":"ED","Value":"60.7","Unit":"DEGC","Category":"T","Tag":"TmpCuveFioul"} Gr II/IoT {"Time":"2022-03-31T06:45:53","Type":"ED","Value":"0.6","Unit":"%","Category":"H","Tag":"HDoseur1"} Gr II/IoT {"Time":"2022-03-31T06:45:55","Type":"ED","Value":"11.1","Unit":"%","Category":"H","Tag":"HDoseur2"} Gr II/Trame {"Time":"2022-03-31T06:45:55","Type":"ED","Category":"RP","Value":"RPA01001180"} Gr II/IoT {"Time":"2022-03-31T06:45:56","Type":"ED","Value":"11.4","Unit":"%","Category":"H","Tag":"HRecycle1"} Gr II/IoT {"Time":"2022-03-31T06:45:57","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TDoseur1"} Gr II/IoT {"Time":"2022-03-31T06:45:58","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TDoseur2"} Gr II/IoT {"Time":"2022-03-31T06:45:59","Type":"ED","Value":"1.4","Unit":"DEGC","Category":"H","Tag":"TRecycle1"} Gr II/Trame {"Time":"2022-03-31T06:46:00","Type":"ED","Category":"RP","Value":"RPA01001181"} Gr II/IoT {"Time":"2022-03-31T06:46:01","Type":"ED","Value":"127.17229","Unit":"A","Category":"A","Tag":"AmpExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:46:03","Type":"ED","Value":"5.87747E-39","Unit":"PPM","Category":"EV","Tag":"PPMC0"} Gr II/IoT {"Time":"2022-03-31T06:46:04","Type":"ED","Value":"5.87747E-39","Unit":"MgM3","Category":"EV","Tag":"PPMPrefitre"} Gr II/Trame {"Time":"2022-03-31T06:46:05","Type":"ED","Category":"RP","Value":"RPA01001182"} Gr II/IoT {"Time":"2022-03-31T06:46:05","Type":"ED","Value":"5.87747E-39","Unit":"MgM3","Category":"EV","Tag":"PPMCheminee"} Gr II/Trame {"Time":"2022-03-31T06:46:10","Type":"ED","Category":"RP","Value":"RPA01001183"} Gr II/Trame {"Time":"2022-03-31T06:46:15","Type":"ED","Category":"RP","Value":"RPA01001184"} Gr II/IoT {"Time":"2022-03-31T06:46:16","Type":"ED","Value":"0.9119918","Unit":"MWH","Category":"E","Tag":"ElecUsine"} Gr II/IoT {"Time":"2022-03-31T06:46:17","Type":"ED","Value":"77.44599","Unit":"MWH","Category":"E","Tag":"ElecExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:46:18","Type":"ED","Value":"41.16736","Unit":"MWH","Category":"E","Tag":"ElecTambour"} Gr II/IoT {"Time":"2022-03-31T06:46:20","Type":"ED","Value":"12.75075","Unit":"MWH","Category":"E","Tag":"ElecElevateurAChaud"} Gr II/Trame {"Time":"2022-03-31T06:46:20","Type":"ED","Category":"RP","Value":"RPA01001185"} Gr II/IoT {"Time":"2022-03-31T06:46:21","Type":"ED","Value":"25.88076","Unit":"MWH","Category":"E","Tag":"ElecMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:46:22","Type":"ED","Value":"24.27238","Unit":"MWH","Category":"E","Tag":"ElecCompresseur"} Gr II/IoT {"Time":"2022-03-31T06:46:23","Type":"ED","Value":"17.10749","Unit":"MWH","Category":"E","Tag":"ElecVentilateurFlamme"} Gr II/IoT {"Time":"2022-03-31T06:46:24","Type":"ED","Value":"1369.0","Unit":"Kg","Category":"F","Tag":"FSecheur"} Gr II/Trame {"Time":"2022-03-31T06:46:25","Type":"ED","Category":"RP","Value":"RPA01001186"} Gr II/IoT {"Time":"2022-03-31T06:46:26","Type":"ED","Value":"54.95844","Unit":"L","Category":"F","Tag":"FChaudiere"} Gr II/IoT {"Time":"2022-03-31T06:46:27","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarExhausteur"} Gr II/IoT {"Time":"2022-03-31T06:46:28","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarMalaxeur"} Gr II/IoT {"Time":"2022-03-31T06:46:30","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarTambour"} Gr II/Trame {"Time":"2022-03-31T06:46:30","Type":"ED","Category":"RP","Value":"RPA01001187"} Gr II/IoT {"Time":"2022-03-31T06:46:31","Type":"ED","Value":"TRUE","Unit":"TOR","Category":"MC","Tag":"MarElevateurChaud"} Gr II/IoT {"Time":"2022-03-31T06:46:32","Type":"ED","Value":"FALSE","Unit":"TOR","Category":"MC","Tag":"MarDepotage"} Gr II/IoT {"Time":"2022-03-31T06:46:33","Type":"ED","Value":"13.42","Unit":"DEGC","Category":"M","Tag":"MetTExt"} Gr II/IoT {"Time":"2022-03-31T06:46:34","Type":"ED","Value":"0.1","Unit":"MM","Category":"M","Tag":"MetPluviometrie"} Gr II/Trame {"Time":"2022-03-31T06:46:35","Type":"ED","Category":"RP","Value":"RPA01001188"} Gr II/IoT {"Time":"2022-03-31T06:46:36","Type":"ED","Value":"82.0","Unit":"POUR","Category":"M","Tag":"MetHygrometrie"} Gr II/IoT {"Time":"2022-03-31T06:46:37","Type":"ED","Value":"5.87747E-39","Unit":"DEG","Category":"M","Tag":"MetDirectionVent"} Gr II/IoT {"Time":"2022-03-31T06:46:38","Type":"ED","Value":"5.87747E-39","Unit":"MS","Category":"M","Tag":"MetVitesseVent"}

2.- El log del IoT-Agent-JSON ( v 1.19.0 ) en modo debug sería este:
log_IoT-Agent-JSON.log
Como puede verse en el log, parece que el IotAgent sólo recibe 4 tramas por minuto, aproximadamente. En ningún momento, aparecen mensajes de error en su log. Sin embargo, la subscrición al mosquitto con otrs herramientas si reciben todas las tramas que llegan a mosquitto.
Como observación, en el código del agente hemos tenido que realizar alguna pequeña modificación para que fuese capaz de interpretar nuestras tramas debido a sus particularidades, ya que las tramas no pueden ser modificadas.

3.- A nivel de configuración de los sitemas, tenmos definidas las siguientes estrucutras:
3.1.- Orion: Subscripción a dos entidades del mismo tipo:
- Entidades:
[ { **"id": "Thing:Trame", "type": "Thing",** "Category": { "type": "String", "value": "RP", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.528Z" } } }, "Time": { "type": "String", "value": "2022-03-31T10:02:25", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.528Z" } } }, "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.528Z", "metadata": {} }, "Type": { "type": "String", "value": "ED", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.528Z" } } }, "Value": { "type": "String", "value": "RPA0100354", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.528Z" } } } }, { **"id": "Thing:IoT", "type": "Thing",** "Category": { "type": "String", "value": "N", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } }, "Tag": { "type": "String", "value": "NiveauCuveFioul", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } }, "Time": { "type": "String", "value": "2022-03-31T10:02:24", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } }, "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z", "metadata": {} }, "Type": { "type": "String", "value": "ED", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } }, "Unit": { "type": "String", "value": "m3", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } }, "Value": { "type": "String", "value": "0.0", "metadata": { "TimeInstant": { "type": "DateTime", "value": "2022-03-31T10:02:25.046Z" } } } } ]
- Tipos:
[ { **"type": "Thing",** "attrs": { "Category": {"types": ["String"]}, "Tag": {"types": ["String"]}, "Time": {"types": ["String"]}, "TimeInstant": {"types": ["DateTime"]}, "Type": {"types": ["String"]}, "Unit": {"types": ["String"]}, "Value": {"types": ["String"]} }, "count": 2 } ]

3.2.- IoTAgent: Subscripción a un servicio con tres dispositivos (un dispositivo es erróneo, pero como no tiene nombre registrado no hemos encontrado como eliminarlo):
- Servicios:
{
"count": 1,
"services": [
{
"commands": [],
"lazy": [],
"attributes": ["Time", "Category", "Tag", "Value", "Unit" ],
"_id": "6218ac30e555cf000e84aee4",
"resource": "/iot/json",
"apikey": "Gr II",
"service": "openiot",
"subservice": "/",
"__v": 2,
"static_attributes": [],
"internal_attributes": [],
"entity_type": "Thing"
}
]
}
- Dispositivos:
OJO: Como puede observarse, el primero de ellos está incorrectamente definido, pero como no tiene nombre no hemos encontrado la forma de eliminarlo.
{
"count": 3,
"devices": [
{
"service": "openiot",
"service_path": "/",
"entity_name": "Thing:undefined",
"entity_type": "Thing",
"transport": "MQTT",
"attributes": [],
"lazy": [],
"commands": [],
"static_attributes": [],
"explicitAttrs": true
},
{
"device_id": "IoT",
"service": "openiot",
"service_path": "/",
"entity_name": "Thing:IoT",
"entity_type": "Thing",
"transport": "MQTT",
"attributes": [
{ "object_id": "Time", "name": "Time", "type": "String" },
{ "object_id": "Type", "name": "Type", "type": "String" },
{ "object_id": "Value", "name": "Value", "type": "String" },
{ "object_id": "Unit", "name": "Unit", "type": "String" },
{ "object_id": "Category", "name": "Category", "type": "String" },
{ "object_id": "Tag", "name": "Tag", "type": "String" }
],
"lazy": [],
"commands": [],
"static_attributes": []
},
{
"device_id": "Trame",
"service": "openiot",
"service_path": "/",
"entity_name": "Thing:Trame",
"entity_type": "Thing",
"transport": "MQTT",
"attributes": [
{ "object_id": "Time", "name": "Time", "type": "String" },
{ "object_id": "Type", "name": "Type", "type": "String" },
{ "object_id": "Value", "name": "Value", "type": "String" },
{ "object_id": "Category", "name": "Category", "type": "String" }
],
"lazy": [],
"commands": [],
"static_attributes": []
}
]
}

¿Observan alguna causa por la que se produzca esta perdida de tramas en el agente?
Si necesitan cualquier información para el análisis del problema no duden en pedírnosla.
Muchas gracias por su atención y un saludo
Héctor

@mrutid
Copy link
Member

mrutid commented Mar 31, 2022

This seems to be a concrete problem associated to an E2E integration and a concrete environment/infrastructure. There is not enough information to do a proper evaluation (Load Balacers, MQTT Topics, Network, HA Deployment, subscribers to the $shared MQTT topic...). There could be some problem with the iotAgent but in my opinion this is not the forum to address this kind of problems. Once a bug is detected with an use case/test (you will need, at least, to assure that the measures are reaching the iotAgent), then we could open an issue to solve it (with an unmodified IoTAgent if it is possible).

In the meanwhile I recommend you to contact with the supporters of your platform by the right support channel. They could bring you help to debug and determine if there is a iotAgent bug, or anything else.

Best.

@AlvaroVega
Copy link
Member

IoT-Agent-JSON ( v 1.19.0
Did you tried with latest (from master) version iotagent-json?

@hecuru
Copy link
Author

hecuru commented Apr 1, 2022

I have opened this thread here because initially I only received 2 frames per minute, also without any error message appearing in the whole sequence up to the MySQL database. By modifying the service protocol registered in the IoT agent, putting '"protocol": "IoTA-JSON"' 4 frames per minute began to be received.

I can't work with the original agent code because the data received by mosquitto doesn't contain the 'attrs' particle and so we need to modify the code in the 'constants.js' file as follows:
MEASURES_SUFIX: 'attrs',
by
MEASURES_SUFIX: ''.

In addition, some frame contains a null character and the original agent is not capable of processing this type of frame.

I have not updated to version 21 of the agent, but reviewing the files with changes between both versions, it seemed to me that these changes should not affect my case. Anyway, I'll try to move to that new version.

Thank you very much for your comments.

@AlvaroVega
Copy link
Member

What kind of topics are you using for send measures to iotagent?

In your logs I've seen:
msg=h message topic: Gr II/IoT; mensa: {"Time":"2022-03-31T06:46:37","Type":"ED","Value":"17.08625","Unit":"MWH","Category":"E","Tag":"ElecVentilateurFlamme"}

but seems not match with expected:
https://github.com/telefonicaid/iotagent-json/blob/master/docs/usermanual.md#measure-reporting-1
/json/{{api-key}}/{{device-id}}/attrs
or
/json/{{api-key}}/{{device-id}}/attrs/

@hecuru
Copy link
Author

hecuru commented Apr 21, 2022

Hello again.
Yes, the topics do not match the ones expected by default, but I have modified the original code of the agent so that the format received is processed correctly (modifying the topic is not an option).
On the other hand, I have updated the version of the agent to the latest available and for a short time all the frames have been received, but when modifying the subscriptions in orion to register the 'Time' data, which until now was not having taken into account, frame loss has started to occur again.
Any other suggestions?
Thanks!!

@fgalan
Copy link
Member

fgalan commented Apr 21, 2022

Yes, the topics do not match the ones expected by default, but I have modified the original code of the agent so that the format received is processed correctly (modifying the topic is not an option).

Maybe you could share with us your modifications in the code so we can evaluate if they can be useful for general usage in IOTA? The best way would be a pull request with such code modifications.

On the other hand, I have updated the version of the agent to the latest available and for a short time all the frames have been received, but when modifying the subscriptions in orion to register the 'Time' data, which until now was not having taken into account, frame loss has started to occur again.

Could you provide details on the subscription modification? I mean to use GET /v2/entities/{subId} to show

  • how subscription was the subscription before the change
  • how subscription ended the subscription after the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants