http input node getting "connection refused"

579 views
Skip to first unread message

phil bowles

unread,
May 23, 2017, 8:19:35 AM5/23/17
to Node-RED

I have an http input node running on raspberry pi (192.168.1.4:1880) serving up http updates to all my esp8266 devices. Yesterday it was working fine. This morning I had a power outage. After coming back up, Every esp8266 device is getting "connection refused". The NODE-RED debug log shows that nothing is being accepted by the input node (makes sense...!). If I enter the url directly in the browser on a PC , I get the expected response, and fiddler confirms that everything is as I would predict. This tends to rule out a firewall issue on the pi...as the main ui is accessible.

This is where it gets odd: When I select the flow that runs the http input node, and select debug messages for "current flow" I'm still seeing debug messages from my other flow (I have only two).

Adding the two up, it looks like my "updater" flow isn't running.

The summary is: NODE-RED is definitely listening on 192.168.1.4:1880. My input node listens to "/update/truc"
a recent debug log from my ESP code:

runUpdate: http://192.168.1.4:1880/update/truc?v=3_5_1
trucPublish: updating payload=now
[httpUpdate] HTTP error: connection refused
runUpdate HTTP_UPDATE_FAILD Error (-1): HTTP error: connection refused

And NODE-RED debug log for the current "failing" flow is showing message produced by the only other flow.

capture

All of the code worked fine before the power outage and I can't see any other "odd" messages anywhere. - any ideas anyone?

UPDATE: just updated and getting same behaviour in v.0.16


Julian Knight

unread,
May 23, 2017, 4:31:13 PM5/23/17
to Node-RED
Can you paste the flow so we can have a look?

On Tuesday, 23 May 2017 13:19:35 UTC+1, phil bowles wrote:


phil bowles

unread,
May 23, 2017, 6:50:20 PM5/23/17
to Node-RED


On Tuesday, 23 May 2017 22:31:13 UTC+2, Julian Knight wrote:
Can you paste the flow so we can have a look?

On Tuesday, 23 May 2017 13:19:35 UTC+1, phil bowles wrote:I'd love to but....I upgraded to v0.16.2 to try to fix it and everything is now broken, see the post I'm just about to put up...

phil bowles

unread,
May 23, 2017, 7:15:36 PM5/23/17
to Node-RED
Ignore my last - I have a semi-working v0.16.2 system. Did you mean to post the flows like this?:

[{"id":"fbddf0da.00e86","type":"http response","z":"1d2fb9b8.c29106","name":"","x":1010,"y":200,"wires":[]},{"id":"b8751207.b0c2","type":"file in","z":"1d2fb9b8.c29106","name":"latest fw","filename":"","format":"","x":800,"y":300,"wires":[["fbddf0da.00e86"]]},{"id":"fa38e882.8724d8","type":"exec","z":"1d2fb9b8.c29106","command":"ls -t /home/pi/trucFirmware/truc*","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":350,"y":80,"wires":[["e1a889f.9e0b878"],[],[]]},{"id":"e1a889f.9e0b878","type":"function","z":"1d2fb9b8.c29106","name":"","func":"var v=msg.req.query.v;\nvar f=msg.payload.split(\"\\n\")[0];\nmsg.filename=f;\nf=f.replace(\"/home/pi/trucFirmware/truc_\",\"\");\nf=f.replace(\".ino.bin\",\"\");\n//node.warn(v);\n//node.warn(f);\nif(v<f){\n//    node.warn(\"upgrade required\");\n    return msg;\n}\n//node.warn(\"no upgrade\");\nmsg.statusCode=304;\nmsg.payload=[];\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":260,"wires":[["adc36113.2435c"]]},{"id":"adc36113.2435c","type":"switch","z":"1d2fb9b8.c29106","name":"","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"304","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":550,"y":260,"wires":[["fbddf0da.00e86","53231663.b53c88"],["b8751207.b0c2"]]},{"id":"53231663.b53c88","type":"debug","z":"1d2fb9b8.c29106","name":"","active":true,"console":"false","complete":"res","x":1010,"y":140,"wires":[]},{"id":"6b8125a7.da6c7c","type":"debug","z":"1d2fb9b8.c29106","name":"","active":true,"console":"false","complete":"payload","x":280,"y":460,"wires":[]},{"id":"3c7cee48.d618c2","type":"http in","z":"1d2fb9b8.c29106","name":"/update/truc","url":"/update/truc","method":"get","swaggerDoc":"","x":120,"y":220,"wires":[["fa38e882.8724d8","6b8125a7.da6c7c"]]}]


On Tuesday, 23 May 2017 22:31:13 UTC+2, Julian Knight wrote:

phil bowles

unread,
May 24, 2017, 3:23:27 AM5/24/17
to Node-RED
SOLVED: its an ESP8266 problem, not a NODE-RED issue...

my raspberry pi runs on 192.168.1.4 and correctly announces itself to mdns, i.e. other PCs can "see" raspberrypi.local

if I connect with: http://192.168.1.4:1880/update/truc?v=3_5_1 it works perfectly
if OTOH I connect with: http://raspberrypi.local:1880/update/truc?v=3_5_1 : connection refused - as the ESP can't resolve .local addresses

Oops! my bad


Reply all
Reply to author
Forward
0 new messages