I am relatively new to programming and am attempting to run a program from boot using a cron job on a Raspberry pi 2. So I went into the terminal and accessed the cron tab, I then entered
@reboot python /home/pi/Project/Bluetooth.py (I know that's the right address, I have checked several times). The Python code I am trying to run in the beginning is:
import os import subprocess print "Hello World" os.system('echo "hello world"') os.system('/usr/bin./galculator') target = open('test.txt', 'w') target.write("Why doesn't this work") target.close()
I am simply trying to write some type of code to see if the cron is working and I test the code below in the terminal and everything works (prints hello world twice, opens up calculator, and then creates the text file). But it doesn't do anything on boot.
I tried every thing I could think of by printing to opening up processes. I am running Raspbian that i installed my self and everything else is working ok. I can't really start working on this project until I know it will run at boot. Does anyone have any suggestions?