I have a raspberry pi running Node-Red and it has been working for some time with no problems. I'm using Telegram to send me a report every morning on the main parameters being monitored. It's a remote home automation application.
About a week ago I stopped getting the report come through. When I was able to get to the remote location I had to reboot the router and the raspberry pi.
Now I am not getting the report from the Telegram bot. In the Node-Red debug window I now get a message like this:

Caught exception in sender node: Error: EFATAL: Error: connect ENETUNREACH - Local ( when processing message: {"payload":{"chatId":12345678,"type":"message","content":"Kitchen PIR triggered","options":{"chat_id":12345678,"text":"Kitchen PIR triggered"}},"_msgid":"c1afa97b32cfd67b"}

I have changed the chatid there.

In addition, I have been using Remote-Red on my iphone to monitor the Dashboard and this too is showing errors. I deleted the Remote Access node and when I tried to re-establish a link, a similar ENETUNREACH error came up as I tried to get the QR code.

I think it is something to do with https access but I'm not to bright when it comes to this sort of thing. I am a hardware engineer not a software engineer so be gentle with me!

First thing to check is if you are connected to Telegram, if you are and are using node-red-contrib-telegrambot, you should get a status displayed that tells you.

If it is not connected, it may be that something is wrong with your credentials.

Yes the Telegram Sender node is showing 'connected'. So I don't think it's that.
Thank you for you input.
It's the fact I get a similar error message when setting up the Remote-Red 'remote access' node, as well. Makes me think that it is a https issue. It comes up with a ENETUNREACH error but a different ip address

:443 is the HTTPS connection port, so here is hoping you are on the right path there.

Thanks. Just not sure where to look now. As I say, I'm a hardware engineer!

Just took a look in a Browser and the SSL Certificate only works for * or

This suggests to me that something is not set up correctly in the Telegram Node, but quite where is above my pay grade.

Which Telegram node are you using?
Does the the error in the debug window originate at the telegram node?

I think I may have an idea what might be wrong but can't check until I am at the remote location.
I didn't want to confuse the issue to much but here is what might have happened. I have been using a Vigor router but have been experiencing issues with it. Perhaps once a month it drops out, despite having a scheduled reset every evening. My solution on the day things went wrong was to swap the router for a much simpler one given to me by the service provider. However, it everything went belly up because the static ip address had been set by the old router. I made a change in the pi to set the static ip address - the usual /etc/dhcpcd.conf edit. Most things then started working but I didn't notice the issue with the Telegram Sender port. My ESP32-CAM modules have PIRs that trigger a photo and send via Telegram - totally independent of Node-Red - but they do use the WiFi. So when I started getting the Telegram photos I assumed all was ok. Insufficient software testing!!
I believe that while the ip address has been allocated correctly, I may have may a typo in one of the other addresses.
I also found that the Remote-Red app had stopped working and got distracted by that problem - removing the node and trying to set it up again - getting a similar ENETUNREACH error message. I decided to revert back to the old router only to find that the same issue occurred with it. It was only as I was leaving the site that I found the issue with Telegram and captured the message.
So, because the issue occurs with both routers and I haven't edited the Telegram node, I assume it is not a router problem. That leaves the Pi and the only thing I changed was the /etc/dhcpcd.conf file to set the static ip. I'm just going to have to wait until I am on site next to check.

Thank you so much for your assistance. It is very much appreciated. I'll post on here when I investigate later in the week.

The RPi is the place I would check if that is the only thing changed.

Check the voltage coming out of the Draytek PSU Brick if you can, I have had a problem with one in the past causing 'unreliable connection'. (Only problem I have had with my 3 Drayteks in 20+years!)

Will do. I have to say the Draytek has been a great router apart from this one issue. I have learned a lot from using it because there are so many features. Most of the terms it uses could be Martian to me - tantalising words that I understand but strung together in what to me is meaningless!
The supply to the remote location is not great and there is probably one significant power break every month. I'm not entirely sure why the router drops out. When it does, I have no WiFi. The camera modules I designed have proper Watch Dog Timers circuits so when the the WiFi goes they enter a 5 minute reset cycle so effective stop working.
I must try logging status to a memory stick and see if that throws light on things.
Perhaps I could put a little flow into the Node-Red to record the last 10 messages with a time code.
Hmmm future project coming up. It's great being retired!! Unfortunately the brain is not always up to the task!
Thanks again.

Would an snmp flow help? It will send messages to Telegram if Internet drops, but of course, it may be too late, but at least you would get some kind of message...

[{"id":"e9c59b03.a502c8","type":"function","z":"223f145.6913d6c","name":"Router","func":"function pad2(number) {\n  number = '0' + Math.floor(number);\n  return number.substr(number.length - 2);\n}\n\nfunction pad3(number) {\n  number = \"0\" + Math.floor(number);\n  return number.substr(number.length - 3);\n}\n\nvar ticks = msg.payload[0].value;\nvar seconds = ticks / 100; \nvar hour = Math.floor(seconds / 3600);\nvar minute = Math.floor((seconds / 60) % 60);\nvar second = seconds % 60;\n\nvar result = pad3(hour) + ':' + pad2(minute) + ':' + pad2(second)\nvar rx1 = (msg.payload[3].value/1000000).toFixed(1);\nvar rx2 = (msg.payload[4].value/1000000).toFixed(1);\nvar tx1 = (msg.payload[5].value/1000000).toFixed(1);\n\nmsg.V2762 = \"Uptime: \" + result + \"</br>\";\nmsg.V2762 += \"SNR (Downstream): \" +  msg.payload[1].value + \"dB</br>\";\nmsg.V2762 += \"Status: \" + msg.payload[2].value + \" | \" + msg.payload[6].value + \"</br>\";\nmsg.V2762 += \"Rx: \" + rx1 + \"/\";\nmsg.V2762 += rx2 + \" | \";\nmsg.V2762 += \"Tx: \" + tx1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2396,"wires":[["c79feb1d.90f218"]]},{"id":"45bb15c.ebffbec","type":"function","z":"223f145.6913d6c","name":"Internet Status","func":"delete msg.oid;\ndelete msg.V2762;\nif (msg.payload[6].value === null){msg.payload[6].value = \"SHOWTIME  (or null!)\";}\nmsg.payload = \"Internet Status Changed - \" + msg.payload[6].value;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":2460,"wires":[["91187368.2e33"]]},{"id":"91187368.2e33","type":"link out","z":"223f145.6913d6c","name":"Router","links":["90b920aa.9feb78"],"x":1235,"y":2460,"wires":[]},{"id":"1d54a569.8d0cc3","type":"inject","z":"223f145.6913d6c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":2460,"wires":[["5a89a2d3.5ebadc"]]},{"id":"201018e2.cc2678","type":"switch","z":"223f145.6913d6c","name":"","property":"payload[2].value","propertyType":"msg","rules":[{"t":"cont","v":"TRAINING","vt":"str"},{"t":"cont","v":"READY","vt":"str"},{"t":"cont","v":"FAIL","vt":"str"},{"t":"null"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":570,"y":2436,"wires":[["1fa35e94.3da939"],["1fa35e94.3da939"],["1fa35e94.3da939"],["1fa35e94.3da939"],["c79feb1d.90f218","cfc356d6.7a50f","e9c59b03.a502c8"]]},{"id":"1fa35e94.3da939","type":"function","z":"223f145.6913d6c","name":"","func":"msg.payload[6].value = \"Down\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":2396,"wires":[["cfc356d6.7a50f","e9c59b03.a502c8"]]},{"id":"cfc356d6.7a50f","type":"rbe","z":"223f145.6913d6c","name":"Stat change","func":"rbei","gap":"","start":"","inout":"out","septopics":true,"property":"payload[6].value","topi":"topic","x":890,"y":2460,"wires":[["45bb15c.ebffbec"]]},{"id":"5cc8ec92.a0acec","type":"comment","z":"223f145.6913d6c","name":"Router Stats (Open for OIDs)","info":"\n1.\n1.\n1.\n1.\n1.\n1.\n\nVigor Routers support MIB-II, ADSL-LINE-MIB, VDSL2-LINE-MIB and customized DrayTek-MIB.\nThe OIDs supported are listed below.\n\nCategory:\n\n    System\n    Interface\n    IP\n    ICMP\n    TCP\n    UDP\n    SNMP\n    ADSL\n    VDSL\n    USB sensor\n    VPN\n    Router Information\n\nSystem\n1.\tsysDescr\n1.\tsysObjectID\n1.\tsysUpTime\n1.\tsysContact\n1.\tsysName\n1.\tsysLocation\n1.\tsysServices\nInterface: WAN, LAN, and WLAN\n1.\tifnumber\n1.\tifTable\n1.\tifEntry\n1.\tifIndex\n1.\tifDescr\n1.\tifType\n1.\tifMtu\n1.\tifSpeed\n1.\tifPhysAddress\n1.\tifAdminStatus\n1.\tifOperStatus\n1.\tifLastChange\n1.\tifInOctets\n1.\tifInUcastPkts\n1.\tifInNUcastPkts\n1.\tifInDiscards\n1.\tifInErrors\n1.\tifInUnknownProtos\n1.\tifOutOctets\n1.\tifOutUcastPkts\n1.\tifOupNUcastPkts\n1.\tifOutDiscards\n1.\tifOutErrors\n1.\tifOutQlen\n1.\tifSpecific\nIP\n1.\tipForwarding\n1.\tipDefaultTTL\n1.\tipInReceives\n1.\tipInHdrErrors\n1.\tipInAddrErrors\n1.\tipForwDatagrams\n1.\tipInknownProtos\n1.\tipInDiscards\n1.\tipInDelivers\n1.\tipOutRequests\n1.\tipOutDiscards\n1.\tipOutNoRoutes\n1.\tipReasmTimeout\n1.\tipReasmReqds\n1.\tipReasmOKs\n1.\tipReasmFails\n1.\tipFragOKs\n1.\tipFragFails\n1.\tipFragCreates\n1.\tipAddrTable\n1.\tipRouteTable\n1.\tipNetToMediaTable\n1.\tipRoutingDiscards\nICMP\n1.\ticmpInMsgs\n1.\ticmpInErrors\n1.\ticmpInDestUnreachs\n1.\ticmpInTimeExcds\n1.\ticmpInParmProbs\n1.\ticmpInSrcQuenchs\n1.\ticmpInRedirects\n1.\ticmpInEchos\n1.\ticmpInEchoReps\n1.\ticmpInTimestamps\n1.\ticmpInTimestampReps\n1.\ticmpInAddrMasks\n1.\ticmpInAddrMaskReps\n1.\ticmpOutMsgs\n1.\ticmpOutErrors\n1.\ticmpOutDestUnreachs\n1.\ticmpOutTimeExcds\n1.\ticmpOutParmProbs\n1.\ticmpOutSrcQuenchs\n1.\ticmpOutRedirects\n1.\ticmpOutEchos\n1.\ticmpOutEchoReps\n1.\ticmpOutTimestamps\n1.\ticmpOutTimestampsReps\n1.\ticmpOutAddrMasks\n1.\ticmpOutAddrMaskReps\nTCP\n1.\ttcpRtoAlgorithm\n1.\ttcpRtoMin\n1.\ttcpRtoMax\n1.\ttcpMaxConn\n1.\ttcpActiveOpens\n1.\ttcpPassiveOpens\n1.\ttcpAttemptFails\n1.\ttcpEstabResets\n1.\ttcpCurrEstab\n1.\ttcpInSegs\n1.\ttcpOutSegs\n1.\ttcpRetransSegs\n1.\ttcpInErrors\n1.\ttcpOutRsts\nUDP\n1.\tudpInDatagrams\n1.\tudpNoPorts\n1.\tudpInErrors\n1.\tudpOutDatagrams\nSNMP\n1.\tsnmpInPkts\n1.\tsnmpOutPkts\n1.\tsnmpInBadVersions\n1.\tsnmpInBadCommunityNames\n1.\tsnmpInBadCommunityUses\n1.\tsnmpInASNParseErrs\n1.\tsnmpInTooBigs\n1.\tsnmpInNoSuchNames\n1.\tsnmpInBadValues\n1.\tsnmpInReadOnlys\n1.\tsnmpInGenErrs\n1.\tsnmpInTotalReqVars\n1.\tsnmpInTotalSetVars\n1.\tsnmpInGetRequests\n1.\tsnmpInGetNexts\n1.\tsnmpInSetRequests\n1.\tsnmpInGetResponses\n1.\tsnmpInTraps\n1.\tsnmpOutTooBigs\n1.\tsnmpOutNoSuchNames\n1.\tsnmpOutBadValues\n1.\tsnmpOutGenErrs\n1.\tsnmpOutGetRequests\n1.\tsnmpOutGetNexts\n1.\tsnmpOutSetRequests\n1.\tsnmpOutGetResponses\n1.\tsnmpOutTraps\n1.\tsnmpEnableAuthenTraps\nADSL\n1.\tadslLineCoding\n1.\tadslLineType\n1.\tadslLineSpecific\n1.\tadslLineConfProfile\n1.\tadslLineAlarmConfProfile\n1.\tadslAtucInvSerialNumber\n1.\tadslAtucInvVendorID\n1.\tadslAtucInvVersionNumber\n1.\tadslAtucCurrSnrMgn\n1.\tadslAtucCurrAtn\n1.\tadslAtucCurrStatus\n1.\tadslAtucCurrOutputPwr\n1.\tadslAtucCurrAttainableRate\n1.\tadslAturInvSerialNumber\n1.\tadslAturInvVendorID\n1.\tadslAturInvVersionNumber\n1.\tadslAturCurrSnrMgn\n1.\tadslAturCurrAtn\n1.\tadslAturCurrStatus\n1.\tadslAturCurrOutputPwr\n1.\tadslAturCurrAttainableRate\n1.\tadslAtucChanInterleaveDelay\n1.\tadslAtucChanCurrTxRate\n1.\tadslAtucChanPrevTxRate\n1.\tadslAtucChanCrcBlockLength\n1.\tadslAturChanInterleaveDelay\n1.\tadslAturChanCurrTxRate\n1.\tadslAturChanPrevTxRate\n1.\tadslAturChanCrcBlockLength\n\nNote: ADSL and VDSL share same OIDs in models 2860 or earlier, firmware version 3.9.0 or earlier.\nVDSL\n1.\txdsl2ChStatusUnit\n1.\txdsl2ChStatusActDataRate\n1.\txdsl2ChStatusPrevDataRate\n1.\txdsl2ChStatusActDelay\n1.\txdsl2ChStatusActInp\n1.\txdsl2ChStatusInpReport\n1.\txdsl2ChStatusNFec\n1.\txdsl2ChStatusRFec\n1.\txdsl2ChStatusLSymb\n1.\txdsl2ChStatusIntlvDepth\n1.\txdsl2ChStatusIntlvBlock\n1.\txdsl2ChStatusLPath\n1.\txdsl2ChStatusAtmStatus\n1.\txdsl2ChStatusPtmStatus\nThe following OIDs are customized DrayTek-MIB:\nUSB sensor\n1.\ttemperValue\n1.\thumiValue\nVPN\nVPN Status\n1.\tconnectedTunnels\n1.\tconnectedTunnelIdx\n1.\tconnectedVPNprofilename\n1.\tconnectedVPNType\n1.\tconnectedVPNClientIP\n1.\tconnectedVPNWanIntface\n1.\tconnectedVPNRemoteSubnet\n1.\tconnectedVPNTXPkts\n1.\tconnectedVPNRXPkts\n1.\tconnectedVPNTXRate\n1.\tconnectedVPNRXRate\n1.\tconnectedVPNUpTime\n1.\tconnectedVPNActionDrop\nLan-to-Lan Profile Status\n1.\tconnectedL2LTunnels\n1.\tlan2LanProfileIdx\n1.\tlan2LanProfilename\n1.\tconnectedVPNType\n1.\tconnectedVPNClientIP\n1.\tconnectedVPNWanIntface\n1.\tconnectedVPNRemoteSubnet\n1.\tconnectedVPNTXPkts\n1.\tconnectedVPNRXPkts\n1.\tconnectedVPNTXRate\n1.\tconnectedVPNRXRate\n1.\tconnectedVPNUpTime\n1.\tconnectedVPNActionDrop\nRemote Dial-in Profile Status\n1.\tconnectedRDinTunnels\n1.\trDinProfileIdx\n1.\trDinProfilename\n1.\tconnectedVPNType\n1.\tconnectedVPNClientIP\n1.\tconnectedVPNWanIntface\n1.\tconnectedVPNRemoteSubnet\n1.\tconnectedVPNTXPkts\n1.\tconnectedVPNRXPkts\n1.\tconnectedVPNTXRate\n1.\tconnectedVPNRXRate\n1.\tconnectedVPNUpTime\n1.\tconnectedVPNActionDrop\nRouter Information\n1.\trouterModel\n1.\trouterRevision\n1.\tfwBuildDate\n1.\tdslVersion\n1.\tcountryCode\n1.\twirelessRegion\n1.\tmemoryUsage\n1.\tlanMac\nNOTE:\n\n    VPN SNMP OIDs are available in models 2862/2926 or later, firmware version 3.9.4 or later.\n    VPN Status OIDs are available only when VPN connection is established.\n    Lan-to-Lan and Remote Dial-in Profile Stautus are only available in models 2962/3910.\n    Download Draytek-MIB tree file here.\n\nPublished On:2016-02-24 \n","x":440,"y":2375,"wires":[]},{"id":"c79feb1d.90f218","type":"ui_text","z":"223f145.6913d6c","group":"962d6eb8.701498","order":1,"width":6,"height":2,"name":"","label":"Router stats","format":"{{msg.V2762}}","layout":"col-center","x":1070,"y":2396,"wires":[]},{"id":"2fb7f44f.092284","type":"cronplus","z":"223f145.6913d6c","name":"Router","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"*/10 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":230,"y":2396,"wires":[["5a89a2d3.5ebadc"]]},{"id":"5a89a2d3.5ebadc","type":"snmp","z":"223f145.6913d6c","host":"","version":"2c","timeout":5,"community":"public","auth":"noAuthNoPriv","oids":",,,,,,\n\n","name":"Router Speeds","x":420,"y":2440,"wires":[["201018e2.cc2678"]]},{"id":"91a78ca770b67330","type":"catch","z":"223f145.6913d6c","name":"","scope":["5a89a2d3.5ebadc"],"uncaught":false,"x":410,"y":2475,"wires":[["eeeac6856c84945a"]]},{"id":"eeeac6856c84945a","type":"debug","z":"223f145.6913d6c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":2575,"wires":[]},{"id":"962d6eb8.701498","type":"ui_group","z":"223f145.6913d6c","name":"Router","tab":"8f66b6dd.6e06b8","order":7,"disp":false,"width":"6","collapse":false},{"id":"8f66b6dd.6e06b8","type":"ui_tab","name":"HMI","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

(Draytek 2762)

Cor lummy. That is a flow and a half! I've spent the day at the remote location and here are my findings. The /etc/dhcpcd.conf was not corrupt, but still when I reverted to the Vigor router it would not work. So I deleted the lines in /etc/dhcpcd.conf that I had added and rebooted both the router and the Pi. Now everything is back to normal. The Vigor router is setting the Static ip address.
So now I can worry about what is causing the router to fall over. I need to do a more systematic check on what is working and what is not. Up until now I've just opted to get things going again. I have 7 WiFi devices associated with Node-Red. I also have hardwired CCTV and some Meross smart plugs. Next time it goes down I will check if the Ethernet devices work, the Meross ( which of course are independent of the Pi ) and finally the WiFi modules linked to the Pi. Some serious investigation to be done.
Next time I go over I'll have another look.
I'm a bit reluctant to add the node you sent just yet, but it may come in handy later.
Thanks again for your assistance.


Don't forget to check the voltage to the Router, and also to the Pi. RPi's are known to not like undervoltages. Just make sure the Power Supply is rated high enough.

The flow uses the OIDs used in my Draytek, which I am pretty sure is universal for all Drayteks. Some light reading for you. Draytek also have a page related to SNMP, but when I checked, they are almost correct, except they need an extra digit. Found this by 'walking through' the OIDs using a program that can check.

Good luck with your fault finding.

Thank you so much for your help. The logical thing to do is to identify what is going on with the router.

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