However, I've noticed that one on my flows which has worked well for the past 6 months is now creating an error since I started PM2 and forces node-red to restart every time the flow runs.
node-red-0 (out): 8 Mar 23:25:32 - [red] Uncaught Exception:
node-red-0 (out): 8 Mar 23:25:32 - Error: EACCES, open '/var/www/pictures/current_con.gif'
PM2: 2015-03-08 23:25:33: App closed with code: 1
PM2: 2015-03-08 23:25:33: App name:node-red id:0 exited with code 1
PM2: 2015-03-08 23:25:33: Starting execution sequence in -fork mode- for app name:node-red id:0
PM2: 2015-03-08 23:25:33: App name:node-red id:0 online
[{"id":"d820bfe6.27df4","type":"function","name":"Weather calcs","func":"var weatherSTR = msg.payload.response.current_observation[0];\nvar rainin = weatherSTR.precip_1hr_in[0];\nvar rainmm = Math.round(rainin * 254); //convert to mm x 10\nvar raindayin = weatherSTR.precip_today_in[0];\nvar raindaymm = Math.round(raindayin * 254); //convert to mm x 10\nvar iconURL = weatherSTR.icon_url[0];\n\n\nmsg.payload = ((rainmm) + (\",\") + (raindaymm));\n//and msg2 is the weather icon URL\nmsg2 = { payload: iconURL };\nreturn [msg,msg2];","outputs":"2","x":628,"y":270.5,"z":"3f1992f2.c0e66e","wires":[["58b6c9e1.a74938"],["bd46f6d1.42b908"]]},{"id":"3ebc476d.c143b8","type":"inject","name":"Get Conditions","topic":"","payload":"6803e94c3cc08f6a/conditions/q/pws:IENGLAND539.xml","payloadType":"string","repeat":"","crontab":"","once":false,"x":109.00000762939453,"y":270.5000066757202,"z":"3f1992f2.c0e66e","wires":[["7eb287c6.814d78"]]},{"id":"d72d8ac.f28d278","type":"function","name":"Download weather icon","func":"var fileURL = msg.payload;\n//var dest = (\"../../../var/www/pictures/current_con.gif\");\nvar dest = (\"/var/www/pictures/current_con.gif\");\nvar fs = context.global.fs;\nvar http = context.global.http;\n\nvar file = fs.createWriteStream(dest);\nvar request = http.get(fileURL, function(response) {\n response.pipe(file);\n});\n//pass msg out for debug, etc.\nreturn [msg];","outputs":1,"x":411.75,"y":312.5,"z":"3f1992f2.c0e66e","wires":[["20f9bf5f.df064"]]},{"id":"58b6c9e1.a74938","type":"debug","name":"","active":false,"complete":false,"x":817,"y":309.75,"z":"3f1992f2.c0e66e","wires":[]},{"id":"20f9bf5f.df064","type":"debug","name":"","active":false,"complete":false,"x":602.25,"y":312.25,"z":"3f1992f2.c0e66e","wires":[]},{"id":"bd46f6d1.42b908","type":"delay","name":"Rate Limit","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","rateUnits":"hour","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":206,"y":313,"z":"3f1992f2.c0e66e","wires":[["d72d8ac.f28d278"]]},{"id":"fc9c3a28.0363c8","type":"xml","name":"Convert XML","x":471,"y":270,"z":"3f1992f2.c0e66e","wires":[["d820bfe6.27df4"]]},{"id":"7eb287c6.814d78","type":"http request","name":"
wunderground.com","method":"GET","url":"
http://api.wunderground.com/api/{{{payload}}}","x":290,"y":270,"z":"3f1992f2.c0e66e","wires":[["fc9c3a28.0363c8"]]}]