Raspberry Pi – Starting Code at Boot time How to run scripts when you boot up your Pi Pete Januarius Sept 2018
Option 1 - Edit rc.local There are several ways to run code/scripts/programs after booting up. Checkout this link which describes how to run commands at boot using the rc.local file: https://www.raspberrypi.org/documentation/linux/usage/rc-local.md
Running Terminal on boot To run the terminal application after booting the Raspberry Pi, add @lxterminal to the autostart file in /home/pi/.config/lxsession/LXDE-pi
Add commands to .bashrc Adding commands to the .bashrc file will run these commands in the terminal that you have already launched. This could work for you but also could be a bit annoying because these will run every time you launch a bash shell (terminal). Edit the .bashrc file with the nano editor
Add commands to .bashrc Start bluetooth Start listening for bluetooth comms Setup motor drive code
Run commands from .bashrc setup_bluetooth.sh Connect to bluetooth device setup_motors.sh Run Python program to setup motors