Hi guys,
I am following a tutorial on 'how to control neopixel leds with python on a raspberry pi' the link is as follows: https://learn.adafruit.com/neopixels-on ... i/software
I am having trouble executing a test file in the LX Terminal on the Raspberry Pi. The test file is 'strandtest.py' which I have edited using the text editor programme so that the LED_COUNT is correct as per my design which consists of a total of 30 NeoPixel LEDs. When I come to run the programme in the LX Terminal window, I encounter a problem which states: 'python: can't open file 'strandtest.py': [Errno 2] No such file or directory', even though the file does exist!
Please could somebody tell me where I am going wrong. I am completely new to the Raspberry Pi and this is my very first project!
Kind Regards,
JS
rpi_ws281x library
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: rpi_ws281x library
What is your current working directory when you try to run strandtest.py? Is it the same directory that contains strandtest.py?
- jstott
- Posts: 6
- Joined: Mon Mar 16, 2015 3:36 pm
Re: rpi_ws281x library
Thank you for your response!
From what you are saying I think the directory is Python? The full command is actually 'sudo python strandtest.py' and I enter this command in the LX Terminal window. I am doing exactly what the tutorial describes but I am getting the error message!
Regards,
JS
From what you are saying I think the directory is Python? The full command is actually 'sudo python strandtest.py' and I enter this command in the LX Terminal window. I am doing exactly what the tutorial describes but I am getting the error message!
Regards,
JS
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: rpi_ws281x library
No, the directory is not "python". That is the actual command in the command line.
Do this command:
pwd
That will print your working directory.
You can also do
ls
to see if strandtest.py is in your current working directory.
Do this command:
pwd
That will print your working directory.
You can also do
ls
to see if strandtest.py is in your current working directory.
- jstott
- Posts: 6
- Joined: Mon Mar 16, 2015 3:36 pm
Re: rpi_ws281x library
I typed 'pwd' into the LX Terminal and it returned: /home/pi
I typed 'Is' into the LX Terminal and it says: bash: Is: Command not found
regards,
JS
I typed 'Is' into the LX Terminal and it says: bash: Is: Command not found
regards,
JS
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: rpi_ws281x library
The command 'ls' is lowercase-L lowercase-S, not uppercase-i lowercase-S.
It's a contraction of 'LiSt'.
It's a contraction of 'LiSt'.
- jstott
- Posts: 6
- Joined: Mon Mar 16, 2015 3:36 pm
Re: rpi_ws281x library
Ok so the 'ls' command shows 'Desktop python_games rpi_ws281x'
Regards,
JS
Regards,
JS
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: rpi_ws281x library
OK so you need to get into the same directory that contains strandtest.py.
What directory did you put strandtest.py into? Use the cd command to change your working directory to that directory.
What directory did you put strandtest.py into? Use the cd command to change your working directory to that directory.
- jstott
- Posts: 6
- Joined: Mon Mar 16, 2015 3:36 pm
Re: rpi_ws281x library
I have done it now! I managed to run the strandtest.py script by finding the folder that it was located in and using the 'cd' command to run it!
Thanks for your help!
Kind Regards
JS
Thanks for your help!
Kind Regards
JS
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: rpi_ws281x library
You're welcome!
- jstott
- Posts: 6
- Joined: Mon Mar 16, 2015 3:36 pm
Re: rpi_ws281x library
Do you have any advice on how to run this script over the internet? i.e. so that it can be accessed via a mobile phone?
Regards,
JS
Regards,
JS
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: rpi_ws281x library
You would need to run ssh on your mobile phone, and connect to your Pi that way.
https://learn.adafruit.com/adafruits-ra ... -using-ssh
https://learn.adafruit.com/adafruits-ra ... -using-ssh
Please be positive and constructive with your questions and comments.