I was having problems with consistent connections of the Bluetooth controller, and found that despite configuring calibration settings at boot time, they were lost if the device wasn't already connected. I ended up writing a script that could be run periodically using a cron job that would attempt to connect the joystick if it wasn't already, and then calibrate it if it wasn't already.
Here's the complete code: https://gist.github.com/DaneGardner/a3ff6124e1ffaac34a6823b3d5235a26
Save that file to your home directory on the Raspberry Pi, and ensure that it's executable. Then add a cron job that runs every minute using `crontab -e` at the command line:
* * * * * ~/joystick-connect.sh
Now, if your joystick isn't on and ready to connect when you start your telescope, it will take a maximum of one minute before it's discovered, connected, and configured once you do turn it on!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.