50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
306 stars 54 forks source link

Flicd service exits after few hours - Received signal 15 #95

Closed FransTwisk closed 4 years ago

FransTwisk commented 4 years ago

I have flicd running as a service on my Raspberry Pi2 using an external bluetooth dongle (Asus USB-BT400) and setup and configuration went smoothly. Using simpleclient I was able to register a brand new flic 2 button and events are catched by my Home Assistant instance (running on another machine).

However, after a few hours (usually at night, even when nothing is happening) the flicd service stops. My button is not connected anymore the next day and blinks a red light twice when pressing it. If I restart the service and restart Home Assistant everything works again.

Here’s the output of the log:

Available HCI devices found:
hci0

Trying hci0
Flic server is now up and running!
Successfully bound HCI socket
Initialization of Bluetooth controller done!
Received signal 15
Exited

And systemd service (which shows flicd started 2 seconds before it crashed but it was actually running for a few hours).

root@pi:/home/pi# systemctl status flicd
● flicd.service - flicd Service
   Loaded: loaded (/usr/local/bin/flicd.service; enabled)
   Active: inactive (dead) since Mon 2020-01-20 21:57:40 UTC; 32min ago
 Main PID: 820 (code=exited, status=0/SUCCESS)

Jan 20 21:57:38 retropie systemd[1]: Started flicd Service.
Jan 20 21:57:40 retropie systemd[1]: Stopping flicd Service…
Jan 20 21:57:40 retropie systemd[1]: Stopped flicd Service.

Unfortunately no reason for the exiting is given. Any way we can get more verbose logging or an idea what the problem is? It seems to be similair to this issue https://github.com/50ButtonsEach/fliclib-linux-hci/issues/43 meaning it might just be the Asus BT400 being unstable?

Emill commented 4 years ago

Signal 15 (SIGTERM) means the application is exited from an external source that kills the application (by systemd?). Please try to run the application separately in a bash terminal window or something.

FransTwisk commented 4 years ago

Sorry I had no idea. That probably means that there is something wrong with my configuration or pi itself. I will investigate further.