pimoroni / unicorn-hat

Python library for Unicorn pHAT and HAT. 32 or 64 blinding ws2812 pixels for your Raspberry Pi
https://shop.pimoroni.com/products/unicorn-hat
MIT License
370 stars 130 forks source link

Unicornhat via cgi Webinterface #42

Closed johnsmith87 closed 8 years ago

johnsmith87 commented 8 years ago

Calling import unicornhat as www-data will result in following:

www-data@raspberrypi:~/Pimoroni/unicornhat$ python simple.py Failed to open /dev/vcio, trying old method. Failed to create mailbox device /dev/mailbox-679: Permission denied Failed to open /dev/vcio, trying old method. Failed to create mailbox device /dev/mailbox-679: Permission denied Failed to open /dev/vcio, trying old method. Failed to create mailbox device /dev/mailbox-679: Permission denied Traceback (most recent call last): File "simple.py", line 3, in import unicornhat as UH File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 13, in ws2812.begin() File "/usr/local/lib/python2.7/dist-packages/neopixel.py", line 107, in begin raise RuntimeError('ws2811_init failed with code {0}'.format(resp)) RuntimeError: ws2811_init failed with code -1 Segmentation fault

How would you be able to execute python scripts via www-data (i.e. cgi webserver script)

Want to code a mood light with web interface for choosing color.

Any help will be appreciated.

Thanks

johnsmith87 commented 8 years ago

Nevermind. Found another solution. Modified the unicornprint thingy. Utilized Flask and used another colorpicker & jquery-ajax to generate get urls