When internet fails , same data gets repeated until internet is up

While working with Modbus to database , sending data from Modbus to DB using CSV file and q-gate for interval of 5 minutes

When Internet is Up , Data send automatically to db

When there is NO Internet , queueing is counted .

When Internet is Up, last value queued up repeated number of times again in DB (interval until Internet is up), then continues with rest of values

Can anyone help me to figure out the issue

Appreciate , your effort in notifying the issue
Energy charges

This flow in the flows library demonstrates a way to automatically queue messages until they are able to be delivered. The example sends email messages, queueing them if it is not possible to send them, then automatically releasing them when possible. It should be easy to modify it for your needs I think.

@Colin :grinning:Thanks for your response

I will try and update you @colin

Regards,
Energycharges

I have just looked at you previous thread where the same issue was discussed and there you said you had fixed it using the flow I have just posted, but the flow you are using is nothing like the one I posted.

Thanks for your reply colin

Yeah it was working fine.

I'm facing this issue again for past couple of days , trying to solve the issue.
Previous thread was closed , so opened a new one to seek some help

I will try and update you @Colin

Regards,
Energy charges

I tried working with Flow that demonstrates way to automatically queue messages until they are able to be delivered.
While running the program the data count for queueing in Q-gate increases , but there is no data to mongo db ,even when the internet is up . Simple gate is closed

Can you please guide me in this issue , not able to figure out with this issue

