Code Monkey home page Code Monkey logo

rpi-ws2812-server's People

Contributors

heurist1 avatar leoheck avatar tillig avatar tom-2015 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi-ws2812-server's Issues

loop speed slow via PHP, but not when just using a TCP Connection

Hi,
When I run a loop using PHP i seem to hit a speed limit but yet the same loop sent via TCP alone it runs much faster

For example this loop
setup 1,113,3; init; rainbow;render;thread_start;do;do;rotate;render;delay 10;loop 250;do;rotate 1,1,2;render;delay 10;loop 250;loop;thread_stop;
Sent using putty in raw mode to the ws2812-server instance on port 9999 runs quickly.
But the same loop in a php page runs much slower.
case 'random': $data .= "rainbow;brightness 1,$brightness;render; thread_start; do; do; rotate; render; delay 10; loop 250; do; rotate 1,1,2; render; delay 10; loop 250; loop; thread_stop;";

any ideas would be greatly appreciated

Simon

Update Color of a Single Pixel

First, I would like say thank you for a great project. This has been very helpful and works perfectly. I am having a great time testing its capabilities.

I am trying to discover a way update the color of a single pixel without effecting the color or re-rendering the rest of the pixels. Is that possible? The reason I am trying to do this is to create some "effects" like a color wipe and some others. I have successfully developed a color wipe script using the rotate command but I get a flash because its necessary to first render the previous color before I start the rotate. Also if the previous color of the leds happen to be in a rainbow that does not work because it rotates as well. Code below is part of my php contoller page (hence the php variables):

fill 1,$prevColor;
thread_start;
do;
rotate 1,1,0,$color;
brightness 1,$brightness;
render;
delay $speed;
loop $ledQty;
thread_stop;

Sorry for many questions but I have a few more...

I am also having trouble with the gradient command. I would like to create a gradient that goes from (for example) FFFFFF to FF0000 and spans 50 pixels. Using the supplied gradient command, how would I accomplish that?

Could you explain the <OR,AND,XOR,NOT,=> operators for the fill command and an example of how one might use them?

Also, did anyone ever get the fade command to work over TCP?

Thanks in advance for the reply!

Load predefined script from web gui.

Hey thanks for an awesome product. Got it working great with all static colors from webgui AP.

Anyways I'm trying to control individual neopixels or run a script that controls individual neopixel from web gui. Do you have any suggestions?

Installation problem

Hi. It won't let me make the code.
Here is what I get:
gcc -g -I/usr/include -DUSE_PNG -DUSE_JPEG -c main.c -o main.o
main.c: In function ‘tcp_wait_connection’:
main.c:2078:13: error: too many arguments to function ‘perror’
if (s!=0) perror("Error creating new thread: %d", s);
^~~~~~
In file included from main.c:2:
/usr/include/stdio.h:781:13: note: declared here
extern void perror (const char *__s);
^~~~~~
make: *** [makefile:41: main.o] Error 1

chaser crashes the daemon

If I try to send a chaser command to the daemon, it crashes and only works again after restarting the daemon. It's not really a problem (I don't really need it), but I might do something wrong? This is de line I send to the daemon:

$data .= "chaser 1,0,$color,0,20,0,2,$brightness,0;";

Or actually, it's the code in my php page.

Thanks in advance and kind regards,
Hans

It doesn't work with the -p flag

Hi, I could not make it run with the -p flag.
I am using RPi3 and RPi4.

Do you have any (bash) example to share here?

I am trying something like:

sudo ./ws2812svr -p /dev/leds &
sudo echo "setup 1,8,1; init; fill 1,ff00000; render" > /dev/leds
sudo ./ws2812svr -p /dev/leds &
sudo echo "setup 1,8,1" > /dev/leds
sudo echo "init" > /dev/leds
sudo echo "fill 1,ff00000" > /dev/leds
sudo echo "render" > /dev/leds

Is it right? Am I doing anything wrong?

Color Change

Hi, looking for some insight into the color change, using the SK6812 IC LED strip.

Using the code to simply turn on all of the LEDS to a red color.

I turn on all of the lights however LED 1,2,3 and 4 turn red, blue, white and green ?

Is this a default config with the LED strip ?

Run as System Service

Is there a way to run the server as a System Service on the Raspberry Pi so that it runs all the time?

render does weird things

I have a test webpage to send a render to my server (render 1,0,FF0000FF0000FF0000;), the first light turns red, the second and the third turn blue. If I render with 00FF0000FF0000FF00, the first one is green, the second one is red, the third one is off.

