tom-2015 / rpi-ws2812-server

Raspberry Pi WS2812 (web) server tool
172 stars 40 forks source link

Load predefined script from web gui. #11

Closed Orm1server closed 4 years ago

Orm1server commented 6 years ago

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?

Orm1server commented 6 years ago

Hey there. Been a couple weeks. Just poking the question hoping for an answer

maxiimilian commented 6 years ago

Hey :) I have something similar in mind. Not individual pixels but ranges of pixels to group them into a "virtual" light. From a programmatically point, however, it does not matter if you want to talk to individual or ranges of pixels. Do you have a certain language in mind?

Orm1server commented 6 years ago

If you look at bottom of read me there is a way to load a file currently in creators program with what youre talking about but I can't figure out how to load the file from the web interface, I can only see instructions for CLI. I'm not a dev but was hoping for this feature

On Tue, Apr 17, 2018, 1:07 AM Maximilian notifications@github.com wrote:

Hey :) I have something similar in mind. Not individual pixels but ranges of pixels to group them into a "virtual" light. From a programmatically point, however, it does not matter if you want to talk to individual or ranges of pixels. Do you have a certain language in mind?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tom-2015/rpi-ws2812-server/issues/11#issuecomment-381890626, or mute the thread https://github.com/notifications/unsubscribe-auth/AjiYcfIUIh4iRDBZftqCL_7j2mZoe6kLks5tpaLTgaJpZM4TEInB .

maxiimilian commented 6 years ago

There is also an example for using the socket through a website. You can pass the exact same file/commands only by using a website. However, if you are no devoloper you will have a hard time. If I remember I can like to my web GUI here, once I created it. I don't know when I will have time for that, though.

Orm1server commented 6 years ago

I'm sorry Max.

Are you the dev for the GitHub project or just skilled user? I have the website gui color picker with extra JavaScript mods done to make life easy. Also fixed the brightness command to my liking but I'm unsure how to run a prebuilt script that's stored on my rpi3 from web gui. Can you be more clear

On Tue, Apr 17, 2018, 7:23 AM Maximilian notifications@github.com wrote:

There is also an example for using the socket through a website. You can pass the exact same file/commands only by using a website. However, if you are no devoloper you will have a hard time. If I remember I can like to my web GUI here, once I created it. I don't know when I will have time for that, though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tom-2015/rpi-ws2812-server/issues/11#issuecomment-382010847, or mute the thread https://github.com/notifications/unsubscribe-auth/AjiYcUWPqqyRmI8mJUrIdqu4ma2okGD1ks5tpfrFgaJpZM4TEInB .

maxiimilian commented 6 years ago

No I am not the developer nor anyhow related to the project. I just came across it and use it for my own UI.. Are you running a php backend as well? If so, try to understand the exex_shell command. It allows you to run code in your cli triggered by a website. If not you can use plain js as well. You only need to modify the data your Javascript sends to the server. Those data can be the content of the file you created with your instructions. The great thing about this server is the standardised interface. It does not matter if you enter the commands I interactively in the shell, through a file or by socket through Javascript or PHP.

tom-2015 commented 6 years ago

In your PHP script try something like:

$commands_from_file=file_get_contents("/home/pi/commands.txt"); send_to_leds($commands_from_file);

replace the /home/pi/commands.txt with the location of the file containing the commands you want. Don't forget the www user needs to have permission to read the file.

Orm1server commented 6 years ago

Awesome thank you both of you. I will try that

On Tue, Apr 17, 2018, 9:03 AM Tom notifications@github.com wrote:

In your PHP script try something like:

$commands_from_file=file_get_contents("/home/pi/commands.txt"); send_to_leds($commands_from_file);

replace the /home/pi/commands.txt with the location of the file containing the commands you want. Don't forget the www user needs to have permission to read the file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tom-2015/rpi-ws2812-server/issues/11#issuecomment-382048182, or mute the thread https://github.com/notifications/unsubscribe-auth/AjiYcYHrSqN5FAPXzm5tKrGcERz_BVsfks5tphJSgaJpZM4TEInB .