50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
306 stars 53 forks source link

start flicd as a deamon on rasberry pi #39

Open dfinteraction opened 8 years ago

dfinteraction commented 8 years ago

Could you please explain how to install flicd on rasberry pi ,I am very new on Rasberry pi.So could you please explain it

pfink commented 8 years ago

You can directly checkout this repository with git to a location of your choice (e.g. under /opt). Git can be installed with apt-get install git. You can directly disable bluez and run flicd

service bluetooth stop
git clone https://github.com/50ButtonsEach/fliclib-linux-hci.git
cd fliclib-linux-hci/bin/armv6l
./flicd -f flic.sqlite3

If you want to run flicd as a system daemon, I recommend this introduction into systemd.

If this explanation is not helping you, this is probably because of a lack of knowledge about Linux and the Raspberry Pi in general. In this case, I think this site is not the right starting point for you. There are many very good Raspberry Pi and Linux tutorials out there you should start with before trying out a BETA library.

Purpose of this site is to describe issues regarding flicd, not to explain how the Raspberry Pi or Linux works. Before figuring out these basics, you'll probably not be able to realize something useful with flicd anyway, even if you have a step-by-step instruction how to install it.

If you're aware of the basics and look for support realizing your concrete project with the Flic buttons, you might be more lucky here: https://community.flic.io/category/8/developers

guussie commented 7 years ago

pfink, I'm so happy you understand all this and in principle you are right, one should start at the beginning.

But then there is the problem that flic is very limited in its functionality and that this can be greatly improved if one doesn't have to have ones phone next to ones flic button all the time.

So we, mere mortals, having been duped into acquiring a "smooth" button with limited functionality, venture into this hub with the hope to improve our value for money.

Your links are very helpful jumping some queues but it doesn't quite get us right where we want to be. Neither do we want to go through learning the basics of several programming languages, even if we do understand the basics of computer programming. We are just looking for a bit more support from flic or advise from fellow searchers to help us wean off he phone....

I've tried the Python scripts but I immediately run into questions like "2.9 or 3.4", but I don't really care, I just want it to work (yes, I do use an indestructible Mac as my main companion). And by the way, neither 2.9 nor 3.4 work with the scripts provided, unless I am missing something.

But it would be great and much appreciated if you could get us back on track, with some more detailed examples, for instance on how to control other devices with an name and an IP address in our network, because that's why we venture into these dark corners.

Many thanks!

pfink commented 7 years ago

I think the forum would may be a better place to discuss those things, as it's more a general request to Shortcat Labs than a real "issue" on this library (okay, lack of documentation is in fact an issue, but then it would be good to describe what is missing more in detail and create seperate issues for that stuff).

Nevertheless, if you're looking for a solution that does not require too much skills and your use case is just that you don't always have to have your smartphone in the near, why using a Raspberry Pi? Easiest and least-effort solution for that requirements would currently be to buy an extra low-cost stationary smartphone or any other low energy Android device with BT 4.0 support. Unfortunately, I did not work with the Python clientlib, so I can't provide examples for that (and this issue is really not the right place to discuss that because it's about how to install and run flicd as a service and nothing else).

Back to the original question of this issue, I currently use this very simple systemd service file to run flic as a service which have to be stored in /etc/systemd/system on a Raspbian system.

[Unit]
Description=flicd Service

[Service]
ExecStart=/opt/fliclib-linux-hci/bin/armv6l/flicd -f /opt/fliclib-linux-hci/bin/armv6l/flic.sqlite3 -s 0.0.0.0
EnvironmentFile=-/etc/default/flicd
Type=simple

[Install]
WantedBy=multi-user.target
fabianbergmark commented 7 years ago

@guussie I'm sorry to hear that you find the Flic app (iOS or Android?) has limited use for you. If you use a mac I would recommend you to look at https://github.com/50ButtonsEach/hax-with-flic-osx However, this library is ment for developers that want to make their own integrations, not a supplement to the Smartphone apps. We can unfortunately not provide detailed examples of how to control other network devices, as this is asking us to do your custom integration for you. We have our own code for controlling devices from iOS and Android, not Python. If there is any integration you wish that we implement, please post at http://ideas.flic.io and we will try to implement it.

Cheers, Fabian from Shortcut Labs

joachimpr commented 6 years ago

Check out this article. it explains the daemon setup quite nicely: https://ethitter.com/2016/12/flic-buttons-and-home-assistant/

Not sure why he is using daemon.db instead of sqllite. guess I'll have to try it our myself and see...

ristomatti commented 6 years ago

@joachimpr, daemon.db is just the file name he decided to give. It'll be an sqlite database regardless.