When I ran sudo apt install --upgrade python3-setuptools I got:
python3-setuptools is already the newest version (33.1.1-1)
python3-setuptools set to manually installed
0 upgraded, 0 newly installed, 0 to remove and 482 not upgraded
Then when I ran sudo python3 raspi-blinka.py I got:
python3: can’t open file ‘raspi-blinka.py’; [Errno 2] No such file or directory
Obviously the next two commands didn’t work from there. Thank you for any other suggestions!
locate raspi-blinka.py gives me:
bash: locate: command not found
When I try to run:
sudo apt-get update
or
sudo apt-get upgrade
I get a bunch of lines stating “temporary failure resolving archive.raspberrypi.org” I imagine this is the root of these issues. I am using my phones hotspot since the school’s WiFi I use tends to block a lot of downloads. Should I reimage the SD card? I appreciate all of the help and the patience!
Sounds like you’re just in your home directory (ls probably would have listed Desktop, Downloads, Music, Documents, Video, etc.), we need to work out where raspi-blinka.py was downloaded in order to run it from a terminal. How did you download it originally?
Yes, that’s usually due to the Pi not having a network connection. It is called resolving as your operating system (well an application within the OS) is trying to ask DNS servers on the network what IP address it should use for archive.raspberrypi.org in order to check for updates. i.e. what the URL should resolve to (for me, it resolves to 176.126.240.167 although it may be different for you based on region, etc.).
archive.raspberrypi.org definitely exists, I’d double check you’ve got an internet connection for your Pi.
Since you didn’t have the package with the locate tool installed, you can instead use this command to try and locate the raspi-blinka.py file:
find . -name "raspi-blinka.py" -print 2>/dev/null
The 2>/dev/null at the end will just filter out any Permission Denied errors from the output to tidy it up. You can run it without that if you’re curious.
Made some progress today! Here are some things I had to do first:
Simple one. My time zones were not correct which was affecting my ability to access the internet.
I had to update my source.list entry by using:
sudo nano /etc/apt/sources.list
and replaced the top line with:
deb Index of /raspbian/ stretch main contrib non-free rpi
This allowed me to successfully run:
sudo apt update
sudo apt full-upgrade
From there I ran:
sudo apt install --upgrade python3-setuptools
All of that ran successfully, but I ran into an issue when I ran:
sudo python3 raspi-blinka.py
Here’s what I get:
File “raspi-blinka.py”, line 94
shell.run_command(f"{pip_command} RPi.GPIO", run_as_user=username)
^
SyntaxError: invalid syntax
Any suggestions on fixing that?
Also when I ran the find . -name “raspi-blinka.py” -print code it came back with:
./raspi-blinka.py
Fantastic, seems we’re nearly there now. This is an error within the raspi-blinka script itself. That find command you ran returning ./raspi-blinka.py means that it is in the same directory as your working directory (i.e. . that you specified in the command).
I’d reckon you’re missing some required packages or permissions, which would be why shell isn’t being recognised by your python interpreter. Possibly because you need to activate a Python virtual environment or run the code with a certain usergroup available such as sudoers.
Can you please link to the code you’re using? It’s interesting that the function call is shell.run_command( usually the os or subprocess modules are the preferred way to execute a process within a python script.
No matter which method I try, I seem to be getting errors (syntax or other wise). Would you be able to let me know what packages or permissions I would need to add/modify?
I assume I’m not to change the code in raspi-blinka.py. I’m not sure how to proceed from here. Many thanks if you are able to help some more!
Sanity check time. I know it might be obvious but I can’t see the question asked anywhere else - are you running at least the Bullseye version OS or later?
Thank you for the sanity check…I was running Stretch… Instead of updating to Bullseye, I am going to grab a new SD card and start from scratch with Bookworm. With Bookworm, I should be able to just run these lines to get up and running correct?:
Hi! Excellent guide. I tried on rpi4 with no issues at all. Just tried it on rpi5 and got this when trying to run the one strip script:
Traceback (most recent call last):
File “/home/robot/ledstrip/OneStripNeopixel.py”, line 16, in
pixels1.fill((255, 255, 255))
File “/usr/local/lib/python3.11/dist-packages/adafruit_pixelbuf.py”, line 216, in fill
self.show()
File “/usr/local/lib/python3.11/dist-packages/adafruit_pixelbuf.py”, line 204, in show
return self._transmit(self._post_brightness_buffer)
File “/usr/local/lib/python3.11/dist-packages/neopixel.py”, line 180, in _transmit
neopixel_write(self.pin, buffer)
File “/usr/local/lib/python3.11/dist-packages/neopixel_write.py”, line 42, in neopixel_write
return _neopixel.neopixel_write(gpio, buf)
File “/usr/local/lib/python3.11/dist-packages/adafruit_blinka/microcontroller/bcm283x/neopixel.py”, line 66, in neopixel_write
ws.ws2811_channel_t_gpionum_set(channel, gpio._pin.id)
TypeError: in method ‘ws2811_channel_t_gpionum_set’, argument 2 of type ‘int’
The error message you’re seeing indicates that the package management tool “apt” used in Linux distributions cannot locate the packages rpi_ws281x and python3-adafruit-circuitpython-neopixel.
Here are a few potential reasons and solutions:
The packages might not be available in the repositories that are currently in your sources list. To resolve this, you can try to add the relevant repositories to your list and then update the list.
These specific packages might not be available via apt. They should be installed via pip, Python’s package installer, as they are Python libraries. Ensure pip is installed (you can install it via sudo apt-get install python3-pip), and then try:
sudo pip3 install rpi_ws281x
sudo pip3 install adafruit-circuitpython-neopixel
sudo pip3 install adafruit-blinka
Check if these packages are available for your specific version of the distribution.
The dash (-) and underscore (_) in package names can sometimes be mixed up. Try both versions when you’re searching for a package.
Try updating your package list first with sudo apt-get update, before running the install commands again.
Always remember to check the official documentation for correct installation instructions for the packages you’re trying to install.
Hi Folks.
Seem’s something’s wrong with my setup… a fews months ago I’ve setup up al HyperHDR and everything was fine.
Now we’ve move around some furniture and the TV an I’m about to reassemble my setup. I tried everything but can’t get the LED working…
Tried some troubleshooting, but nothing helped by now.