[{"id":"533a8e0e.ca76f","type":"inject","z":"2c86bea2.cb3d32","name":"ENERGY","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":false,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":150,"y":180,"wires":[["813dbf73.e8872","b7a65d54.0aac2","7fb91077.6fe9f","820282a0.89b37","9595c60f.47c808"]]},{"id":"813dbf73.e8872","type":"function","z":"2c86bea2.cb3d32","name":"address:0","func":"msg.payload ={\n    'fc':3,\n    'unitid':1,\n    'address':0,\n    'quantity':24\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":80,"wires":[["93796697.c9c5e8"]]},{"id":"820282a0.89b37","type":"function","z":"2c86bea2.cb3d32","name":"address:80","func":"msg.payload ={\n    'fc':3,\n    'unitid':1,\n    'address':80,\n    'quantity':50\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":330,"y":160,"wires":[["d5324fac.45b53"]]},{"id":"d5324fac.45b53","type":"modbus-flex-getter","z":"2c86bea2.cb3d32","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"b3a0130c.9691f","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":160,"wires":[["13f2e029.af73b"],[]]},{"id":"47c96e22.ab479","type":"comment","z":"2c86bea2.cb3d32","name":"Energy meter","info":"","x":110,"y":120,"wires":[]},{"id":"9595c60f.47c808","type":"function","z":"2c86bea2.cb3d32","name":"address:1024","func":"msg.payload ={\n     value: msg.payload,\n    'fc':3,\n    'unitid':1,\n    'address':1024,\n    'quantity':36\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":240,"wires":[["92069681.22a8a8"]]},{"id":"92069681.22a8a8","type":"modbus-flex-getter","z":"2c86bea2.cb3d32","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"b3a0130c.9691f","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":480,"y":240,"wires":[["db59b19.75a4f5","748b6bfb.1ed0e4"],[]]},{"id":"13f2e029.af73b","type":"buffer-parser","z":"2c86bea2.cb3d32","name":"DPF/TAN/THDV/THD","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"DPF1","offset":0,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"DPF2","offset":4,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"DPF3","offset":8,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"TAN1","offset":12,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"TAN2","offset":16,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"TAN3","offset":20,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"TANSys","offset":24,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV1","offset":28,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV2","offset":32,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV3","offset":36,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV12","offset":40,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV23","offset":44,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDV31","offset":48,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDA1","offset":52,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDA2","offset":56,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDA3","offset":60,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"THDAN","offset":64,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"Freq","offset":68,"length":1,"offsetbit":0,"scale":0.001,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":660,"y":160,"wires":[["1baef6e9.300039"]]},{"id":"db59b19.75a4f5","type":"buffer-parser","z":"2c86bea2.cb3d32","name":"Energy","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"biguint64be","name":"KWH_1i","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_1e","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_2i","offset":16,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_2e","offset":24,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_3i","offset":32,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_3e","offset":40,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_Sysi","offset":48,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_Syse","offset":56,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"biguint64be","name":"KWH_BAL","offset":64,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"bigValues","msgPropertyType":"str","resultType":"object","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":640,"y":240,"wires":[["f2f36eba.2da92"]]},{"id":"b7a65d54.0aac2","type":"function","z":"2c86bea2.cb3d32","name":"address:24","func":"msg.payload ={\n     value: msg.payload,\n    'fc':3,\n    'unitid':1,\n    'address':24,\n    'quantity': 48\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":200,"wires":[["81cb776c.375238"]]},{"id":"329b0f11.de8de","type":"function","z":"2c86bea2.cb3d32","name":"ReadInt 64","func":"   msg.payload = {\n   \n   P1 : Number(msg.bigValues.P1.value),\n   P2 : Number(msg.bigValues.P2.value),\n   P3 : Number(msg.bigValues.P3.value),\n   Psys : Number(msg.bigValues.Psys.value), \n   S1 : Number(msg.bigValues.S1.value),\n   S2 : Number(msg.bigValues.S2.value),  \n   S3 : Number(msg.bigValues.S3.value),\n   Ssys : Number(msg.bigValues.Ssys.value),\n   Q1 : Number(msg.bigValues.Q1.value),\n   Q2 : Number(msg.bigValues.Q2.value),  \n   Q3 : Number(msg.bigValues.Q3.value),\n   Qsys : Number(msg.bigValues.Qsys.value),\n   }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":200,"wires":[["1baef6e9.300039","c6a41193.67c8d"]]},{"id":"9d787830.ed5948","type":"buffer-parser","z":"2c86bea2.cb3d32","name":"P/S/Q","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"biguint64be","name":"P1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"P2","offset":8,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"P3","offset":16,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Psys","offset":24,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"S1","offset":32,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"S2","offset":40,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"S3","offset":48,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Ssys","offset":56,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q1","offset":64,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q2","offset":72,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Q3","offset":80,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"bigint64be","name":"Qsys","offset":88,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"swap64","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"bigValues","msgPropertyType":"str","resultType":"object","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":590,"y":200,"wires":[["329b0f11.de8de"]]},{"id":"f2f36eba.2da92","type":"function","z":"2c86bea2.cb3d32","name":"ReadInt 64","func":"   msg.payload = \n   {\n\nKWH_1i : Number(msg.bigValues.KWH_1i.value),\nKWH_1e : Number(msg.bigValues.KWH_1e.value),\nKWH_2i : Number(msg.bigValues.KWH_2i.value),\nKWH_2e : Number(msg.bigValues.KWH_2e.value), \nKWH_3i : Number(msg.bigValues.KWH_3i.value),\nKWH_3e : Number(msg.bigValues.KWH_3e.value),\nKWH_Sysi : Number(msg.bigValues.KWH_Sysi.value),\nKWH_Syse : Number(msg.bigValues.KWH_Syse.value), \nKWH_BAL : Number(msg.bigValues.KWH_BAL.value),\n\n   }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":790,"y":240,"wires":[["1baef6e9.300039"]]},{"id":"1baef6e9.300039","type":"join","z":"2c86bea2.cb3d32","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"30","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":100,"wires":[["c2fb8ec6.11821"]]},{"id":"5f60156d.1c930c","type":"buffer-parser","z":"2c86bea2.cb3d32","name":"PF","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32be","name":"PF1","offset":0,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"PF2","offset":4,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"PF3","offset":8,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"int32be","name":"PFsys","offset":12,"length":1,"offsetbit":0,"scale":0.001,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":610,"y":120,"wires":[["1baef6e9.300039"]]},{"id":"7fb91077.6fe9f","type":"function","z":"2c86bea2.cb3d32","name":"address:72","func":"msg.payload ={\n    'fc':3,\n    'unitid':1,\n    'address':72,\n    'quantity':20\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":120,"wires":[["2dbac67e.e4032a"]]},{"id":"a76e850f.c7b238","type":"buffer-parser","z":"2c86bea2.cb3d32","name":"Voltage","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"V1","offset":0,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"V2","offset":4,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"V3","offset":8,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"V12","offset":12,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"V23","offset":16,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"V31","offset":20,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"Vsys","offset":24,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"A1","offset":28,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"A2","offset":32,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"A3","offset":36,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"AN","offset":40,"length":1,"offsetbit":0,"scale":0.001,"mask":""},{"type":"uint32be","name":"Asys","offset":44,"length":1,"offsetbit":0,"scale":0.001,"mask":""}],"swap1":"","swap2":"swap64","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":600,"y":80,"wires":[["1baef6e9.300039"]]},{"id":"93796697.c9c5e8","type":"modbus-flex-getter","z":"2c86bea2.cb3d32","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"b3a0130c.9691f","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":460,"y":80,"wires":[["a76e850f.c7b238"],[]]},{"id":"81cb776c.375238","type":"modbus-flex-getter","z":"2c86bea2.cb3d32","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"b3a0130c.9691f","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":460,"y":200,"wires":[["9d787830.ed5948"],[]]},{"id":"2dbac67e.e4032a","type":"modbus-flex-getter","z":"2c86bea2.cb3d32","name":"Modbus","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"b3a0130c.9691f","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":460,"y":120,"wires":[["5f60156d.1c930c"],[]]},{"id":"8dab2644.27d798","type":"file","z":"2c86bea2.cb3d32","name":"EnergyTest","filename":"/home/pi/Documents/Energytest.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1270,"y":100,"wires":[["6f568b14.508a04","4f669098.39785"]]},{"id":"c2fb8ec6.11821","type":"function","z":"2c86bea2.cb3d32","name":"","func":"var Site = \"DXB0002\";\nvar Node = \"SAN0002\";\nvar Device =\"EMT0002\";\nvar date = new Date();\nvar time = date.toLocaleString();\n\nvar V1 = msg.payload.V1;\nvar V2 = msg.payload.V2;\nvar V3 = msg.payload.V3;\nvar V12= msg.payload.V12;\nvar V23= msg.payload.V23;\nvar V31= msg.payload.V31;\nvar Vsys= msg.payload.Vsys;\nvar A1 = msg.payload.A1;\nvar A2 = msg.payload.A2;\nvar A3 = msg.payload.A3;\nvar AN = msg.payload.AN;\nvar Asys=msg.payload.Asys;\nvar P1 =msg.payload.P1;\nvar P2 = msg.payload.P2;\nvar P3 = msg.payload.P3;\nvar Psys= msg.payload.Psys;\nvar S1 =msg.payload.S1;\nvar S2 =msg.payload.S2;\nvar S3 =msg.payload.S3;\nvar Ssys=msg.payload.Ssys;\nvar Q1 =msg.payload.Q1;\nvar Q2= msg.payload.Q2;\nvar Q3 = msg.payload.Q3;\nvar Qsys =msg.payload.Qsys;\nvar PF1 =msg.payload.PF1;\nvar PF2 =msg.payload.PF2;\nvar PF3= msg.payload.PF3;\nvar PFsys=msg.payload.PFsys;\nvar DPF1 =msg.payload.DPF1;\nvar DPF2 =msg.payload.DPF2;\nvar DPF3 =msg.payload.DPF3;\nvar TAN1 =msg.payload.TAN1;\nvar TAN3 =msg.payload.TAN3;\nvar TANSys=msg.payload.TANSys;\nvar THDV1=msg.payload.THDV1;\nvar THDV2=msg.payload.THDV2;\nvar THDV3=msg.payload.THDV3;\nvar THDV12=msg.payload.THDV12;\nvar THDV23=msg.payload.THDV23;\nvar THDV31=msg.payload.THDV31;\nvar THDA1=msg.payload.THDA1;\nvar THDA2=msg.payload.THDA2;\nvar THDA3=msg.payload.THDA3;\nvar THDAN=msg.payload.THDAN;\nvar Freq=msg.payload.Freq;\nvar KWH_1i =msg.payload.KWH_1i;\nvar KWH_1e=msg.payload.KWH_1e;\nvar KWH_2i =msg.payload.KWH_2i;\nvar KWH_2e =msg.payload.KWH_2e;\nvar KWH_3i =msg.payload.KWH_3i;\nvar KWH_3e =msg.payload.KWH_3e;\nvar KWH_SYSi =msg.payload.KWH_SYSi;\nvar KWH_SYSe =msg.payload.KWH_SYSe;\nvar KWH_BAL =msg.payload.KWH_BAL;\n\n\npayload= {Site,Node,Device,\"Timestamp\":time , 'V1':msg.payload.V1 , 'V2':msg.payload.V2,'V3':msg.payload.V3,'V12':msg.payload.V12,'V23':msg.payload.V23,'V31':msg.payload.V31,'Vsys':msg.payload.Vsys,'A1':msg.payload.A1,'A2':msg.payload.A2,'A3':msg.payload.A3,'AN':msg.payload.AN,'Asys':msg.payload.Asys, \n'P1':msg.payload.P1/1000000,'P2':msg.payload.P2/1000000,'P3':msg.payload.P3/1000000,'Psys':msg.payload.Psys/1000000,'S1':msg.payload.S1/1000000,'S2':msg.payload.S2/1000000,'S3':msg.payload.S3/1000000,'Ssys':msg.payload.Ssys/1000000,'Q1':msg.payload.Q1/1000000,'Q2':msg.payload.Q2/1000000,'Q3':msg.payload.Q3/1000000,'Qsys':msg.payload.Qsys/1000000,\n'PF1':msg.payload.PF1,'PF2':msg.payload.PF2,'PF3':msg.payload.PF3,'PFsys':msg.payload.PFsys,'DPF1':msg.payload.DPF1,'DPF2':msg.payload.DPF2,'DPF3':msg.payload.DPF3,'TAN1':msg.payload.TAN1,'TAN2':msg.payload.TAN2,'TAN3':msg.payload.TAN3,'TANSys':msg.payload.TANsys,'THDV1':msg.payload.THDV1,'THDV2':msg.payload.THDV2,'THDV3':msg.payload.THDV3,'THDV12':msg.payload.THDV12,'THDV23':msg.payload.THDV23,'THDV31':msg.payload.THDV31,'THDA1':msg.payload.THDA1,'THDA2':msg.payload.THDA2,'THDA3':msg.payload.THDA3,'THDAN':msg.payload.THDAN,'Freq':msg.payload.Freq,\n'KWH_1i':msg.payload.KWH_1i/10000 ,'KWH_2i':msg.payload.KWH_2i/10000,'KWH_3i':msg.payload.KWH_3i/10000,'KWH_1e':msg.payload.KWH_1e/10000,'KWH_2e':msg.payload.KWH_2e/10000,'KWH_3e':msg.payload.KWH_3e/10000,'KWH_Sysi':msg.payload.KWH_Sysi/10000,'KWH_Syse':msg.payload.KWH_Syse/10000,'KWH_BAL':msg.payload.KWH_BAL/10000\n\n\n};\n\n\n\nmsg.payload = payload;\n\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":100,"wires":[["247286d7.1fa10a"]]},{"id":"247286d7.1fa10a","type":"csv","z":"2c86bea2.cb3d32","name":"","sep":",","hdrin":"","hdrout":"once","multi":"one","ret":"\\n","temp":"Site,Node,Device,Timestamp,V1,V2,V3,V12,V23,V31,Vsys,A1,A2,A3,AN,Asys,P1,P2,P3,Psys,S1,S2,S3,Ssys,Q1,Q2,Q3,Qsys,PF1,PF2,PF3,PFsys,DPF1,DPF2,DPF3,TAN1,TAN2,TAN3,TANSys,THDV1,THDV2,THDV3,THDV12,THDV23,THDV31,THDA1,THDA2, THDA3,THDAN,Freq,KWH_1i,KWH_1e,KWH_2i,KWH_2e,KWH_3i,KWH_3e,KWH_Sysi,KWH_Syse,KWH_BAL","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":1090,"y":100,"wires":[["8dab2644.27d798"]]},{"id":"4f669098.39785","type":"csv","z":"2c86bea2.cb3d32","name":"","sep":",","hdrin":"","hdrout":"once","multi":"one","ret":"\\n","temp":"Site,Node,Device,Timestamp,V1,V2,V3,V12,V23,V31,Vsys,A1,A2,A3,AN,Asys,P1,P2,P3,Psys,S1,S2,S3,Ssys,Q1,Q2,Q3,Qsys,PF1,PF2,PF3,PFsys,DPF1,DPF2,DPF3,TAN1,TAN2,TAN3,TANSys,THDV1,THDV2,THDV3,THDV12,THDV23,THDV31,THDA1,THDA2, THDA3,THDAN,Freq,KWH_1i,KWH_1e,KWH_2i,KWH_2e,KWH_3i,KWH_3e,KWH_Sysi,KWH_Syse,KWH_BAL","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":1510,"y":140,"wires":[["2353c1f3.87ba7e"]]},{"id":"c6a41193.67c8d","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":200,"wires":[]},{"id":"748b6bfb.1ed0e4","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":300,"wires":[]},{"id":"f0ccce85.d70ef","type":"comment","z":"2c86bea2.cb3d32","name":"Success","info":"","x":80,"y":660,"wires":[]},{"id":"2acae55d.ef398a","type":"comment","z":"2c86bea2.cb3d32","name":"Fail","info":"","x":110,"y":720,"wires":[]},{"id":"2353c1f3.87ba7e","type":"link out","z":"2c86bea2.cb3d32","name":"","links":["5c790b00.b39504"],"x":1335,"y":260,"wires":[]},{"id":"d2c407b6.e78ba8","type":"link in","z":"2c86bea2.cb3d32","name":"","links":["a416077f.8d4958"],"x":75,"y":320,"wires":[["c7f4706c.ffa93"]]},{"id":"c7f4706c.ffa93","type":"function","z":"2c86bea2.cb3d32","name":"get next","func":"node.send({topic: \"control\", payload: \"drop\"})\nmsg.topic = \"control\"\nmsg.payload = \"peek\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":140,"y":380,"wires":[["5896469b.f3e188","567a2ba4.12f6c4"]]},{"id":"5896469b.f3e188","type":"q-gate","z":"2c86bea2.cb3d32","name":"q-gate","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":false,"x":350,"y":360,"wires":[["60271730.006a78","d360d098.31f2c"]]},{"id":"d360d098.31f2c","type":"mongodb3 in","z":"2c86bea2.cb3d32","service":"_ext_","configNode":"","name":"test","collection":"Energytest","operation":"insert","x":650,"y":360,"wires":[["eb26e8c1.b54f28"]]},{"id":"eb26e8c1.b54f28","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":360,"wires":[]},{"id":"f9533b82.30ec48","type":"function","z":"2c86bea2.cb3d32","name":"Close gate","func":"//node.send(msg)      // this clones the message\n// Close gate with new message so as not to corrupt the original in the queue\nreturn({topic: \"gate_control\", payload: \"close\"})","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":440,"wires":[["83c0835.8b68d8","677efc65.386654"]]},{"id":"83c0835.8b68d8","type":"gate","z":"2c86bea2.cb3d32","name":"","controlTopic":"gate_control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":850,"y":480,"wires":[["5896469b.f3e188","902e04f4.e3c1e8"]]},{"id":"49368771.6a6258","type":"function","z":"2c86bea2.cb3d32","name":"Peek","func":"// Send peek command with new message so as not to corrupt the original in the queue\nreturn({topic: \"control\", payload: \"peek\"})","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":480,"wires":[["83c0835.8b68d8","93a89e24.08b16"]]},{"id":"b8d255f3.f921e8","type":"change","z":"2c86bea2.cb3d32","name":"Open gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"gate_control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":600,"wires":[["83c0835.8b68d8","18b538a5.f876a7"]]},{"id":"4481016b.86d56","type":"function","z":"2c86bea2.cb3d32","name":"Queue empty?","func":"// expects msg.status.text in form \"queuing: <number>\"\n// sends a message if queue is empty\nif (parseInt(msg.status.text.split(\":\")[1]) !== 0) {\n    msg = null\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":600,"wires":[["b8d255f3.f921e8"]]},{"id":"97fb3eb.4fb2dc","type":"status","z":"2c86bea2.cb3d32","name":"q-gate status","scope":["5896469b.f3e188"],"x":270,"y":600,"wires":[["4481016b.86d56","9f7be8bd.17d1b8"]]},{"id":"c2710f1f.5cc5b","type":"inject","z":"2c86bea2.cb3d32","name":"Retry 1 minute","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"peek","payloadType":"str","x":140,"y":500,"wires":[["49368771.6a6258"]]},{"id":"d9ffaa26.08e718","type":"complete","z":"2c86bea2.cb3d32","name":"","scope":["d360d098.31f2c"],"uncaught":false,"x":230,"y":660,"wires":[["a416077f.8d4958"]]},{"id":"a416077f.8d4958","type":"link out","z":"2c86bea2.cb3d32","name":"","links":["d2c407b6.e78ba8"],"x":395,"y":660,"wires":[]},{"id":"43b3ae7d.70c84","type":"catch","z":"2c86bea2.cb3d32","name":"","scope":["d360d098.31f2c"],"uncaught":false,"x":230,"y":720,"wires":[["779f4d20.fd9074"]]},{"id":"779f4d20.fd9074","type":"link out","z":"2c86bea2.cb3d32","name":"","links":["abee2f3f.d9bea"],"x":385,"y":720,"wires":[]},{"id":"abee2f3f.d9bea","type":"link in","z":"2c86bea2.cb3d32","name":"","links":["779f4d20.fd9074"],"x":615,"y":720,"wires":[["b8d255f3.f921e8"]]},{"id":"5c790b00.b39504","type":"link in","z":"2c86bea2.cb3d32","name":"","links":["2353c1f3.87ba7e"],"x":195,"y":460,"wires":[["5896469b.f3e188","49368771.6a6258"]]},{"id":"60271730.006a78","type":"link out","z":"2c86bea2.cb3d32","name":"","links":["ad722922.aae448"],"x":355,"y":440,"wires":[]},{"id":"ad722922.aae448","type":"link in","z":"2c86bea2.cb3d32","name":"","links":["60271730.006a78"],"x":455,"y":440,"wires":[["f9533b82.30ec48"]]},{"id":"677efc65.386654","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":420,"wires":[]},{"id":"93a89e24.08b16","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":691,"y":537,"wires":[]},{"id":"18b538a5.f876a7","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":660,"wires":[]},{"id":"9f7be8bd.17d1b8","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":371,"y":557,"wires":[]},{"id":"567a2ba4.12f6c4","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":250,"y":300,"wires":[]},{"id":"902e04f4.e3c1e8","type":"debug","z":"2c86bea2.cb3d32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":500,"wires":[]},{"id":"b3a0130c.9691f","type":"modbus-client","name":"seneca","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.1.9","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

Regards,
Energy charges

Why on earth have you taken a well formatted flow designed to make a complex flow reasonably easy to understand and moved everything about so now it is a complete jumble? You should have kept all the modbus and preparatory stuff on one tab an on another tab just replaced the centre group of the flow I posted with your test node and any logic needed around it.

Put back the OK and FAIL debug nodes that you have deleted and check that they correctly show messages when the logic passes a message to the test node. If messages are not getting passed to the test node then do a Restart Flows from the Deploy button to empty all the queues and start again.

Thanks for your response @Colin :smiley:

To make myself understand about the flow , done those changes. Once Im done with the output , will recreate well formatted flow.

I tried flow after adding back OK and FAIL debug nodes, there is no change in process.
Once deployed , data passing from Modbus to mongo dB , after passing Simple gate is closed and Q-gate queueing count increases . still same condition prevails.
Debug nodes for OK and FAIL , No output shown .

Can you help me to figure out this issue :grinning:

Thank you
Energy Charges

Well if there is not output to the OK or FAIL links then of course it won't work. The logic requires that you send a message to either the OK link or the FAIL link after attempting to process a message. Without an OK or FAIL indication how do you expect it to know whether to release the next one in the queue or to retry at the next retry time? If the mongo node does not send Catch or Complete outputs then you will have to look at the output from the node itself and work out from that whether it has failed or succeeded in sending the data, and then you must send a message either to the OK or FAIL link. This was all explained in the previous thread.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.