node-red-contrib-flic-buttons icon indicating copy to clipboard operation
node-red-contrib-flic-buttons copied to clipboard

Node does not reconnect to flicd

Open hardillb opened this issue 7 years ago • 9 comments

If flicd crashes the node does not attempt to reconnect to it once it's been restarted.

@Roaders any reason for this? It means that you have to restart Node-RED if there is an issue which is a pain as if I set up flicd to auto restart I have no way to know I have to kick Node-RED (which I shouldn't need to do really)

hardillb avatar Apr 14 '17 13:04 hardillb

No particular reason. I am not sure that flicd has ever crashed for me. I did get into a few situations where I had to power up my 2 pis in the right order as one pi connected to daemons on both pis. I was considering implementing a retry feature for this which would probably solve both issues.

Roaders avatar Apr 14 '17 13:04 Roaders

flicd has crashed twice on me now in the space of a couple of hours so sounds like it would be useful

hardillb avatar Apr 14 '17 13:04 hardillb

So what do you think? Try to connect to the daemon every 60 seconds or something?

Roaders avatar Apr 14 '17 14:04 Roaders

60 seconds is as good as anything.

I think I've just found when you last looked at this https://github.com/50ButtonsEach/fliclib-linux-hci/issues/19 as I'm about to raise a bug about flicd crashing all the time

hardillb avatar Apr 14 '17 15:04 hardillb

For anyone interested in a fix for this, see my fork: https://github.com/hufftheweevil/node-red-contrib-flic-buttons

I've modified the underlying library a bit to ensure the client stays connected to the server after the server restarts. Additionally, all connection channels are kept in tact to ensure events continue without having to restart the nodes.

I also added a feature that allows for more than one event to output on a particular node, if you so choose.

hufftheweevil avatar Jul 12 '20 19:07 hufftheweevil

Since neither myself or @Roaders use this node any more (I just don't use the flic's and Roaders is using the Flic hub hardware) would you be interested in taking it over? I can close this repo and add you to the npm package?

hardillb avatar Jul 12 '20 19:07 hardillb

Sure, no problem!

hufftheweevil avatar Jul 12 '20 20:07 hufftheweevil

OK, let me know what your npm username and I'll sort it out tomorrow evening.

hardillb avatar Jul 12 '20 20:07 hardillb

My npm username is jhalbsgut

hufftheweevil avatar Jul 12 '20 22:07 hufftheweevil