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

Plasma Stick 2040 #7

Closed
bjohas opened this issue Apr 21, 2023 · 3 comments
Closed

Plasma Stick 2040 #7

bjohas opened this issue Apr 21, 2023 · 3 comments

Comments

@bjohas
Copy link

bjohas commented Apr 21, 2023

Hello,

thank you for making this code available - it's great!! (I found it via https://hackaday.com/2023/04/07/pi-microcontroller-still-runs-a-webserver/ )

I'm trying to use the web server to drive the Plasma Stick
https://shop.pimoroni.com/products/plasma-stick-2040-w

I've forked the code here:
https://github.com/OpenDevEd/plasma-pico-web-server-control
and added two of the plasma examples.

I can successfully start a plasma stick pattern with:

wget -O - http://192.168.1.198/plasma/1

However, when I try to stop it,

wget -O - http://192.168.1.198/plasma/0

the server hangs.

I'm not really familiar with asyncio, so it might be a basic mistake.

Any ideas?

Many thanks!

@mirkin
Copy link
Collaborator

mirkin commented Apr 22, 2023

Firstly thank you for trying out our code.

We don't have that particular device, or we'd figure it out for you. Maybe an idea to pull all the code into main.py and start with one of their simple examples setting up the plasma stick at the start of the code and led_strip.start() then copy their while True loop into our main() function replacing their time.sleep with await asyncio.sleep then having a variable you change with your plasma/1 and plasma/2 with a conditional in the loop to make a change to the stick. Be sure to use global with the variable you are changing in main and plasma.

This way you narrow the problem down because all your code is in main.py apart from the plasma_stick

In our next video and the one on toms hardware we used an LED matrix which is a similar project to yours. We change the scrolling message and speed. Let us know how you get on.

@bjohas
Copy link
Author

bjohas commented Apr 23, 2023

We don't have that particular device, or we'd figure it out for you.

I would be very happy to send you one :)

This way you narrow the problem down because all your code is in main.py apart from the plasma_stick

Thanks for tips - will try that!

In our next video and the one on toms hardware we used an LED matrix which is a similar project to yours. We change the scrolling message and speed. Let us know how you get on.

Change the message and speed of the display via the webserver, right?

Assuming that your message loops, it would be the same scenario as mine.

I found these two videos:

@bjohas
Copy link
Author

bjohas commented Apr 26, 2023

@mirkin - thank you so much. Changing to await asyncio.sleep did the trick!

Updated and working version here:
https://github.com/OpenDevEd/plasma-pico-web-server-control

@bjohas bjohas closed this as completed Apr 26, 2023
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