Only if I put two extra hex numbers in between the colour-codes it works. I initialized them with type 4, which should be right. I checked the chip (and even the manufacturer's site; it is a 24 bit chip. The two extra hex numbers don't change anything on the chip either. Do I initialize wrong? (setup 1,3,4;init).

Issue with -p flag. The animation is not smooth

Hi, I've noticed that running the same animation through "-p" and -f yields different behaviors.

I made a smooth animation using a sile and the -f flag.

setup 1,8,3
init

fill 1,ff3300,0,8

fade 1,0,80,16
render

delay 100

do
    fade 1,79,10,16
    fade 1,11,80,26
    delay 100
    render
loop 3

fade 1,80,0,16

Now, converting it to a script using the -p is not smooth anymore,

Can you confirm?

led_channel=1
led_count=8
led_type=3
led_invert=0
led_gpio=18
led_brightness=20

rgb_yellow=ffb100

read -r -d '' animation <<- EOM
setup ${led_channel},${led_count},${led_type},${led_invert},${led_brightness},${led_gpio}
init

fill 1,${rgb_yellow},0,8

fade 1,0,80,16
render

delay 100

fade 1,79,10,16
fade 1,11,80,26
delay 100
render

fade 1,79,10,16
fade 1,11,80,26
delay 100
render

fade 1,79,10,16
fade 1,11,80,26
delay 100
render

fade 1,80,0,16
EOM

echo "$animation" > /dev/ws281x

It looks like the fade command is different between these two versions

Startup Issue after Update to new Version

After i updated the rpi-ws2812-server my startup script no longer works as before.

Here my Script:

[Unit]
Description=LED Server
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=0

[Service]
Type=forking
Restart=always
RestartSec=1
User=pi
WorkingDirectory=/home/pi/rpi-ws2812-server
ExecStartPre=/bin/echo "LED-Server versucht zu starten"
ExecStart=/usr/bin/screen -dmS LEDSERVER bash -c "cd /home/pi/rpi-ws2812-server ; sudo ./ws2812svr -i 'setup 1,13,3;init;blink 1,FF0000,00FF00,75,24;fade 1,255,0,10,2;render;fill 1,000000;render;brightness 1,255;' -tcp 9999; bash" &
ExecStartPost=/bin/echo "LED-Server gestartet"
[Install]
WantedBy=multi-user.target

When the pi starts he showed me through this script that the ledserver is running. But now server starts without flashing my leds. When i send a TCP paket then it runs the blink.... and after that the TCP paket. I dont understand why. Server runs in a screen to debug for problems.

Second Problem: I tried it with your new startupscript, but it just keeps coming that i didnt run the init. No matter what I configure.

Everything worked wonderfully before the update.

I use your server to let viewers interact with my LEDs via twitch. Chats, follow = blink blink :-)
Nice gimmick! Thanks for your work!
Sorry for my bad english, im from Germany.

Run terminal code on startup

Looking to have the restart each day, is there a place which I can put the:

cd rpi-ws2812-server
sudo ./ws2812svr -tcp 1111

to make it run on startup in terminal?

Error set SO_KEEPALIVE

Hi,
I made a web page with a colorpicker that is sending a fill command to tcp socket immediately when color is changed. And I stumble upon this error, when I'm using the script:

Waiting for client to connect.
Error set SO_KEEPALIVE

The script is working fine for a while, and then this error occur. These two lines are displaying in a infinite loop. I think it may be because the script is sending new command too fast.

Do .. loop on TCP

Currently I'm having problems using a

do .. loop

over TCP, all other commands work. My code is:

var String value = " setup 1,56,7; init; fill 1,FF000000,1,1; do; rotate; render; delay 100; loop;"

With and without thread_start / stop it does not work.

I use OpenHAB with the TCP Binding to send the string.

PWM1 crashes server

Setting the channel param to the PWM1 pin (3 B+) crashes the server, seems that the only pin which doesn't crash the server is 18.

Can't get it to work

Hello, this project is what iv'e been searching for

I manged to load the page where I can choose the colors but i get :

and nothing happens..

any idea?

and yes I checked and the led strip does work.

I'm using a Rpi B 3

Thank you!!!

Fade issue

Hi, it looks like that the fade command is not ok.

I have a video here to show what happens, https://photos.app.goo.gl/aYQieXTpLPLvw4NP9
After the fade command LEDs won't remain on as you can see in the video.

