Code Monkey home page Code Monkey logo

Comments (6)

MdotWym avatar MdotWym commented on August 21, 2024

Update:
I'm really sorry for my request.
It works fine if using the right GPIO on the board!
After checking all possible root causes, finaly found the bug.
--> Issue closed.

BR
Wym

from rpi-ws2812-server.

MdotWym avatar MdotWym commented on August 21, 2024

Hi
Basically the problem (wiring) is solved. After some tests and reading the documentation the following problem has arisen:
As it seems it is not possible to operate both LED bands at the same time.

If a command is sent via TCP for the first strip, and shortly afterwards a command for the second, both processes are aborted.
After the first command is completed, the TCP connection is closed. As soon as the second TCP command opens again, the first process is stopped. Interestingly, the second process starts but is also stopped (I think when closing TCP connection). This is partly in accordance with the note in the documentation under the topic "thread".

Is it possible to run two strips independently of each other?
Could theoretically the server be started twice? One for Stripe 1 and the other for Stripe 2?

BR
Wym

from rpi-ws2812-server.

tom-2015 avatar tom-2015 commented on August 21, 2024

Sorry, not possible to do this unless you can combine commands for strip 1 and 2 in the same loop/thread.

Try running 2 servers on different ports.

from rpi-ws2812-server.

MdotWym avatar MdotWym commented on August 21, 2024

Ok, tried running with two servers. In summary, the following can be said.

The first instance of the server is set up and initialized on channel 1 with PWM0 with the pin used for LED strip 1. TCP port 9999.

The second instance of the server is set and initialized on channel 1 with PWM0 and a UNUSED pin and on channel 2 with PWM1 and the pin used for LED strip 2. TCP port 9998.

Channel 1 cannot be used together with PWM1 since an error during setup is thrown by the server. So I had to setup an "unused" channel 1 with an unused pin on this second server.

If messages are now sent one after the other, Strip 1 and Strip 2 will work properly. However, if the processes run parallel, the LEDs of both strips light up, but they influence each other. So it does not work just like that.

Could this be because both servers or the rpi_ws281x library use the same DMA channel? Maybe you have to assign different DMA channels to each server?

Thank you for your support.

from rpi-ws2812-server.

MdotWym avatar MdotWym commented on August 21, 2024

Update:
If both servers are setup with two different DMA channels, nothing works anymore.
Both channels are dead. For the first server DMA 5 is used, for the second server DMA 4.
I tried DMA 8 as well, but it doesn't work either.

At https://github.com/jgarff/rpi_ws281x it can be found, that DMA 5 should not be used.
From your main.c source code I see you use DMA 5.
What is confusing me, is that calling
init;
works fine, but
init 5;
does not work at all.

from rpi-ws2812-server.

tom-2015 avatar tom-2015 commented on August 21, 2024

You forgot the first argument of the init command is the operating frequency.
try:
init 800000,10;

but I've changed the default DMA number to 10 anyway in the source code.

from rpi-ws2812-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.