(RPI3 NodeJS) Project Disconnected

I am using Blynk with Node.js,and after internet outage i found this error…
Hardware is raspi 3 model b,ethernet connection…
events.js:165
throw err;
^

Error: Uncaught, unspecified “error” event. (ENETUNREACH)
at Blynk.emit (events.js:163:17)
at Blynk.error (/usr/lib/node_modules/blynk-library/blynk.js:590:8)
at . (/usr/lib/node_modules/blynk-library/blynk.js:553:48)
at emitOne (events.js:96:13)
at emit (events.js:188:7)
at TLSSocket. (/usr/lib/node_modules/blynk-library/blynk-node.js:223:16)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at emitErrorNT (net.js:1281:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

How to solve this?

Put in some form of error trap (this is a Linux / Javascript issue not a Blynk issue… Google it) so that in event of ethernet error, if doesn’t crash.

Can you tell me more about what to google exacly,i have no idea :confused:

Thanks for help,but i have no idea what to do :slight_smile:

ENET sounds like an Ethernet error. Is your Pi connected to Wifi or Cable?

@Lichtsignaal it is a relatively simple error trapping, reconnection case.

I say relatively as I do not have a drop in command to offer… just trying to get the OP to look up the concept of error trapping themselves.

Or even searching this forum themselves… :stuck_out_tongue_winking_eye:

1 Like

I Know this is not Blynk isue,but i cannot use blynk because of this Sh…!
My linux knowledge and java scripting is Zero,and i can only watch this…

@Lichtsignaal Pi is connected with Cable…

If you run a ping 8.8.8.8

Does it continue running or does it give time outs?

Ping work perfect…But when there is internet outage then this is hapening.
After that i must ssh to Pi and run Blynk again…

If your power goes out, you can’t use it either… do we troubleshoot your power bill payments :stuck_out_tongue_winking_eye:

There is NO “Blynk” answer… do some research as directed and look at your options… Reboot the RPi if after internet disconnection, timed automatic script restarting, error trapping controlling other options, etc.

That is weird because Blynk will keep running on the Pi. If there is a loss of connection it’s 99% sure something else.

When the Internet outage occurs, can you still connect from your local LAN to the Pi with the Blynk app and or hardware? It seems very unlogical it stops functioning.

The disconnection issue is not Blynk related (as in caused by Blynk) and the Blynk NodeJS script will stop, due lack of connection… as discussed in that other topic I referenced above (without proper error trapping… and probably a few other things).

This OP’s issue is restarting Blynk after re-connection… that could be as simple as, well restarting the script :stuck_out_tongue: and so many ways differing of doing that… you probably know them better then I do :wink:

I think part of the other topics discussion was somehow preventing the Blynk NodeJS script from stopping… thus Blynk re-connection would be automatic upon Ethernet re-connection… much like how we do it with C++ but I don’t recall if the Blynk JS library had all the requisite connection management support?

@Lichtsignaal I can SSH to Rpi all the time,Rpi have 100% uptime…
@Gunner If is that simple to restart blynk after reconect,I would be grateful if you told me how to do it?

Wait… I thought the whole topic was due to you losing Ethernet connection… that is hardly 100% up-time :wink:

I have implemented simple error trapping that prevents a quick disconnect/reconnect from crashing my script (see other topic) but I haven’t bothered about auto restarts, etc… not critical in my case as up-time IS 99.9%

If I had a drop in solution, I would have offered it… but I don’t, that is why I made some quick checks and recommended you do the full research … I mean, why would I take my time away from my projects to do it all for you? Had you shown more initiative, I would have as well… but when confronted with nothing but “help mes” and no visible self-effort, I tend to hold back :stuck_out_tongue_winking_eye:

Keep searching this site… there are other topics about this…

And I recall similar references about keeping a Blynk server running, or at least restarting it if it shuts down… the principle should be the same for JS Client.

I read two days about this,I do not know how you figured I did not have an initiative
I already say i am linux noob,i know basic things and you telling me to do javascripting? :slight_smile:
Thanks anyway for your help,and please do not waste more time on this problem,i beet you have a loot project to do…

Yeah, but you’d have to make sure to keep the script running and do error checking/reconnecting to the local Blynk server in the script I think.

Maybe I\ll try and come up with a solution for NodeJS (or JS in general) but at the moment I’m lacking in time (too much hobbies…).

well…

No code, no clarification of efforts tried, no… nothing… :thinking:


In fact I do… on MY RPi3 with Blynk and NodeJS… I am also a total Linux and JS noob… barely out of the gate. That is one of the reasons I have stuck around this topic as long as I have (well that and the whole moderating of non-Blynk related issues on a Blynk forum :wink: )