Raspberry pi button does not work on reboot
I love the SDK! It is working well with my raspberry pi zero, however I have one problem. I can pair a button, but when I reboot, I have to manually repair the button. I have started flicd with -v -d and that is running OK. Since I'm running the raspberry pi headless, is difficult to pair the button manually each time the system reboots. Any suggestions are appreciated.
laurence.schenk last edited by
I have figured it out. When I started flicd through /etc/rc.local it was running as root with no environmental variables, and the data of the buttons was stored in the root directory. When I ran the exact same command as user pi, the environmental variables were set, PATH, USER etc. The fix was simple: use full path names for the data base file.
My apologies for wasting your time when the error was mine.
@schenkl Where did you read about the -v option? There is no such thing. See the official readme at https://github.com/50ButtonsEach/fliclib-linux-hci/blob/master/README.md#usage-of-flicd. You could also give an absolute path for the db file to avoid it ending up at a wrong place.
I start flicd with /etc/rc.local command
"/home/pi/flic/fliclib-linux-hci/bin/armv6l/flicd -f sqlite_db_file.db -v -d"
I use the -v flag as i had read that keeps the buttons registered. But for some reason, flicd is not running after boot. If I manually run "sudo /etc/rc.local" I see an error,
"invalid option -- 'v'". flicd is running ok, but no buttons show up. I can re-register them with simpleclient, but I need to re-register them every time I boot. So maybe I am erasing the sqlite_db_file.db file? How do I make sure that I save it?
Thanks for your help!
@schenkl I still don't follow. Flicd never initiates connections if you don't ask it to. You need to create a connection channel for a specific button in order to connect to it. Do you do this?
Update: after further testing, the issue is that if flicd is restarted then it does not connect with the button; but with a boot then flicd works as expected.....
sorry for the incorrect information...
Do you erase the database file on every reboot?
How have you written your code? Do you extract the paired buttons when you connect to the flicd?
Some more info would be good.