rpi_ws281x library

Post test messages here

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

rpi_ws281x library

Post by jstott »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: rpi_ws281x library

Post by adafruit_support_rick »

What is your current working directory when you try to run strandtest.py? Is it the same directory that contains strandtest.py?

User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

Re: rpi_ws281x library

Post by jstott »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: rpi_ws281x library

Post by adafruit_support_rick »

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.

User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

Re: rpi_ws281x library

Post by jstott »

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

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: rpi_ws281x library

Post by adafruit_support_mike »

The command 'ls' is lowercase-L lowercase-S, not uppercase-i lowercase-S.

It's a contraction of 'LiSt'.

User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

Re: rpi_ws281x library

Post by jstott »

Ok so the 'ls' command shows 'Desktop python_games rpi_ws281x'

Regards,

JS

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: rpi_ws281x library

Post by adafruit_support_rick »

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.

User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

Re: rpi_ws281x library

Post by jstott »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: rpi_ws281x library

Post by adafruit_support_rick »

You're welcome!

User avatar
jstott
 
Posts: 6
Joined: Mon Mar 16, 2015 3:36 pm

Re: rpi_ws281x library

Post by jstott »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: rpi_ws281x library

Post by adafruit_support_rick »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Test Message Forum (closed)”