njbbaer / unicorn-remote Goto Github PK
View Code? Open in Web Editor NEWControl your Unicorn HAT LED matrix from the web
License: MIT License
Control your Unicorn HAT LED matrix from the web
License: MIT License
Hi. Can you help with this error on an original unicornhat (8x8). Thanks
pi@Pi3-UniHat:~/unicorn-remote $ sudo python3 run.py -o
Traceback (most recent call last):
File "run.py", line 4, in
from app import create_app
File "/home/pi/unicorn-remote/app/init.py", line 5, in
from app.state import state
File "/home/pi/unicorn-remote/app/state.py", line 2, in
import unicornhathd as unicornhat
File "/usr/local/lib/python3.4/dist-packages/unicornhathd/init.py", line 20, in
_spi.open(0, 0)
FileNotFoundError: [Errno 2] No such file or directory
Me again :)
Looking to add more programs to the list.
I've put my .py file in /app/programs/original/
I tried to add it to the the list as per structure in /app/programs/__init__.py
but I guess there might be more to it than that?
Sorry for basic question..I'm a tinkerer not a coder, but learning..Thanks!
I followed your instructions for your unicorn-remote and when running the command to start the program, i get the following error. I did try doing what it suggested with "sudo pip install numpy" but it says it was already installed. Any ideas? Thank you!
sudo pipenv run python run.py
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/core/init.py", line 16, in
from . import multiarray
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/unicornhathd/init.py", line 13, in
import numpy
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/init.py", line 142, in
from . import add_newdocs
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/lib/init.py", line 8, in
from .type_check import *
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in
import numpy.core.numeric as _nx
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/numpy/core/init.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf
(removes all
files not under version control). Otherwise reinstall numpy.
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 4, in
from app import create_app
File "/home/pi/Pimoroni/unicornhathd/examples/unicorn-remote/app/init.py", line 5, in
from app.state import state
File "/home/pi/Pimoroni/unicornhathd/examples/unicorn-remote/app/state.py", line 73, in
state = State()
File "/home/pi/Pimoroni/unicornhathd/examples/unicorn-remote/app/state.py", line 12, in init
self.set_model(is_hd)
File "/home/pi/Pimoroni/unicornhathd/examples/unicorn-remote/app/state.py", line 18, in set_model
import unicornhathd
File "/root/.local/share/virtualenvs/unicorn-remote-QVlOwlcP/lib/python3.5/site-packages/unicornhathd/init.py", line 15, in
raise ImportError("This library requires the numpy module\nInstall with: sudo pip install numpy")
ImportError: This library requires the numpy module
Install with: sudo pip install numpy
Title.
It would be awesome if we could set a program to automatically be started after Unicorn Remote is started.
CPU Utilization, for example. You boot up Unicorn Remote and CPU Utilization is started automatically. Maybe have a folder called "autostart" in which you copy/paste the program you want to start after the remote has been started.
Thank you for your time.
Cheers,
Griefed
Cool project. It needs to add https://github.com/giampaolo/psutil as a requirement since the CPU update.
๐
Can you advise on the best approach to starting unicorn-remote in the background on boot?
My use case is a headless pi set up as an access point.
Thanks
When I run a program to display an image, it errors because it can't find the pillow module which is required to display images.
#!/usr/bin/env python
import time
from sys import exit
try:
from PIL import Image
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
import unicornhathd as unicorn
def run(params):
width, height = unicorn.get_shape()
img = Image.open('doom.png')
try:
while True:
for o_x in range(int(img.size[0] / width)):
for o_y in range(int(img.size[1] / height)):
valid = False
for x in range(width):
for y in range(height):
pixel = img.getpixel(((o_x * width) + y, (o_y * height) + x))
r, g, b = int(pixel[0]), int(pixel[1]), int(pixel[2])
if r or g or b:
valid = True
unicorn.set_pixel(x, y, r, g, b)
if valid:
unicorn.show()
time.sleep(0.5)
except KeyboardInterrupt:
unicorn.off()
That produces a "This script requirtes the pillow module | Install with: sudo pip install pillow" message. Thing is though, pillow is installed.
Running this .py by itself, without Unicorn Remote, works just fine:
#!/usr/bin/env python
import time
from sys import exit
try:
from PIL import Image
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
import unicornhathd
unicornhathd.rotation(0)
unicornhathd.brightness(0.3)
width, height = unicornhathd.get_shape()
img = Image.open('doom.png')
try:
while True:
for o_x in range(int(img.size[0] / width)):
for o_y in range(int(img.size[1] / height)):
valid = False
for x in range(width):
for y in range(height):
pixel = img.getpixel(((o_x * width) + y, (o_y * height) + x))
r, g, b = int(pixel[0]), int(pixel[1]), int(pixel[2])
if r or g or b:
valid = True
unicornhathd.set_pixel(x, y, r, g, b)
if valid:
unicornhathd.show()
time.sleep(0.5)
except KeyboardInterrupt:
unicornhathd.off()
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.