Would anyone happen to know how binding Bluetooth upon start up? Tried including the commands (bind, chown) in rc.local, but that does not work, just via terminal commands.
Or should I save script as a program and invoke via launcher?
I just got around to reassembling my BT adapter. Curious things happened. Initially I had difficulty connecting, it turned out to be bluetooth manager taking taking ownership of the device. You can check for this
sudo fuser /dev/rfcomm0
Take the ID number
ps -p ####
This will tell you what is using the /dev/rfcomm0. And is behind the failure to connect to port errors.
So this trick is to manually bind the device, but not connect to it. It appears to connect automatically when the mount driver is initiated.
At this stage I was making a connection, but it randomly would disconnect giving a TTY read write error when a command was given. I tried some of the other advice given, and that stopped happening, but now all inputs I give trigger a yellow light in the INDI console and does nothing.
Oddly enough one time it behaved itself. But failed after a simple restart of the INDI server.
I just did a fresh install of Astroberry Server, and I've found that Bluetooth works without a hitch when manually bound. But something later broke it after updating the system.
After performing a normal update, EQMod continues to work with my HC-05 bluetooth mount interface.
It is something applied during a dist-upgrade which introduced connection issues. It has to be related to one of these upgrades.
If I had to choose, I would place blame on modemmanager. As I have come across that mentioned elsewhere in relation to bluetooth issues.
OK. Upgraded Modemmanager is definitely involved. Although I do not have a full understanding as to its purpose, I decided to remove the program in its entirety. After rebooting, EQMod was once again communicating with the mount through Bluetooth.
With a little sleuthing I found this. Modemmanager appears to send "AT-GCAP" data and put it in an unstable state. There are a few work arounds provided. I might try the udev rules exception method described in the thread. ubuntuforums.org/showthread.php?t=2056285
So another thing i discovered over the last few days. Im running Ubuntu Mate 16.04LTS on a Rpi3 with indiserver. I have all my equipment attached to this. My mount and focuser are connected via BT. To automatically bind the two devices on start up all i did was add the following above the exit 0 line in /etc/rc.local
sleep 20s ### you need to allow some time for the RPi3 to do its boot up thing before it will bind the BT devices. I have tried without this line and it doesn't work.
rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 ### bind rfcomm0 with mac address XX:XX:XX:XX:XX:XX on channel 1
rfcomm bind 1 YY:YY:YY:YY:YY:YY 1 ### bind rfcomm1 with mac address YY:YY:YY:YY:YY:YY on channel 1
exist 0
NOTE, you dont need the text beyond the ### above, i have just put that there with explanations. The hci part is NOT needed. It wont auto bind if you refer to hci0 after the bind command. Don't ask me why, cause i have no idea.
I hope this helps.
Last edit: 6 years 1 month ago by Petar Milevski. Reason: fix spelling