Running the script at startup FAILED

bruce
New Member Posts: 15
I have a script which includes the operations of GPIOs, Sensors, USB flash drive.
The script runs perfectly when I execute it using the terminal. Now I want to launch the script at start up because I want to use the system as a portable device.
so, I wrote a test script to check whether it is working or not (on startup).
I specify the path in
So, next time I changed the path to the script which includes the operations of sensors/USB/gpios
But it is not working anymore, the same code runs using the terminal but not while start up. Please helep
The script runs perfectly when I execute it using the terminal. Now I want to launch the script at start up because I want to use the system as a portable device.
so, I wrote a test script to check whether it is working or not (on startup).
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(3,GPIO.OUT) GPIO.setup(4,GPIO.OUT) GPIO.setup(27,GPIO.OUT) GPIO.setup(17,GPIO.IN) while True: input_value = GPIO.input(17) GPIO.output(27,GPIO.HIGH) if input_value == False: GPIO.output(27,GPIO.LOW) GPIO.output(3,GPIO.HIGH) time.sleep(5) GPIO.output(3,GPIO.LOW) GPIO.output(4,GPIO.HIGH) time.sleep(5) GPIO.output(4,GPIO.LOW) while input_value == False: input_value = GPIO.input(17)
I specify the path in
/etc/rc.localto launch this simple code at start up
sudo python /home/myUPboard/myProject/test.py exit 0
So, next time I changed the path to the script which includes the operations of sensors/USB/gpios
But it is not working anymore, the same code runs using the terminal but not while start up. Please helep
Categories
- All Categories
- 105 Announcements & News
- 55 Product News - New Product/Product Change Notice/ End-of-life
- 186 Welcome Developers!
- 55 Unboxing & Project Sharing
- 50 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral