Hello,
I want to display log file on dashboard by using template node from this reference.
It's working well until the file containing with special char like ( β, µ).
I'm using "cat" command with exec node. I've tested cat command with ssh terminal, and working well.
I've attached the flow as reference;
[{"id":"ee54b1e6.a6319","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"8a44fe73.1d3ed","type":"file","z":"ee54b1e6.a6319","name":"","filename":"/home/pi/Arduino_SMS/SMS_Log.txt","appendNewline":false,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":790,"y":260,"wires":[[]]},{"id":"53d37865.f89f98","type":"debug","z":"ee54b1e6.a6319","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":440,"wires":[]},{"id":"f0b40890.bc9308","type":"ui_template","z":"ee54b1e6.a6319","group":"d32df258.5ad34","name":"","order":1,"width":"6","height":"4","format":"<style>\n #mylog {\n min-height: 450px;\n max-height: 500px;\n padding: 0;\n white-space: pre;\n }\n</style>\n\n<div id=\"mylog\" ng-bind=\"msg.payload\" contenteditable=\"true\">\n <!-- file contents will go here -->\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":720,"y":320,"wires":[[]]},{"id":"6c51653.7a1679c","type":"inject","z":"ee54b1e6.a6319","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"non-Printable char µ end of string","payloadType":"str","x":290,"y":320,"wires":[["f0b40890.bc9308"]]},{"id":"98db0c3e.0058d","type":"exec","z":"ee54b1e6.a6319","command":"cat /home/pi/Arduino_SMS/SMS_Log.txt","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"cat","x":370,"y":460,"wires":[["53d37865.f89f98","f0b40890.bc9308"],[],[]]},{"id":"a7a8cd7f.9a72d","type":"ui_button","z":"ee54b1e6.a6319","name":"Read Cat File","group":"d32df258.5ad34","order":3,"width":"2","height":"1","passthru":false,"label":"Cat File","tooltip":"","color":"","bgcolor":"","icon":"","payload":" ","payloadType":"str","topic":"","x":200,"y":460,"wires":[["98db0c3e.0058d"]]},{"id":"85bf123c.0f21","type":"ui_button","z":"ee54b1e6.a6319","name":"Clear File","group":"d32df258.5ad34","order":3,"width":"2","height":"1","passthru":false,"label":"Clear File","tooltip":"","color":"","bgcolor":"","icon":"","payload":" ","payloadType":"str","topic":"","x":420,"y":260,"wires":[["f0b40890.bc9308"]]},{"id":"d32df258.5ad34","type":"ui_group","name":"Default","tab":"ca552dc7.8db33","order":1,"disp":true,"width":"6","collapse":false},{"id":"ca552dc7.8db33","type":"ui_tab","name":"Test","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
I think the problem is caused by exec node.
SMS_Log.txt (523 Bytes)
Any suggestion is greatly appreciated.
Aung