When the program is initially booted from the systemctl service it appears that the Bluetooth does not have enough power at this point to be able to change the scan mode to be searchable, which allows other devices to discover the BeagleBone. This causes the program to not enable Bluetooth and ultimately fail. Interestingly the Bluetooth will later have enough power to change the scan mode as someone can SSH into the BeagleBone and execute the program, allowing the system work properly, including receiving Bluetooth connections.
Possible solutions include:
Use a boot system other then Systemd / systemctl
This may be the cleanest solution if there is a good alternative, but requires some research.
Have the Bluetooth initialization continuously try to set the scan mode until it succeeds (or for a given number of attempt). This should have a short delay between each attempt.
This is probably the best code solution, but we will have to be careful that Bluetooth is only initialized once.
Have the system sleep for a given amount of time after booting to allow for Bluetooth to get enough power to work properly.
This is the easiest to implement, but would likely not work all the time, and could result in a long boot time.
When the program is initially booted from the systemctl service it appears that the Bluetooth does not have enough power at this point to be able to change the scan mode to be searchable, which allows other devices to discover the BeagleBone. This causes the program to not enable Bluetooth and ultimately fail. Interestingly the Bluetooth will later have enough power to change the scan mode as someone can SSH into the BeagleBone and execute the program, allowing the system work properly, including receiving Bluetooth connections.
Possible solutions include:
This may be a duplicate of issue #6