Yveaux / node-red-contrib-opentherm

OpenTherm decoder for Node-RED
GNU General Public License v3.0
5 stars 3 forks source link

tcp ip question #1

Closed kompio closed 6 years ago

kompio commented 6 years ago

Does your project works in tcp connection to otgw, or only serial connections in node red?

Yveaux commented 6 years ago

It should work for any transport, so also for tcp connections. The nodes just dissect otgw messages, you have to supply them.

kompio commented 6 years ago

I used tcp and I have the error for example : Illegal message length 'T90012500'

Yveaux commented 6 years ago

The check fails when supplied otgw message has a length unequal to 9 (ref https://github.com/Yveaux/node-red-contrib-opentherm/blob/master/otgwdec.js#L21) The error message suggests length is 9, but could there be a non-printable character in the string or something? (eg newline)

kompio commented 6 years ago

Yes, i think there is the problem .. i work on it.

mikeS7 commented 6 years ago

As temporary workaround you can use the following code: [{"id":"b11399f4.f38f6","type":"switch","z":"2b03e62a.441eea","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"^([TBRA][0-9A-F]{8})$","vt":"str","case":false},{"t":"else"}],"checkall":"true","outputs":2,"x":450,"y":520,"wires":[["eea08ba.95ae878"],["346dbba.695b144"]],"outputLabels":["messages","responses"]},{"id":"dabc1aa3.7b3198","type":"change","z":"2b03e62a.441eea","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"^(.*)?\\s$","fromt":"re","to":"$1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":520,"wires":[["b11399f4.f38f6"]]}]

and use messages output

kompio commented 6 years ago

Thank you I will do soon.

Konrad

20.12.2017 8:24 AM "mikeS7" notifications@github.com napisał(a):

As temporary workaround you can use the following code: [{"id":"b11399f4.f38f6","type":"switch","z":"2b03e62a. 441eea","name":"","property":"payload","propertyType":"msg", "rules":[{"t":"regex","v":"^([TBRA][0-9A-F]{8})$","vt":"str" ,"case":false},{"t":"else"}],"checkall":"true","outputs":2," x":450,"y":520,"wires":[["eea08ba.95ae878"],["346dbba. 695b144"]],"outputLabels":["messages","responses"]},{"id": "dabc1aa3.7b3198","type":"change","z":"2b03e62a.441eea", "name":"","rules":[{"t":"change","p":"payload","pt":" msg","from":"^(.*)?\s$","fromt":"re","to":"$1","tot":" str"}],"action":"","property":"","from":"","to":"","reg": false,"x":240,"y":520,"wires":[["b11399f4.f38f6"]]}]

and use messages output

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Yveaux/node-red-contrib-opentherm/issues/1#issuecomment-352985758, or mute the thread https://github.com/notifications/unsubscribe-auth/Agx1RtjFJULvwpvrlQQWRLF3vTTIZxIgks5tCLYWgaJpZM4Q673p .

kompio commented 6 years ago

This work for me:

[{"id":"193c8680.c04e4a","type":"function","z":"e332a1a8.50a58","name":"trim","func":"var newMsg = { payload: msg.payload.length };\n\nmsg.payload = msg.payload.toString().substr(0,9);\n\n\nreturn msg;","outputs":1,"noerr":0,"x":99.566650390625,"y":130.566650390625,"wires":[["3f7800a5.7fe248"]]},{"id":"b52511aa.29f7d","type":"tcp in","z":"e332a1a8.50a58","name":"","server":"client","host":"192.168.1.221","port":"1001","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":129.63333129882812,"y":44.866607666015625,"wires":[["193c8680.c04e4a"]]}]

Thank You

2017-12-20 8:51 GMT+01:00 KOMPIO kompio@kompio.net:

Thank you I will do soon.

Konrad

20.12.2017 8:24 AM "mikeS7" notifications@github.com napisał(a):

As temporary workaround you can use the following code: [{"id":"b11399f4.f38f6","type":"switch","z":"2b03e62a.441eea ","name":"","property":"payload","propertyType":"msg"," rules":[{"t":"regex","v":"^([TBRA][0-9A-F]{8})$","vt":"str", "case":false},{"t":"else"}],"checkall":"true","outputs":2,"x ":450,"y":520,"wires":[["eea08ba.95ae878"],["346dbba.695b144 "]],"outputLabels":["messages","responses"]},{"id":" dabc1aa3.7b3198","type":"change","z":"2b03e62a.441eea"," name":"","rules":[{"t":"change","p":"payload","pt":"msg"," from":"^(.*)?\s$","fromt":"re","to":"$1","tot":"str"}]," action":"","property":"","from":"","to":"","reg":false," x":240,"y":520,"wires":[["b11399f4.f38f6"]]}]

and use messages output

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Yveaux/node-red-contrib-opentherm/issues/1#issuecomment-352985758, or mute the thread https://github.com/notifications/unsubscribe-auth/Agx1RtjFJULvwpvrlQQWRLF3vTTIZxIgks5tCLYWgaJpZM4Q673p .

Yveaux commented 6 years ago

Ok, great! Closed this issue.