Closed Chlorex closed 3 years ago
I'm not sure if I understand your question but I guess you want to abort/stop the current command next time you run the PHP script? This is the solution:
Start the server with the setup/init command:
sudo ./ws2812svr -tcp 9999 -i "setup 1,299,3; init;"
Now with PHP you send commands to create a background thread and start the chaser in this thread:
send_to_leds("thread_start 1,0;
chaser 1,0,00ff00,1,1,10,220,50;
thread_stop;
");
Next time you run the PHP code the chaser command will abort and your next command will start to run:
send_to_leds("thread_start 1,0;
<ENTER NEXT COMMANDS HERE>
thread_stop;
");
yes, this is the solution...
I missed it :
thread_start with the value of a thread that is still running if join_type is 0 the thread will be aborted immediately
thank you... Great job.
Hello everybody.
So far I have understood the execution with "./ws2812svr -f file.txt". I wrote a web server including PHP script and buttons so that I can start various programs via the website.
Now to my problem: Server starts with "sudo ./ws2812svr -tcp 9999" The first (no matter which) PHP file is executed, but the second PHP file is not.
Didn't find a stop or reset function.
Is there a "Next PHP File" function included?
Yes, when a PHP has run through, you can start the next .. but "interrupt" would be very helpful in some cases.
Greetings from Germany, great job.
My example: