Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help getting the tree to work in python PLEASE! #36

Open
tyler711 opened this issue Dec 16, 2024 · 16 comments
Open

Help getting the tree to work in python PLEASE! #36

tyler711 opened this issue Dec 16, 2024 · 16 comments

Comments

@tyler711
Copy link

for starters i don't have the best understanding of how this works but id love to get my tree to do more than to light up white.

i have gotten up to the part of testing the tree with python3 tree.py but it only works in the command console and lights up white and if i try it in python shell it just says 'syntaxerror : invalid syntax' and once i open up python i cant find RGBXmasTree to import. i hope I'm doing something silly and east to fix. please help

@Trotter73
Copy link

I'm not an expert in any way shape form, but I'm not sure whether using the python shell is the best way to be doing things.

Generally I would write a script in a text editor and then run like it with python yourscript.py, like for example the tree.py one you have already ran.

If you want some other examples, this repo is a good place to start.

https://github.com/rgooding/rgbxmastree.git

@tyler711
Copy link
Author

thank you for helping so fast ill have a look into that now! i only used python shell as that's what the instructions said. so should i able to do most of this in the normal command console?

@Trotter73
Copy link

No worries.

Yea write the scripts in nano, and then run them using the Python command.

@tyler711
Copy link
Author

so again I'm probably being very silly i copy and paste the lines and download from that other page and still nothing happens. i just want something other than white first before i even try make my own aha
20241216_210817 1

@Trotter73
Copy link

You need to 'clone' the repository.

First install git

sudo apt update
sudo apt install git

git clone https://github.com/rgooding/rgbxmastree.git
cd rgbxmastree
python main.py

@tyler711
Copy link
Author

okay okay i feel like im so close aha!!! thank you for putting up with me i now have this!!
20241216_213127 1

@Trotter73
Copy link

It needs pigpiod starting, you can Google how to permanently set it to start at boot but for now it gives a hint at the top, type

sudo pigpiod

Then try running the python script....

@tyler711
Copy link
Author

okay thank you ill do some googles because every time i go to start pigpiod i get a 'failed because a fatal signal was delivered to the control process' is it different on a pi 5 because people are saying its different? if not ill just ignore them!

@Trotter73
Copy link

Unfortunately I doubt very much you will get the repo I suggested working on a Pi5, they made changes with the Pi5 that made it incompatible with older software like pigpiod. I think you will be stuck with the original examples with the Pi5

For projects like this I have a few Pi Zeros and Pi Zero 2, worth thinking about for next Christmas:)

@tyler711
Copy link
Author

Noooooooooooooooo I do have a pi 4 but its currently doing another project but I might have to try it on that if I get time! Thank you for your help though I should of mentioned what I was using earlier

@Trotter73
Copy link

No worries,not a problem.

I think you will have more luck with the Pi4. Get a Zero 2 on order you might get it before Christmas ;-)

This is my setup using PiZeros, it does work, honestly lol.

20241207_214343

@tyler711
Copy link
Author

I wish that was mine lighting up like that 🥲 aha I think I'll have to get one just for my tree!

@tyler711
Copy link
Author

Hello me again! i got the pi zero 2 just to see if i could do it and i now have a new thing telling me no its having an argument with me like it says at the bottom aha so if your bored and would like to give me more tips im all ears!
20241219_180129 1
But i can still make it white and thats about it aha
20241219_180203 1

@Trotter73
Copy link

Hey.

What OS are you using Bookworm or the legacy image?

Are you sure SPI has been enabled (raspi-config)

Have you tried sudo python [yourscript.py]

As a last resort I would try a fresh install of the legacy image and start from scratch......

@Trotter73
Copy link

So using the legacy 32 bit image these are the steps I took to get it working....

sudo apt update
sudo apt upgrade
sudo raspi-config <- enable SPI
sudo apt install python3-gpiozero python3-pigpio pigpio git
git clone https://github.com/rgooding/rgbxmastree.git
sudo systemctl enable pigpiod
sudo reboot now
cd rgbxmastree
python main.py

@tyler711
Copy link
Author

well...... i put legacy on and now it wont turn on so im just doing cpr to get it to turn on again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants