jamesbulpin / meshblu-connector-ws2811

Meshblu connector for WS2811 LEDs
MIT License
0 stars 0 forks source link

CPU Usage when using this connector is very high #6

Open shortbloke opened 7 years ago

shortbloke commented 7 years ago

Environment

Issue

  1. Connect a couple of sessions to the RPi. In one start top or htop to monitor resource usage.
  2. Run the connector sudo env DEBUG='meshblu-connector-ws2811*' npm start
  3. Once "Connected" CPU usage of meshblu-connector-runner is ~10-12%
  4. If you use Octoblu to send a change of the light to the strip, CPU usage of the process increases to: 30-40%, even for a solid colour. Or even when you send the command to turn them off.

Comparison

This connector is based on usage of rpi-ws281x-native node module. However this module doesn't look to have the same CPU issues. For example running the examples from ~/meshblu-connector-ws2811/node_modules/rpi-ws281x-native/examples Shows:

jamesbulpin commented 7 years ago

The WS281x part of the connector is fairly CPU hungry - because it includes animations in its arsenal it runs a frequent rendering loop. A possible improvement would be to suppress running this rendering loop when simple colours (not animations) are selected - pull-requests welcome :)

So it's working as expected