Arduino 101not working when not connected to the computer

Hello,
I have an Arduino 101 with an Adafruit Motor Shield on top of it. I am running a program which sends sensor data over Bluetooth to the Adafruit Bluefruit app. All of that works perfectly when connected to the computer over USB, but when I run it autonomously on batteries the program either won't connect or doesn't send any data. I have heard of other people in similar situations using a common ground, however I believe since everything is either connected in a shield or on board, it is fine. If you need any clarification, just ask.
Thank you so much for any help.

Post your code!