hardillb / node-red-contrib-flic-buttons

17 stars 9 forks source link

Node does not reconnect to flicd #8

Open hardillb opened 7 years ago

hardillb commented 7 years ago

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)

Roaders commented 7 years ago

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.

hardillb commented 7 years ago

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

Roaders commented 7 years ago

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

hardillb commented 7 years ago

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

hufftheweevil commented 4 years ago

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.

hardillb commented 4 years ago

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?

hufftheweevil commented 4 years ago

Sure, no problem!

hardillb commented 4 years ago

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

hufftheweevil commented 4 years ago

My npm username is jhalbsgut