Running the script at startup FAILED
Options
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
- 63 Announcements & News
- 48 Product News - New Product/Product Change Notice/ End-of-life
- 96 Welcome Developers!
- 45 Unboxing & Project Sharing
- 22 Tech Updates
- 3.4K UP Products
- 15 UP 7000
- 1 UP Squared i12
- 11 UP Xtreme i12
- 13 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 23 UP Squared V2
- 65 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 56 UP Squared Pro
- 136 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 264 Starter Kits & Peripheral