There, the led panel will start from a previews run, then I send the fade command. It should transition from min to max brightness. After that, I will send a fill blue command. After that, at the and, a second fade with white.

Maybe it is related to the white color

setup 1,8,3
init

fill 1,FFFFFF
brightness 1,0

fade 1,0,80,100,4
render

Create a second channel

I can't create a second channel.
I tried :
setup channels=2
setup channel_1_gpio=18
render // works
setup channel_2_gpio=23
Initialization failed.
: Invalid argument

Raspberry Pi 3 freezes while using php

Im using apache+php on raspbian with Your index.php in /var/www/html/.
When I run index.php and change color via Web-gui system freezes, after while and I'm loosing WLAN connection.
Im running server with: sudo ./ws2812svr -i "setup 1,200,1;init;" -tcp 9999

I'm getting issues with running Your php code as well:
http://192.168.0.109/index.php?cmd=fill&color=CC0066&brightness=%3C?echo%20$brightness?%3E
And the text field always show: <?$brightness?> after every color change
Everything is running well without using frontend and index.php

The process hangs and loads 50% CPU

On my raspberry pi zero w all works fine. Since one or two weeks the process hang up at 50% CPU load sporadically when i send a new command. When i restart the service its ok. A new installation of my pi with the newest raspian did not work. it still hangs sporadically when a new command is sent. Some issue with raspbian system update?

Is there a maximum script length?

I've got the ws2812svr starting at Raspberry Pi / Raspbian startup via an /etc/init.d script like this:

#! /bin/sh
# /etc/init.d/ws2812svr

### BEGIN INIT INFO
# Provides:  ws2812svr
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Starts the ws2812svr LED controller.
# Description: Runs the ws2812svr listener on port 9999 to handle LED control.
### END INIT INFO
case "$1" in
  start)
    echo "Starting ws2812svr"
    /usr/bin/ws2812svr -tcp 9999 &
    ;;
  stop)
    echo "Stopping ws2812svr"
    killall ws2812svr
    ;;
  *)
    echo "Usage: /etc/init.d/ws2812svr {start|stop}"
    exit 1
    ;;
esac
exit 0

I have a web app connecting to port 9999 and sending scripts to the lights which include the setup, like:

setup 1,540,3,0,64;init;thread_start;fill 1,ff0000;render;thread_end;

I am able to send any number of short scripts like this with no issue. I can send, like, 10 in a row, no issues.

However, I did notice that if I send a script that exceeds around 1000 characters the whole Raspberry Pi crashes, or at least it hangs so hard it won't respond to any network requests anymore including SSH. I end up having to hard reset it by power cycling.

I thought it was #20 but since I can send the setup any number of times with smaller scripts, I figured it may be that I'm running into something else like a buffer overflow or something else.

Possibly related, possibly a separate thing... when I was trying to set the server up like this...

/usr/bin/ws2812svr -i "setup 1,540,3,0,64;init;" -tcp 9999 &

