RGB1602 not starting if I move script

userHead Barra 2023-01-25 21:28:55 56 Views1 Replies



Am new to Raspberrys and Linux and have just got an RGB1602 to go with it.


I have written a python script based on Button.py.  I want this script to run everytime the system reboots so have given Anyone access to execute then script.  I have changed the script line 2 from sys.path.append('../') to sys.path.append("/home/<username>/DFRobot_RGB1602_RaspberryPi/DFRobot_RGBLCD/python").


The following line has been added to /etc/rc.local:

python3 home/<username>/DFRobot_RGB1602_RaspberryPi/DFRobot_RGBLCD/python/script.py &.  This script does what it should.


However, if I move the script to /home/<username>/Documents/script.py, changing the path in /etc/rc.local and keeping the amended sys.path.append  nothing happens to the RGB1602.  How can I find out what is wrong?


2023-01-30 14:23:55

Hi barra

It seems that you have trouble with sys.path.append(), you could check this method on python on the internet.

I guess it is because you didn't include the script after you moved its location, or you didn't include the library field in /DFRobot_RGB1602_RaspberryPi/


Hope it can help you.


userHeadPic Tonny12138