...I was only able to send a single script (which didn't include setup/init) before my lights stopped responding. I wasn't sure how to determine what was going on. I do know that when I removed the inline setup and went back to sending setup/init with the scripts things started working predictably again. Except, of course, in the case I had a longer script.

readpng with start position >= 963 not work

To localize the error I tested with a 1 pixel image

readpng 1,/home/pi/ledwall/1pixel.png,000000,962,2000,0,=,0; >> works
readpng 1,/home/pi/ledwall/1pixel.png,000000,963,2000,0,=,0; >> not works

Is it possible to fade to channels at a time

Hi

So would like to fade multiple channels at the same time, but cant see a way to.

if i send this command:

fill 1,00ff00;fill 2,00ff00;thread_start;do;fade 1,255,0,10;fade 2,255,0,10;fade 1,0,255,10;fade 2,0,255,10;loop;thread_stop;
it does work but the channels fade one channel at a time, and id like to fade them both at the same time. am i doing something wrong? this is the debug output:

Waiting for client to connect.
Enter thread 1,0,72.
do 2
fade 0, 255, 0, 10, -1, 0, 28
fade 1, 255, 0, 10, -1, 0, 113
fade 0, 0, 255, 10, 1, 0, 28
fade 1, 0, 255, 10, 1, 0, 113
loop 71
fade 0, 255, 0, 10, -1, 0, 28
fade 1, 255, 0, 10, -1, 0, 113
fade 0, 0, 255, 10, 1, 0, 28
fade 1, 0, 255, 10, 1, 0, 113
loop 71
fade 0, 255, 0, 10, -1, 0, 28
fade 1, 255, 0, 10, -1, 0, 113
fade 0, 0, 255, 10, 1, 0, 28
fade 1, 0, 255, 10, 1, 0, 113
loop 71

and you can see that it is doing one channel at a time.

any thoughts / advice / help greatly appreciated.

Simon

Two LED strip on RPI 4

Hi

Thank you for your WS2812 server.

I tried your it with two LED strips. It worked from the beginning very nice with only one strip.
Then I connected a second, which is not working.
For the first, the setup is:
setup 1,256,3,0,255,18; init;

Using the second, the setup is:
setup 1,256,3,0,255,18; setup 2,60,3,0,255,13; init;

The first one uses PWM0, the second PWM1 (I guess). So in theory two strips can be connected.
Before going into details I'd like to know if I'm doing something fundamentally wrong.

Do you prefer another channel to ask such basic questions?

BR
Wym

Connecting to server and executing php script

Is there any obvious reason that I would not be able to run the server on a Pi running stretch ? The server end seems to hang after connecting a client with a series of unknown cmd's. The web browser does nothing.

Error set SO_KEEPALIVE

Hi, I am seeing many Error set SO_KEEPALIVE messages using as a server as in ws2812svr -tcp
Do you have any suggestion for fixing or avoiding this?

Receive HTTP/GET Request errors in CLI when trying to access Webserver

Get the errors:

unknown cmd: GET
unknown cmd: Host:
unknown cmd: Connection:
unknown cmd: Upgrade-Insecure-Requests:
unknown cmd: User-Agent:
unknown cmd: Win64
unknown cmd: x64)
unknown cmd: Accept:
unknown cmd: q=0.9,image/webp,image/apng,/*/
unknown cmd: q=0.8
unknown cmd: DNT
unknown cmd: Accept-Encoding:
unknown cmd: Accept-Language:
unknown cmd: q=0.9

Have tried from mobile browser chrome and desktop browser Internet Explorer and Chrome

FROM CLI system works great, webserver i cant load color picker as I get the above errors in CLI

Send fade command to tcp

Hi Tom,

I got a problem sending a simple fade command to the tcp socket.
I wanna send fade 1,200,100,10,1 to the tcp socket Server working on port 9999.
But it seems that the command gets ignored.

From the command line it is working flawless.
I also came across the issue that when using "setup 1,xxx;init;fade ...." on the command line it is not working.
But using setup 1,xxx -> enter -> init -> enter and then fade .... fading works as it should.

This is the main part of my php file sending the command to the leds.
setup 1,xxx;init; has been called and already sent earlier.

if ($cmd!=''){
switch ($cmd){
case 'fill':
$data = "fill 1,$color;render;";
break;
case 'rainbow':
$data = "rainbow;render;";
break;
case 'fade':
$data = "fade 1,200,100,10,1"; //<- omitted render because "fade" is working without in command line
break;
case 'bright':
$data = "brightness 1,$bness;render;";
break;
}
send_to_leds($data);
}

function send_to_leds ($data){
$sock = fsockopen($serverip, 9999);
fwrite($sock, $data);
fclose($sock);
}

Best regards...

Mirko

Flashing Command

Is it possible to make a flashing command to run for a specific amount of time?

Issue when compiling without PNG and JPEG

There is a problem with the Makefile. In line 4 the png and jpg libraries are added to the linker (at least I assume that is what happens) without checking if PNG or JPG is required. Ultimately, this results in a compiler error if the libraries are not installed.

I fixed it by first removing -lpng and -ljpeg from LINK= in line 4. Afterwards, I modified the top of the Makefile to look like this:

ifneq (1,$(NO_PNG))
    CC += -DUSE_PNG
    LINK += -lpng
endif

ifneq (1,$(NO_JPEG))
    CC += -DUSE_JPEG
    LINK += -ljpeg
endif

Since I don't really know how to start a pull request I figured I would open this issue to let you know. Also, I am not quite sure if the fix is 100% correct.

Chase sequence?

Is it possible to create a sequence in a loop where the addressed LED advances? I'd like to start at 0 and pulse LED up/down and then move to LED 1 and pulse up/down, etc to an end point of say 50 LED's.

I need a way to address led 1, then 2, then 3, etc. i don't see how to do this in your commands.

Pass setup parameters on server start?

Any way to pass setup parameters on start?

Like:
sudo ./ws2812svr -s 1,50 -tcp 9999

Or is there a way to find out if the server has already been initialized?

Led matrix - How to rotate/flip every even pixel line of png image

Hello, thank you for this great product! I am building a led matrix wall with the idea of playing an image sequence loop on it. Your server made it very easy to start for me and I can upload a sequence via web interface and run it with php, which is just great. But I cannot figure out how to flip scan lines of the image - i need to flip every even line. Right now, I am able to do this during video postproduction, there is also posibility of cutting the led strip and rewiring each line, but it would be more practical to flip it during reading the pngs. With arduino libraries it´s easy to define lines order, but arduino have a little memory and speed limit, which is why i am trying to use raspberry now.

Do you have any idea how to do this, is there a way to rotate each even line with readpng?

Thank you very much for any advice.

Jan

Same TCP Paket not perform multiple times at some time

After a certain point in time a TCP packet is no longer executed if I send it twice. (same packet, different pakets work)

Server log shows "Client connected. Waiting for client to connect." any time. But only First and Third .. Fith Paket perform. Just restarting server every time helps. Then same paket perform multiple times.

It does not matter whether in a row or with a certain time interval.

One of my scripts:

<?php
send_to_leds("
thread_start
fill 1,000000
brightness 1,155
render
blink 1,FFFFF,000000,100,3
render
fill 1,000000
brightness 1,255
render
thread_stop
");
function send_to_leds ($data){
   $sock = fsockopen("192.168.178.29", 9999);
   fwrite($sock, $data);
   fclose($sock);
}
?>

Other:

<?php
send_to_leds("
thread_start
fill 1,000000
brightness 1,255
render
rainbow
render
do
       rotate
       render
       delay 100
loop 30
fill 1,000000
brightness 1,255
render
thread_stop
");
function send_to_leds ($data){
   $sock = fsockopen("192.168.178.29", 9999);
   fwrite($sock, $data);
   fclose($sock);
}
?>

It doesn't matter which script. At some point it no longer works.

With larger scripts I sometimes get this error message after sending it a second time.: Warning max nested loops reached!
I understand this message but it makes no sense when nothing perform.

Other Problem:
Is there a trick how TCP packets are executed in sequence and not a packet that cancels the other?
The following problem: If I run a long script and then a second script is executed, it often happens that the long script should end a certain sequence but is stopped by the second script and the second script is immediately executed. I would like to prevent that. Scripts should always be executed completely before another script is executed.

I Hope you understand my problems, used Google Translator. My english is not the best.

Cannot get a daemon to use port 9999

Hello,

my /etc/ws2812svr.conf is:

#mode must be first setting in file!
mode=tcp
port=9999
file=/home/pi/test.txt
pipe=/dev/leds
init=setup 1,20,4,0,255,12;init

if I start my server and I do a netstat -plnt I get any port above 35000, different every time. I probably have an error somewhere, but I cannot seem to find it. The server itself works, so that's not the problem.

Thanks in advance,
Hans

New command store/laststate possible?

Is it possible to make a store and laststate command?
example:
I am making a fill with red and will send a blink at some point. And say a laststate command within the blink command that it automatically returns to the last state in the case just red. You could give the fill example a store that the laststate knows what it has to do.

With the store command you could generate a file or save it at the memory that stores the whole command and calls it with laststate. Each store then overwrites the last store.

I hope you understand what I mean.

Greetings

Hotspot feature to access webpage

Hello,

First off new to GitHub, my question and I think it in wrong place, but any chance you can include a hotspot that broadcasts the color picker webpage? This rpi3 is going into my truck and won't have access to WiFi unless I specifically go out of way to set up hotspot. Like I said prolly wrong area to ask but I'd still like to ask.

Thanks,
Steve

Wish

Hello,

is there a option to implement a quit command to the Daemon that only terminate the session and not the deamon?
Thanks for your great work!!!

regards

andy

Rpi Zero W

Hi,

i'm trying to make it work for the Rpi Zero W but the script returns :
"ws2811_init failed: Hardware revision is not supported"

The jgarff lib has been updated to work with Pizero W.
I tried to modify your rpihw.c ( as descripted here :
jgarff/rpi_ws281x@62689c9 ) but it still doesn't work.

Can you help me ?

How to use the `-tcp` mode?

First of all, the README.md shows
image

The command has the port missing, it should be like

sudo ./ws2812svr -tcp [PORT]

Also
How could I use the -tcp mode with the command line.

I am trying this:

# Launch the server
sudo ./ws2812svr -tcp 12346

# Send some commands
echo "setup 0,8,3; init; fill 1,FFFFFF; render" | nc  127.0.0.1 12346

It gives me

Client connected.
Invalid channel number, use channels <number> to initialize total channels you want to use.
Gpio 0 is illegal for LED channel 0
ws2811_init failed: Selected GPIO not possible
Invalid channel number, did you call setup and init?

And the server closes, which is not good because someone can send some wrong command to just close the server.

Trying to send the same command from the README, like

echo "setup channel_1_count=8;rainbow;brightness 1,100;" | nc -k 127.0.0.1 9999

image

Segmentation Fault on 3rd init over TCP connection

I'm using NodeJS v8.12.0 to open a TCP client socket using this script:

const net = require('net');

let client = new net.Socket();

client.connect(80, '192.168.1.211', () => {
  console.log('Connected!');

  client.write('setup 1,150;');
  client.write('init;');
  client.end();
  client.destroy();
});

After third execution of this the server crashes with a Segmentation Fault.

GDB output and stack trace:

pi@Pi-2:~/rpi-ws2812-server $ sudo gdb ws2812svr
GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.                       
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ws2812svr...done.
(gdb) run -tcp 80             
Starting program: /home/pi/rpi-ws2812-server/ws2812svr -tcp 80
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Listening on 80.              
Waiting for client to connect.
Client connected.             
Waiting for client to connect.
Client connected.             
Waiting for client to connect.
Client connected.             
                 
Program received signal SIGSEGV, Segmentation fault.
__GI___getpagesize () at ../sysdeps/unix/sysv/linux/getpagesize.c:28
28      ../sysdeps/unix/sysv/linux/getpagesize.c: No such file or directory.
(gdb) bt         
#0  __GI___getpagesize () at ../sysdeps/unix/sysv/linux/getpagesize.c:28
#1  0x000169fc in unmapmem (addr=0x76ff10a0, size=8) at mailbox.c:70
#2  0x00017c88 in unmap_registers (ws2811=0x2c3b0 <ledstring>) at ws2811.c:258
#3  0x00019900 in ws2811_fini (ws2811=0x2c3b0 <ledstring>) at ws2811.c:1078
#4  0x00011afc in init_channels (args=0x0) at main.c:283
#5  0x000159a8 in execute_command (command_line=0x2d828 "init") at main.c:1542
#6  0x00015d38 in process_character (c=59 ';') at main.c:1611
#7  0x00016688 in main (argc=3, argv=0x7efff794) at main.c:1780

Compiled without PNG or JPEG support using patch from #18

Program takes a long time to respond

Hi, I'm currently using this program on a RPI 3B+ using : sudo ./ws2812svr -i "setup 1,60,3;init;" -tcp 9999 and I'm running the php script here: https://github.com/tom-2015/rpi-ws2812-server/blob/master/php/index.php on a remote machine on the local network (I changed the IP in fsockopen)

So far, only the rainbow/brightness commands work - however they take a long time to respond (a minute or two) and react. The rotating rainbow never responded even after 10 minutes.
The program outputs 'Client Connected' as soon as I press an option on the website, and then after the colour changed after a few minutes, it says 'Waiting for client to connect'. I checked CPU usage with top and it remains at around 25% while executing, and 1.3% when done.

I've tried the following #28 and that did not succeed.

bash scripting question

Hi, thanks for that server it is really amazing. Quick question, any suggestion to interact using bash scripting ? Thanks in advance

Clearing the que

Is it possible to clear the current que of commands completely (via TCP)? For example if i send a command block like this:
rainbow;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;rotate 1,1,1;delay 10;render;

And after that i would send for example this:
clear_que; fill 1,#ff0000;render
Is there a command that would clear all commands waiting to execute?

TCP command produces different outputs.

I am currently developing a smarthphone app for my LED-Strip and the rpi-ws2812-server is a good serverside basis to build on (only works in local network).

One of the things I want to implement is an animation that works as follows:

every third LED gets lid on an then the LEDS are being rotated one to the right, little pause, again rotation, pause, rotating, ....

I came up with the following code:

thread_start
  do 
    fill 1, FF0000, {0}, 1
  loop 268, 3
  do
    rotate 1,1,2
    render
    delay 200
  loop
thread_stop

However this only works as expected the first time the command is being sent to the server. After stopping the thread by connecting another time via tcp the effect is stopping as intended.

When sending the command again, the first loop is being ignored and thus the LED wont get filled (except the first one). The second loop is being executed as intented.

So for some reason the server is ignoring to loop the first loop.

Hope you can help me fix this.

Kind Regards
BloodSKreaper

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.