Giter Site home page Giter Site logo

pimoroni / unicorn-hat Goto Github PK

View Code? Open in Web Editor NEW
368.0 49.0 131.0 964 KB

Python library for Unicorn pHAT and HAT. 32 or 64 blinding ws2812 pixels for your Raspberry Pi

Home Page: https://shop.pimoroni.com/products/unicorn-hat

License: MIT License

Perl 0.29% Python 9.62% Ruby 0.17% Makefile 0.38% C 69.70% Shell 0.20% CSS 1.62% HTML 2.17% JavaScript 15.38% SWIG 0.47%

unicorn-hat's Introduction

Unicorn HAT/pHAT

Available from Pimoroni:
http://shop.pimoroni.com/products/unicorn-hat
http://shop.pimoroni.com/products/unicorn-phat

Important Notice

Because Unicorn HAT uses the PWM hardware, which is also how your Raspberry Pi generates analog audio, you may see random colour patterns and flickering.

If this happens, you should add the following to your /boot/config.txt:

hdmi_force_hotplug=1

Sound will work fine using speakers on, for example, an HDMI TV, but you will not be able to use your Pi's 3.5mm audio jack in conjunction with Unicorn HAT.

unicornhat Python Library & Examples

Here you'll find everything you need to start lighting up your Unicorn HAT or pHAT using python.

Python users should probably ignore most of this repository and just:

Full install ( recommended ):

curl -sS https://get.pimoroni.com/unicornhat | bash

Install for Python 3:

sudo apt-get install python3-pip python3-dev
sudo pip3 install unicornhat

Install for Python 2:

sudo apt-get install python-pip python-dev
sudo pip install unicornhat

Install from GitHub

Note this library requires the rpi_ws281x Python library which you can find here: https://github.com/pimoroni/rpi_ws281x-python

git clone https://github.com/pimoroni/unicorn-hat
cd unicorn-hat/library/UnicornHat
sudo python setup.py install
cd ../..

Then proceed to examples.

Using with idle/idle3:

unicornhat needs root access to function. Please make sure you start LXTerminal and run idle or idle3 with the "sudo" command like so:

sudo idle

Error Codes

Sometimes Unicorn HAT may fail with an error code, this table details some of the places to look for answers in specific cases:

  • -1 Generic failure
  • -2 Out of memory
  • -3 Hardware revision is not supported - see: #70
  • -4 Memory lock failed
  • -5 mmap() failed - you probably forgot to run your code as root, use sudo python yourcode.py
  • -6 Unable to map registers into userspace
  • -7 Unable to initialize GPIO
  • -8 Unable to initialize PWM"
  • -9 Failed to create mailbox device
  • -10 DMA error
  • -11 Selected GPIO not possible
  • -12 Unable to initialize PCM
  • -13 Unable to initialize SPI
  • -14 SPI transfer error

Documentation & Support

Based Upon rpi_ws281x

unicornhat is based upon a modified, Pi 2/3 compatible version of the RPi ws281x Library by Jeremy Garff.

The library was modified by Richard Hirst.

RaspberryPi-NeoPixel-WS2812

Note: unicornhat is no longer based upon this library, but this information is included for posterity.

unicornhat was previously based upon a modified version of the ws2812 C driver from: https://github.com/626Pilot/RaspberryPi-NeoPixel-WS2812

unicorn-hat's People

Contributors

626pilot avatar ab-gh avatar basewanderer avatar bennuttall avatar carlholmberg avatar christophercayce avatar colinnewell avatar crozone avatar dglaude avatar euang avatar gadgetoid avatar jacobbramley avatar jibi avatar jimt avatar john-root avatar jsjrobotics avatar lovebootcaptain avatar lowfatcode avatar motzke avatar neauoire avatar paperclipstudio avatar pyroseza avatar r41d avatar reddog avatar roguem avatar sandyjmacdonald avatar sigv avatar threebytesfull avatar tkisason avatar unwitting 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  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

unicorn-hat's Issues

Colour value range?

When I try:

u.set_pixel(5, 5, 100, 100, 100)
u.show()

nothing happens. And when running the following loop:

for i in range(255):
    u.set_pixel(5, 5, i, i, i)
    u.show()
    sleep(0.1)
    print(i)

nothing comes on until it hits 110, and it lights up and the colour changes as the value increments.

Obviously RGBs like (255, 0, 0) and (255, 255, 0) work but nothing seems to come on when all three values are below 110. Is that right?

README: Install from Github clone

The Install from Github clone instructions appear to be out of date. The library/rpi-ws281x directory no longer exists in the repository.

And on a more minor level, I would suggest changing the header to capitalize it as GitHub.

munmap error -1, unmapmem() called on incorrect address

I own a Raspberry Pi 2 Model B. This is about the notorious munmap error -1.

First an strace reveals that munmap() is called on device->dma, with a size of 36 (it's 36 every time).

root@raspberrypi /tmp/unicornhat/c/unicorn # strace -e munmap,mmap2 ./unicorn anim/boom.png 2>&1| grep ", 36"
mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0x3f007) = 0x76fb4000
munmap(0x76fb4500, 36)                  = -1 EINVAL (Invalid argument)

root@raspberrypi /tmp/unicornhat/c/unicorn # strace -e munmap,mmap2 ./unicorn anim/boom.png 2>&1| grep ", 36"
mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0x3f007) = 0x76fcb000
munmap(0x76fcb500, 36)                  = -1 EINVAL (Invalid argument)

root@raspberrypi /tmp/unicornhat/c/unicorn # strace -e munmap,mmap2 ./unicorn anim/boom.png 2>&1| grep ", 36"
mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0x3f007) = 0x76fb5000
munmap(0x76fb5500, 36)                  = -1 EINVAL (Invalid argument)

root@raspberrypi /tmp/unicornhat/c/unicorn # strace -e munmap,mmap2 ./unicorn anim/boom.png 2>&1| grep ", 36"
mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0x3f007) = 0x76ef8000
munmap(0x76ef8500, 36)                  = -1 EINVAL (Invalid argument)

root@raspberrypi /tmp/unicornhat/c/unicorn # strace -e munmap,mmap2 ./unicorn anim/boom.png 2>&1| grep ", 36"
mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0x3f007) = 0x76f15000
munmap(0x76f15500, 36)                  = -1 EINVAL (Invalid argument)

Let's take the last two lines, from the last run:

 mmap2() at 0x76f15000
munmap() at 0x76f15500

munmap is always called at whatever we mapped at + 0x00000500.
I can't figure out where this offset is coming from.

Now, i've put in some debug messages in ws2811.c and mailbox.c (also turned on the already existing #define DEBUG).

// ws2811.c
static void unmap_registers(ws2811_t *ws2811)
{
    ws2811_device_t *device = ws2811->device;

    if (device->dma)
    {
        puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->dma\n");
        unmapmem((void *)device->dma, sizeof(dma_t));
        puts("ws2811.c -- This line printed after unmapmem(device->dma). unmapmem() went well.\n");
    }

    if (device->pwm)
    {
        puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->pwm\n");
        unmapmem((void *)device->pwm, sizeof(pwm_t));
        puts("ws2811.c -- This line printed after unmapmem(device->pwm). unmapmem() went well.\n");
    }

    if (device->cm_pwm)
    {
       puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->cm_pwm\n");
       unmapmem((void *)device->cm_pwm, sizeof(cm_pwm_t));
       puts("ws2811.c -- This line printed after unmapmem(device->cm_pwm). unmapmem() went well.\n");
    }

    if (device->gpio)
    {
      puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->gpio\n");
      unmapmem((void *)device->gpio, sizeof(gpio_t));
      puts("ws2811.c -- This is after unmapmem(device->gpio). unmapmem() went well.\n");
    }
}

Let's compile and run.

root@raspberrypi /tmp/unicorn-hat/c/unicorn # ./unicorn anim/redblue.png 
Requesting 4096 bytes
0000: 0x00000024
0004: 0x80000000
0008: 0x0003000c
000c: 0x0000000c
0010: 0x80000004
0014: 0x0000002a
0018: 0x00001000
001c: 0x00000004
0020: 0x00000000
0000: 0x0000001c
0004: 0x80000000
0008: 0x0003000d
000c: 0x00000004
0010: 0x80000004
0014: 0xfd7b2000
0018: 0x00000000
base=0x3d7b2000, mem=0x76f5b000
base=0x3f007000, mem=0x76f5a000
base=0x3f20c000, mem=0x76f59000
base=0x3f200000, mem=0x76f31000
base=0x3f101000, mem=0x76f30000
Calling unmap_registers() from ws2811_fini()

ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->dma

mailbox.c -- Calling unmapmem(0x76f5a500, 36)
mailbox.c -- unmapmem(): munmap error -1

It's exiting here unmapmem((void *)device->dma, sizeof(dma_t));, just as we saw on strace.

Alright, let's see what happens if we skip unmap on device->dma altogether.

// ws2811.c
static void unmap_registers(ws2811_t *ws2811)
{
    ws2811_device_t *device = ws2811->device;

    if (device->dma)
    {
     // puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->dma\n");
     // unmapmem((void *)device->dma, sizeof(dma_t));
     // puts("ws2811.c -- This line printed after unmapmem(device->dma). unmapmem() went well.\n");
    }

    if (device->pwm)
    {
        puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->pwm\n");
        unmapmem((void *)device->pwm, sizeof(pwm_t));
        puts("ws2811.c -- This line printed after unmapmem(device->pwm). unmapmem() went well.\n");
    }

    if (device->cm_pwm)
    {
       puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->cm_pwm\n");
       unmapmem((void *)device->cm_pwm, sizeof(cm_pwm_t));
       puts("ws2811.c -- This line printed after unmapmem(device->cm_pwm). unmapmem() went well.\n");
    }

    if (device->gpio)
    {
      puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->gpio\n");
      unmapmem((void *)device->gpio, sizeof(gpio_t));
      puts("ws2811.c -- This is after unmapmem(device->gpio). unmapmem() went well.\n");
    }
}

Compile and run.

root@raspberrypi /tmp/unicorn-hat/c/unicorn # ./unicorn anim/redblue.png 
Requesting 4096 bytes
0000: 0x00000024
0004: 0x80000000
0008: 0x0003000c
000c: 0x0000000c
0010: 0x80000004
0014: 0x0000002b
0018: 0x00001000
001c: 0x00000004
0020: 0x00000000
0000: 0x0000001c
0004: 0x80000000
0008: 0x0003000d
000c: 0x00000004
0010: 0x80000004
0014: 0xfd7b0000
0018: 0x00000000
base=0x3d7b0000, mem=0x76f47000
base=0x3f007000, mem=0x76f46000
base=0x3f20c000, mem=0x76f45000
base=0x3f200000, mem=0x76f1d000
base=0x3f101000, mem=0x76f1c000
Calling unmap_registers() from ws2811_fini()

ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->pwm

mailbox.c -- Calling unmapmem(0x76f45000, 40)
ws2811.c -- This line printed after unmapmem(device->pwm). unmapmem() went well.

ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->cm_pwm

mailbox.c -- Calling unmapmem(0x76f1c0a0, 8)
mailbox.c -- unmapmem(): munmap error -1

Now we're exiting at device->cm_pwm, which also fails to call the right memory location and has a (wrong) offset of (always) a0.

Well.. it has come to this so why not skip that too.

// ws2811.c
static void unmap_registers(ws2811_t *ws2811)
{
    ws2811_device_t *device = ws2811->device;

    if (device->dma)
    {
     // puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->dma\n");
     // unmapmem((void *)device->dma, sizeof(dma_t));
     // puts("ws2811.c -- This line printed after unmapmem(device->dma). unmapmem() went well.\n");
    }

    if (device->pwm)
    {
        puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->pwm\n");
        unmapmem((void *)device->pwm, sizeof(pwm_t));
        puts("ws2811.c -- This line printed after unmapmem(device->pwm). unmapmem() went well.\n");
    }

    if (device->cm_pwm)
    {
    // puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->cm_pwm\n");
    // unmapmem((void *)device->cm_pwm, sizeof(cm_pwm_t));
    // puts("ws2811.c -- This line printed after unmapmem(device->cm_pwm). unmapmem() went well.\n");
    }

    if (device->gpio)
    {
      puts("ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->gpio\n");
      unmapmem((void *)device->gpio, sizeof(gpio_t));
      puts("ws2811.c -- This is after unmapmem(device->gpio). unmapmem() went well.\n");
    }
}

Compile and run, now with both device->dma and device->cm_pwm unmaps commented out.

root@raspberrypi /tmp/unicorn-hat/c/unicorn # ./unicorn anim/redblue.png 
Requesting 4096 bytes
0000: 0x00000024
0004: 0x80000000
0008: 0x0003000c
000c: 0x0000000c
0010: 0x80000004
0014: 0x0000002c
0018: 0x00001000
001c: 0x00000004
0020: 0x00000000
0000: 0x0000001c
0004: 0x80000000
0008: 0x0003000d
000c: 0x00000004
0010: 0x80000004
0014: 0xfd7ae000
0018: 0x00000000
base=0x3d7ae000, mem=0x76f2c000
base=0x3f007000, mem=0x76f2b000
base=0x3f20c000, mem=0x76f2a000
base=0x3f200000, mem=0x76f02000
base=0x3f101000, mem=0x76f01000
Calling unmap_registers() from ws2811_fini()

ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->pwm

mailbox.c -- Calling unmapmem(0x76f2a000, 40)
ws2811.c -- This line printed after unmapmem(device->pwm). unmapmem() went well.

ws2811.c -- Now inside unmap_registers(): calling unmapmem on device->gpio

mailbox.c -- Calling unmapmem(0x76f02000, 180)
ws2811.c -- This is after unmapmem(device->gpio). unmapmem() went well.

Done calling unmap_registers()

Calling ws2811_cleanup() from ws2811_fini()

mailbox.c -- Calling unmapmem(0x76f2c000, 4096)
0000: 0x0000001c
0004: 0x80000000
0008: 0x0003000e
000c: 0x00000004
0010: 0x80000004
0014: 0x00000000
0018: 0x00000000
0000: 0x0000001c
0004: 0x80000000
0008: 0x0003000f
000c: 0x00000004
0010: 0x80000004
0014: 0x00000000
0018: 0x00000000
Done calling ws2811_cleanup()

Ha. We've reached ws2811_cleanup(). We have a clean exit. Well... clean but with garbage left in memory.

Now, i clearly do not know enough C to figure this out in a sensible amount of time, so that's why this issue here. If someone finds out what's with those offsets.. needless to say i'm burning here to understand this one. All my debugging here happened on a Pi2 Model B.

Thank you.

Towards a happier Hat!
--Adrian.

Simple example for Arduino

I know it is possible... but I have been too dumb to figure out what is needed (libraries, etc) / how to connect the hat - to an Arduino - for simple usage.

Any example / help would be much appreciated!

Note about disabling the sound card

The README.md needs to highlight the fact that the Unicorn Hat requires the Raspi sound card to be disabled. You can find numerous people on the Pimoroni msg board that learned this lesson the hard way.

Testing with RPi 2?

I am still seeing lingering issues of errors with RPi 2 and can confirm that running today, trying to control a 50 LED strand of WS2812's, python would hang when trying to create the channel for the strip.

Has there been any luck that I don't know of getting it to work with Pi 2? Anything that's been identified as a culprit to this problem?

terminate always calls exit with code 1

In the C function "terminate" the exit code is always one despite the fact that terminate takes in an int. Could this dummy value be used as the error code? This makes it possible to know if a given program terminated because of an error or request.

Kernel 4.1.4 error

I recently upgraded to kernel 4.1.4 and neopixel seems broken.

Traceback (most recent call last):
  File "light.py", line 4, in <module>
    import unicornhat as unicorn
  File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 13, in <module>
    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

name -a :
Linux jesse 4.1.4+ #808 PREEMPT Thu Aug 6 15:51:03 BST 2015 armv6l GNU/Linux

HTTP API / Flask Blueprint

TODO

See similar project from Scroll pHAT HD: pimoroni/scroll-phat-hd#41

I'm keen to add an HTTP API into Unicorn HAT, although the need for root (required for DMA blasting the PWM hardware) makes such an API a little problematic.

This API would then provide the backbone for an updated Mood Light example.

pip[3] install fails for unicornhat - Raspberry Pi 2

See log below:

t3chguy@Admin-RPi ~> sudo pip3 install unicornhat
Downloading/unpacking unicornhat
  Downloading unicornhat-2.0.4.tar.gz
  Running setup.py (path:/tmp/pip-build-1yzbpsjh/unicornhat/setup.py) egg_info for package unicornhat

Downloading/unpacking rpi-ws281x>=1.1.0 (from unicornhat)
  Downloading rpi_ws281x-1.1.3.tar.gz (102kB): 102kB downloaded
  Running setup.py (path:/tmp/pip-build-1yzbpsjh/rpi-ws281x/setup.py) egg_info for package rpi-ws281x

Installing collected packages: unicornhat, rpi-ws281x
  Running setup.py install for unicornhat

  Running setup.py install for rpi-ws281x
    Compiling ws281x library...
    building '_rpi_ws281x' extension
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-stron                                       g -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Ilib/ -I/usr/include/python3.4m -c rpi_ws281x_wrap.                                       c -o build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o
    rpi_ws281x_wrap.c: In function โ€˜PyInit__rpi_ws281xโ€™:
    rpi_ws281x_wrap.c:4638:21: warning: variable โ€˜mdโ€™ set but not used [-Wunused-but-set-variable]
       PyObject *m, *d, *md;
                         ^
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,rel                                       ro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_                                       SOURCE=2 build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o -Llib/ -lws2811 -o build/lib.linux-armv7l-3.4/_rpi_ws281x.                                       cpython-34m.so
    /usr/bin/ld: lib//libws2811.a(ws2811.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be                                        used when making a shared object; recompile with -fPIC
    lib//libws2811.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-1yzbps                                       jh/rpi-ws281x/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __fi                                       le__, 'exec'))" install --record /tmp/pip-3z7pd__f-record/install-record.txt --single-version-externally-managed                                        --compile:
    running install

running build

running build_py

Compiling ws281x library...

creating build

creating build/lib.linux-armv7l-3.4

copying neopixel.py -> build/lib.linux-armv7l-3.4

running build_ext

building '_rpi_ws281x' extension

creating build/temp.linux-armv7l-3.4

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -W                                       format -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Ilib/ -I/usr/include/python3.4m -c rpi_ws281x_wrap.c -o                                        build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o

rpi_ws281x_wrap.c: In function โ€˜PyInit__rpi_ws281xโ€™:

rpi_ws281x_wrap.c:4638:21: warning: variable โ€˜mdโ€™ set but not used [-Wunused-but-set-variable]

   PyObject *m, *d, *md;

                     ^

arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -                                       Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOUR                                       CE=2 build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o -Llib/ -lws2811 -o build/lib.linux-armv7l-3.4/_rpi_ws281x.cpyt                                       hon-34m.so

/usr/bin/ld: lib//libws2811.a(ws2811.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be use                                       d when making a shared object; recompile with -fPIC

lib//libws2811.a: error adding symbols: Bad value

collect2: error: ld returned 1 exit status

error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-1yzbpsjh/rpi-ws281x/setup.py';e                                       xec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install -                                       -record /tmp/pip-3z7pd__f-record/install-record.txt --single-version-externally-managed --compile failed with err                                       or code 1 in /tmp/pip-build-1yzbpsjh/rpi-ws281x
Storing debug log for failure in /home/t3chguy/.pip/pip.log

Exactly the same happens using pip install unicornhat

Fail to initialize library

pi@raspberrypi:~/Pimoroni/unicornhat $ sudo python demo.py Traceback (most recent call last): File "demo.py", line 3, in <module> import unicornhat as unicorn File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 14, in <module> ws2812.begin() File "/usr/local/lib/python2.7/dist-packages/neopixel.py", line 114, in begin raise RuntimeError('ws2811_init failed with code {0}'.format(resp)) RuntimeError: ws2811_init failed with code -1 Exiting cleanly pi@raspberrypi:~/Pimoroni/unicornhat $

Examples Not Installed

Hi I'm having problems installing this for my Unicorn pHat on a Pi 3, fresh install of Raspbian. The "Simple" installation goes OK until it gets to the examples section, then it throws the error as follows:

Successfully installed unicornhat rpi-ws281x
Cleaning up...
Done!

Downloading Unicorn HAT/pHAT examples...
Cloning into 'unicorn-hat'...
remote: Counting objects: 130, done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 130 (delta 20), reused 61 (delta 10), pack-reused 0
Receiving objects: 100% (130/130), 327.46 KiB | 0 bytes/s, done.
Resolving deltas: 100% (20/20), done.
Checking connectivity... done.
cp: cannot stat โ€˜/tmp/pimoroni.iGrsfE/unicorn-hat/python/examples//*โ€™: No such file or directory
Examples copied to /home/pi/Pimoroni/unicornhat/


The folders are there but the unicornhat subfolder is empty. I've tried it a couple of times with the same result, installed fine on a Pi 2 2 weeks ago.

Thanks!

kernel 4.1.6+ error with a cc1: error: unrecognized command line option โ€˜-fstack-protector-strongโ€™

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 4.1.6+ #810 PREEMPT Tue Aug 18 15:19:58 BST 2015 armv6l GNU/Linux
Log is below:
pi@raspberrypi ~ $ sudo pip install unicornhat
Requirement already satisfied (use --upgrade to upgrade): unicornhat in /usr/local/lib/python2.7/dist-packages/unicornhat-2.0.2-py2.7.egg
Downloading/unpacking rpi-ws281x>=1.0.1 (from unicornhat)
Downloading rpi_ws281x-1.2.0.tar.gz (123kB): 123kB downloaded
Running setup.py (path:/tmp/pip-build-34DjBZ/rpi-ws281x/setup.py) egg_info for package rpi-ws281x

Installing collected packages: rpi-ws281x
Running setup.py install for rpi-ws281x
Compiling ws281x library...
building '_rpi_ws281x' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilib/ -I/usr/include/python2.7 -c rpi_ws281x_wrap.c -o build/temp.linux-armv6l-2.7/rpi_ws281x_wrap.o
cc1: error: unrecognized command line option โ€˜-fstack-protector-strongโ€™
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-34DjBZ/rpi-ws281x/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-NOHEAg-record/install-record.txt --single-version-externally-managed --compile:
running install

running build

running build_py

Compiling ws281x library...

creating build

creating build/lib.linux-armv6l-2.7

copying neopixel.py -> build/lib.linux-armv6l-2.7

running build_ext

building '_rpi_ws281x' extension

creating build/temp.linux-armv6l-2.7

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilib/ -I/usr/include/python2.7 -c rpi_ws281x_wrap.c -o build/temp.linux-armv6l-2.7/rpi_ws281x_wrap.o

cc1: error: unrecognized command line option โ€˜-fstack-protector-strongโ€™

error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-34DjBZ/rpi-ws281x/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-NOHEAg-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-34DjBZ/rpi-ws281x
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 248, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 49: ordinal not in range(128)

unicornd broken?

Is somehow the unicornd broken? Can not get it working now.
I have installed the unicornd deamon and started it. But the test clients won't work. Will stay black.
If I run the normal python examples or the unicorn binary the leds will work. But only if I start the example twice. First run will also show nothing. The second run will show then the example (e.g. simple.py)

Any guess what could be the reason for unicornd stop working?

max brightness setting not 11

trying out your wonderful python library, the brightness function does not accept the value 11!
I feel this is a miss opportunity for an Easter egg :-)

Factor out actual shutdown code out into a separate function from terminate

I'm writting a Go wrapper around the ws2812-RPi C library for the unicorn hat and it seems that exit always called. This is potentially a bad thing for a language like Go since it can't shutdown cleanly (basically the rug is pulled out from under Go). While I already factored out the code into a separate C function for my Go library, would it be possible to do the same thing in the official C libraries to prevent duplication of effort?

Error in README.md

Having been playing with the code I've noted that the README.md file in python/unicorn-hat has an error. It states:

unicornhat.set_pixel( x, y, red, blue, green ) - Set a pixel in the buffer to the specified colour

which struck me as an odd way round. Having played with the settings and had trouble getting the colours I wanted I've confirmed that this should be:

unicornhat.set_pixel( x, y, red, green, blue ) - Set a pixel in the buffer to the specified colour

which is what I expected given it uses RGB colour codes :)

install error

I'm getting
bash: line 13: [: ==: unary operator expected
when running the main curl installer

It seems to carry on OK but it'd be off -putting for newcommers

More info for unicornd troubleshooting?

Trying to start unicornd from a service, but it's dying with only the limited debug output from systemd at the bottom. Is there a better way to troubleshoot this? Pi 3 A+. Thx.

unocornd.service

[Unit]
Description=Unicorn HAT daemon

[Service]
ExecStart=/usr/sbin/unicornd

[Install]
WantedBy=multi-user.target

journalctl -u unicornd.service

Dec 22 21:12:47 cuepi systemd[1]: Started Unicorn HAT daemon.
Dec 22 21:12:47 cuepi systemd[1]: unicornd.service: Main process exited, code=exited, status=1/FAILURE
Dec 22 21:12:47 cuepi systemd[1]: unicornd.service: Unit entered failed state.
Dec 22 21:12:47 cuepi systemd[1]: unicornd.service: Failed with result 'exit-code'.

Doesn't work?

Steps to reproduce:

sudo apt-get install python3-pip python3-dev
sudo pip-3.2 install unicornhat
wget https://raw.githubusercontent.com/pimoroni/UnicornHat/master/python/examples/rainbow.py
sudo python3 rainbow.py

or the equivalent Python 2 installation & command.

Expected: Something happens

Actual: Nothing happens

Am I missing something?

I've previously had it working with the ws2812 module.

What to do if you see: ws2811_init failed with code -1

Update

The rpi_ws281x part of the library has been moved out of this GitHub repository to its own home at: https://github.com/pimoroni/rpi_ws281x-python which will eventually build against the upstream version of the C source.

This newer version includes more detailed error messages and exit codes, you can look them up here: https://github.com/jgarff/rpi_ws281x/blob/f56929f79e75e253ca5bd230efb728c39f413e2b/ws2811.h#L93-L108

#define WS2811_RETURN_STATES(X)                                                             \
            X(0, WS2811_SUCCESS, "Success"),                                                \
            X(-1, WS2811_ERROR_GENERIC, "Generic failure"),                                 \
            X(-2, WS2811_ERROR_OUT_OF_MEMORY, "Out of memory"),                             \
            X(-3, WS2811_ERROR_HW_NOT_SUPPORTED, "Hardware revision is not supported"),     \
            X(-4, WS2811_ERROR_MEM_LOCK, "Memory lock failed"),                             \
            X(-5, WS2811_ERROR_MMAP, "mmap() failed"),                                      \
            X(-6, WS2811_ERROR_MAP_REGISTERS, "Unable to map registers into userspace"),    \
            X(-7, WS2811_ERROR_GPIO_INIT, "Unable to initialize GPIO"),                     \
            X(-8, WS2811_ERROR_PWM_SETUP, "Unable to initialize PWM"),                      \
            X(-9, WS2811_ERROR_MAILBOX_DEVICE, "Failed to create mailbox device"),          \
            X(-10, WS2811_ERROR_DMA, "DMA error"),                                          \
            X(-11, WS2811_ERROR_ILLEGAL_GPIO, "Selected GPIO not possible"),                \
            X(-12, WS2811_ERROR_PCM_SETUP, "Unable to initialize PCM"),                     \
            X(-13, WS2811_ERROR_SPI_SETUP, "Unable to initialize SPI"),                     \
            X(-14, WS2811_ERROR_SPI_TRANSFER, "SPI transfer error")                         \

The correct error code for an unsupported hardware revision is now -3, if you see this code please follow the instructions below.

Original post for posterity:

If you see the ws2811_init failed with code -1 message, a number of things could be going wrong since the error -1 is returned for all exceptions when initializing the ws2811 library.

The most common cause thus far, however, is a new, or unknown revision of Raspberry Pi which is not logged in the rpihw.c file. To determine your revision number run:

cat /proc/cpuinfo | grep Revision

Compare this against the numbers in: https://github.com/pimoroni/unicorn-hat/blob/master/library/rpi-ws281x/lib/rpihw.c

If you don't see your revision number there, let us know. You should also submit an issue against https://github.com/jgarff/rpi_ws281x, with details of your Pi.

Ambiguity with snow example

In the snow example line 36 says

row[randint(0, width - 1)] = 50 + randint(0, 155)

which yields a value between 50 and 205.

The comment in line 46 says

# val is between 50 and 255

but the maximum value that could come from the above calculation is 205.

Suggestion:

  • Either raise 155 to 205 (line 36)
  • or lower 255 to 205 (line 46)

Script didn't work

Hi,

Followed instructions on http://learn.pimoroni.com/tutorial/unicorn-hat/getting-started-with-unicorn-hat but terminal halted after this:

Checking install requirements...

Updating package indexes...
Hit http://archive.raspberrypi.org wheezy Release.gpg
Hit http://archive.raspberrypi.org wheezy Release                       
Hit http://archive.raspberrypi.org wheezy/main armhf Packages           
Hit http://raspbian.mirrors.lucidnetworks.net wheezy Release.gpg
Hit http://raspbian.mirrors.lucidnetworks.net wheezy Release
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB  
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Hit http://raspbian.mirrors.lucidnetworks.net wheezy/main armhf Packages
Hit http://raspbian.mirrors.lucidnetworks.net wheezy/non-free armhf Packages
Ign http://raspbian.mirrors.lucidnetworks.net wheezy/main Translation-en_GB
Ign http://raspbian.mirrors.lucidnetworks.net wheezy/main Translation-en
Ign http://raspbian.mirrors.lucidnetworks.net wheezy/non-free Translation-en_GB
Ign http://raspbian.mirrors.lucidnetworks.net wheezy/non-free Translation-en
Reading package lists... Done                                                                                                                                                              

Installing UnicornHat requirements...

Checking for python-pip...
python-pip already installed.

However, following instructions from #2 fixed the issue and I'm now pooping rainbows!

Think I've done something wrong (AttributeError: 'module' object has no attribute etc)

Think I've done something wrong here I am getting an error for all the methods on the unicorn library.

Expected: LEDs to turn on etc

Actual:

AttributeError: 'module' object has no attribute 'set_pixel'

AttributeError: 'module' object has no attribute 'show'

pi@dac:~/unicorn-hat/python/examples $ sudo pip2 install --upgrade unicornhat
Requirement already up-to-date: unicornhat in /usr/local/lib/python2.7/dist-packages/unicornhat-2.1.0-py2.7.egg
Requirement already up-to-date: rpi-ws281x>=2.0.0 in /usr/local/lib/python2.7/dist-packages/rpi_ws281x-2.0.1-py2.7-linux-armv6l.egg (from unicornhat)
Cleaning up...
pi@dac:~/unicorn-hat/python/examples $ sudo python2
Python 2.7.9 (default, Mar  8 2015, 00:52:26) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import unicornhat as uh
>>> uh.show()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'show'
>>> 

Few more:

pi@dac:~/unicorn-hat/python/examples $ python2 clock.py 
Traceback (most recent call last):
  File "clock.py", line 33, in <module>
    unicorn.rotation(0)
AttributeError: 'module' object has no attribute 'rotation'
pi@dac:~/unicorn-hat/python/examples $ python2 simple.py 
Traceback (most recent call last):
  File "simple.py", line 8, in <module>
    UH.set_pixel(x,y,255,0,255)
AttributeError: 'module' object has no attribute 'set_pixel'
pi@dac:~/unicorn-hat/python/examples $ python2 snow.py 
Traceback (most recent call last):
  File "snow.py", line 12, in <module>
    unicorn.brightness(0.4)
AttributeError: 'module' object has no attribute 'brightness'
pi@dac:~/unicorn-hat/python/examples $ 

corrupt disk when running unicorn-hat examples

This seems like hardware failure, but I've tried several sandisk 16GB and 8GB on a raspberry pi 3 and a raspberry pi W. After doing a full install of unicorn-hat, when I run this (as root) my disk times out (error -110) and the filesystem is mounted read only.

#!/usr/bin/env python

import math, sys
import time

import unicornhat as unicorn


print("""Rainbow

Displays a beautiful rainbow across your HAT/pHAT :D

If you're using a Unicorn HAT and only half the screen lights up, 
edit this example and  change 'unicorn.AUTO' to 'unicorn.HAT' below.
""")

unicorn.set_layout(unicorn.AUTO)
unicorn.rotation(0)
unicorn.brightness(0.5)
width,height=unicorn.get_shape()


print("Reticulating splines")
time.sleep(.5)
print("Enabled unicorn poop module!")
time.sleep(.5)
print("Pooping rainbows...")

elapsed = 0
if len(sys.argv) >= 2:
	elapsed = int(float(sys.argv[1]))
i = 0.0
offset = 30
start = time.time()
while True:
        i = i + 0.3
        for y in range(height):
                for x in range(width):
                        r = 0
                        g = 0
                        r = (math.cos((x+i)/2.0) + math.cos((y+i)/2.0)) * 64.0 + 128.0
                        g = (math.sin((x+i)/1.5) + math.sin((y+i)/2.0)) * 64.0 + 128.0
                        b = (math.sin((x+i)/2.0) + math.cos((y+i)/1.5)) * 64.0 + 128.0
                        r = max(0, min(255, r + offset))
                        g = max(0, min(255, g + offset))
                        b = max(0, min(255, b + offset))
                        unicorn.set_pixel(x,y,int(r),int(g),int(b))
        unicorn.show()
	if (time.time() - start) + elapsed >= 30*1:
		print "timeout"
		break
        time.sleep(0.01)

Dmesg says this:

[  131.687504] mmc0: cmd op 18 arg 0x541268 flags 0xb5 - resp 00000900 00000000 00000000 00000000, err 0
[  131.687511] mmc0: data blocks a0 blksz 200 - err 0
[  131.687521] mmc0: stop op 12 arg 0x0 flags 0x95 - resp 00000000 00000000 00000000 00000000, err 0
[  131.687525] mmc0: =========== REGISTER DUMP ===========
[  131.687530] mmc0: SDCMD  0x00000052
[  131.687535] mmc0: SDARG  0x00541268
[  131.687540] mmc0: SDTOUT 0x017d7840
[  131.687545] mmc0: SDCDIV 0x00000003
[  131.687549] mmc0: SDRSP0 0x00000900
[  131.687554] mmc0: SDRSP1 0x00001269
[  131.687558] mmc0: SDRSP2 0x7fffffff
[  131.687564] mmc0: SDRSP3 0x00024007
[  131.687568] mmc0: SDHSTS 0x00000001
[  131.687573] mmc0: SDVDD  0x00000001
[  131.687577] mmc0: SDEDM  0x00010902
[  131.687582] mmc0: SDHCFG 0x0000040e
[  131.687587] mmc0: SDHBCT 0x000001c0
[  131.687591] mmc0: SDHBLC 0x000000a0
[  131.687595] mmc0: ===========================================
[  131.687847] mmcblk0: error -110 transferring data, sector 5509736, nr 160, cmd response 0x900, card status 0xb00```

overloaded methods for colour tuples

I wrote some code for the Sense Hat that would be nice to port over. Could you create overloaded methods that allow for colour tuples like was done for the sense hat (and allow clear() to accept (r,g,b) even though set_all() does. Using a colour tuple is often preferable.
Thanks

Building unicornhat fails

sources: py-unicorn-hat-2.1.2.tar.gz
first i build UnicornHat, which succeeds, then rpi-ws281x
method: python setup.py build

building UnicornHat
running build
running build_py
creating build
creating build/lib
copying unicornhat.py -> build/lib
building rpi-ws281x
running build
running build_py
Compiling ws281x library...
creating build
creating build/lib.linux-armv7l-2.7
copying neopixel.py -> build/lib.linux-armv7l-2.7
running build_ext
building '_rpi_ws281x' extension
creating build/temp.linux-armv7l-2.7
gcc -DNDEBUG -Os -fomit-frame-pointer -pipe -fPIC -g -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -Ilib/ -I/usr/include/python2.7 -c rpi_ws281x_wrap.c -o build/temp.linux-armv7l-2.7/rpi_ws281x_wrap.o
gcc -shared -Wl,--as-needed -Wl,--as-needed -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-armv7l-2.7/rpi_ws281x_wrap.o -Llib/ -L/usr/lib -lws2811 -lpython2.7 -o build/lib.linux-armv7l-2.7/_rpi_ws281x.so
/usr/lib/gcc/armv6-alpine-linux-muslgnueabihf/5.3.0/../../../../armv6-alpine-linux-muslgnueabihf/bin/ld: cannot find -lws2811
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Use full brightness

Maximum brightness was changed.
Why was this done and how can I change it back?
Which commit/file contains the change?
Found the commit: 4679d4a

Would be nice to get some more details to know the risks. Used it in the past on full brightness, unicorn-hat board got quite warm but RasbPi was always stable (almost always, I remember now a few crashes with full brightness and on off flashing - not sure whether caused by unicorn-hat or poor power adapter).

Special command to override the brightness cap would be a nice solution - if you're using very low values to display darker colors, you have to re-adjust everything because of the cap. Just scaling the values modifies the colors (255,255,255 isn't a perfect neutral white for example and so on).

rpi-ws281x broken on the latest ArchLinux

With the latest ArchLinux release, running on an A+, unicornd is not working.
After digging a bit with gdb I found that the library stucks here

    while (!(cm_pwm->ctl & CM_PWM_CTL_BUSY))

which is at python/rpi-ws281x/lib/ws2811.c:261.

LEDs don't show as expected

I'm seeing an issue on my unicorn pHAT on my pizero running the latest raspbian jessie where the LEDs aren't triggering correctly...

using the set_pixel function doesn't work consistently and doesn't seem to line up properly even when the layout is set correctly.

The rainbow.py in the example/phat directory doesn't run correctly either. It flashes in random order as if something is wrong.

cannot get it work on Raspberry Pi 2 Model B

I followed the documentation as usal and installed the python/pip dependencies, then installed unicornhat via pip. Every attempt on running any of the examples ends up with a clean script execution with no errors, but the hat actually does nothing.

here are the output of the pip installation of unicornhat:

Downloading/unpacking unicornhat
  Downloading unicornhat-1.0.2.tar.gz
  Running setup.py egg_info for package unicornhat

Downloading/unpacking ws2812 (from unicornhat)
  Downloading ws2812-1.0.0.tar.gz (58Kb): 58Kb downloaded
  Running setup.py egg_info for package ws2812

    warning: no files found matching 'ws2812-RPi.h'
    warning: no files found matching 'ws2812-RPi.c'
    warning: no files found matching 'LICENSE.txt'
Installing collected packages: unicornhat, ws2812
  Running setup.py install for unicornhat

  Running setup.py install for ws2812
    building '_ws2812' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ilib/ -I/usr/include/python2.7 -c lib/ws2812-RPi.c -o build/temp.linux-armv7l-2.7/lib/ws2812-RPi.o
    In file included from lib/ws2812-RPi.c:1:0:
    lib/ws2812-RPi.h:95:1: warning: multi-line comment [-Wcomment]
    In file included from lib/ws2812-RPi.c:1:0:
    lib/ws2812-RPi.h:123:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:389:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:436:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:456:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:470:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:481:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.c: In function 'reverseWord':
    lib/ws2812-RPi.c:49:16: warning: variable 'bit' set but not used [-Wunused-but-set-variable]
    lib/ws2812-RPi.c: At top level:
    lib/ws2812-RPi.c:147:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.c:292:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.c:471:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.c: In function 'initHardware':
    lib/ws2812-RPi.c:569:3: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
    lib/ws2812-RPi.c: At top level:
    lib/ws2812-RPi.c:745:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.c: In function 'show':
    lib/ws2812-RPi.c:829:1: warning: "/*" within comment [-Wcomment]
    lib/ws2812-RPi.c:762:10: warning: unused variable 'color' [-Wunused-variable]
    lib/ws2812-RPi.c:758:15: warning: unused variable 'PWMWaveformBitPos' [-Wunused-variable]
    lib/ws2812-RPi.c:757:15: warning: unused variable 'LEDBuffeWordPos' [-Wunused-variable]
    lib/ws2812-RPi.c: At top level:
    lib/ws2812-RPi.c:839:1: warning: multi-line comment [-Wcomment]
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ilib/ -I/usr/include/python2.7 -c ws2812-RPi_wrap.c -o build/temp.linux-armv7l-2.7/ws2812-RPi_wrap.o
    In file included from ws2812-RPi_wrap.c:2967:0:
    lib/ws2812-RPi.h:95:1: warning: multi-line comment [-Wcomment]
    In file included from ws2812-RPi_wrap.c:2967:0:
    lib/ws2812-RPi.h:123:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:389:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:436:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:456:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:470:1: warning: multi-line comment [-Wcomment]
    lib/ws2812-RPi.h:481:1: warning: multi-line comment [-Wcomment]
    ws2812-RPi_wrap.c: In function 'init_ws2812':
    ws2812-RPi_wrap.c:4722:21: warning: variable 'md' set but not used [-Wunused-but-set-variable]
    ws2812-RPi_wrap.c: At top level:
    lib/ws2812-RPi.h:336:17: warning: 'virtbase' defined but not used [-Wunused-variable]
    lib/ws2812-RPi.h:338:31: warning: 'pwm_reg' defined but not used [-Wunused-variable]
    lib/ws2812-RPi.h:339:31: warning: 'clk_reg' defined but not used [-Wunused-variable]
    lib/ws2812-RPi.h:340:31: warning: 'dma_reg' defined but not used [-Wunused-variable]
    lib/ws2812-RPi.h:341:31: warning: 'gpio_reg' defined but not used [-Wunused-variable]
    lib/ws2812-RPi.h:359:31: warning: 'ctl' defined but not used [-Wunused-variable]
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-armv7l-2.7/lib/ws2812-RPi.o build/temp.linux-armv7l-2.7/ws2812-RPi_wrap.o -Llib/ -o build/lib.linux-armv7l-2.7/_ws2812.so

    warning: no files found matching 'ws2812-RPi.h'
    warning: no files found matching 'ws2812-RPi.c'
    warning: no files found matching 'LICENSE.txt'
Successfully installed unicornhat ws2812
Cleaning up...

then i downloaded an example from this repo and tried to run that:

pi@fwrpi ~ $ wget https://raw.githubusercontent.com/pimoroni/UnicornHat/master/python/examples/matrix.py
--2015-02-09 17:54:50--  https://raw.githubusercontent.com/pimoroni/UnicornHat/master/python/examples/matrix.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.17.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.17.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 981 [text/plain]
Saving to: `matrix.py.1'

100%[===========================================================================================>] 981         --.-K/s   in 0.001s  

2015-02-09 17:54:54 (1.28 MB/s) - `matrix.py.1' saved [981/981]

pi@fwrpi ~ $ chmod +x matrix.py
pi@fwrpi ~ $ sudo python matrix.py
^CTraceback (most recent call last):
  File "matrix.py", line 23, in <module>
    unicorn.show()
  File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 117, in show
    ws2812.show()
KeyboardInterrupt
pi@fwrpi ~ $ 

waited several seconds (up to 30) before that ctrl+c with no effect on the hat...

importing unicornhat hangs

import unicornhat hangs when it gets to:

noepixel.py
def begin(self):
resp = ws.ws2811_render(self._LEDS)

unicorn:~# python -m pdb /usr/lib/python2.7/site-packages/unicornhat.py
> /usr/lib/python2.7/site-packages/unicornhat.py(1)<module>()
-> from neopixel import *
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(2)<module>()
-> import atexit
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(3)<module>()
-> import colorsys
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(6)<module>()
-> LED_COUNT      = 64      # Number of LED pixels.
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(7)<module>()
-> LED_PIN        = 18      # GPIO pin connected to the pixels (must support PWM!).
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(8)<module>()
-> LED_FREQ_HZ    = 800000  # LED signal frequency in hertz (usually 800khz)
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(9)<module>()
-> LED_DMA        = 5       # DMA channel to use for generating signal (try 5)
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(10)<module>()
-> LED_BRIGHTNESS = 128     # Set to 0 for darkest and 255 for brightest
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(11)<module>()
-> LED_INVERT     = False   # True to invert the signal (when using NPN transistor level shift)
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(13)<module>()
-> ws2812 = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS)
(Pdb) n
> /usr/lib/python2.7/site-packages/unicornhat.py(14)<module>()
-> ws2812.begin()
(Pdb) n

[process hangs]

where ws2812.begin is import _rpi_ws281x as ws
[...]
def begin(self):
print('ay')
resp = ws.ws2811_render(self._LEDS)

_rpi_ws281x.so is build with musl libc

Here is the last bit of an strace

2083  stat64("colorsys", 0xbea91110)    = -1 ENOENT (No such file or directory)
2083  open("colorsys.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  open("colorsysmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  open("colorsys.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  open("colorsys.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  stat64("/usr/lib/python2.7/colorsys", 0xbea91110) = -1 ENOENT (No such file or directory)
2083  open("/usr/lib/python2.7/colorsys.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  open("/usr/lib/python2.7/colorsysmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2083  open("/usr/lib/python2.7/colorsys.py", O_RDONLY|O_LARGEFILE) = 4
2083  fstat64(4, {st_mode=S_IFREG|0644, st_size=3691, ...}) = 0
2083  open("/usr/lib/python2.7/colorsys.pyc", O_RDONLY|O_LARGEFILE) = 5
2083  readv(5, [{"", 0}, {"\3\363\r\nQ\247QWc\0\0\0\0\0\0\0\0\6\0\0\0@\0\0\0s\177\0\0\0d\0"..., 1024}], 2) = 1024
2083  fstat64(5, {st_mode=S_IFREG|0644, st_size=3975, ...}) = 0
2083  readv(5, [{"?g333333\343?g\354Q\270\36\205\353\321?g{\24\256G\341z\324?g\341z\24"..., 2958}, {"\3\363\r\nQ\247QWc\0\0\0\0\0\0\0\0\6\0\0\0@\0\0\0s\177\0\0\0d\0"..., 1024}], 2) = 2951
2083  readv(5, [{"\0\0\0s?\0\0", 7}, {"\3\363\r\nQ\247QWc\0\0\0\0\0\0\0\0\6\0\0\0@\0\0\0s\177\0\0\0d\0"..., 1024}], 2) = 0
2083  close(5)                          = 0
2083  close(4)                          = 0
2083  ioctl(1, TIOCGWINSZ, {ws_row=51, ws_col=144, ws_xpixel=864, ws_ypixel=663}) = 0
2083  writev(1, [{"ay", 2}, {"\n", 1}], 2) = 3
2083  open("/proc/cpuinfo", O_RDONLY|O_LARGEFILE) = 4
2083  readv(4, [{"", 0}, {"processor\t: 0\nmodel name\t: ARMv6"..., 1024}], 2) = 292
2083  _llseek(4, -27, [265], SEEK_CUR)  = 0
2083  close(4)                          = 0
2083  open("/dev/vcio", O_RDONLY|O_LARGEFILE) = 4
2083  ioctl(4, _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0x00, 0x04), 0xbea9221c) = 0
2083  ioctl(4, _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0x00, 0x04), 0xbea92224) = 0
2083  open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5
2083  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0xeb51000) = 0xb6f0c000
2083  close(5)                          = 0
2083  open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5
2083  mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x20007000) = 0xb6f0b000
2083  close(5)                          = 0
2083  open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5
2083  mmap2(NULL, 40, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x2020c000) = 0xb6f0a000
2083  close(5)                          = 0
2083  open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5
2083  mmap2(NULL, 180, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x20200000) = 0xb6f09000
2083  close(5)                          = 0
2083  open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5
2083  mmap2(NULL, 8, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x20101000) = 0xb6f08000
2083  close(5)                          = 0
2083  nanosleep({0, 10000}, 0xbea92298) = 0
2083  nanosleep({0, 10000}, 0xbea92298) = 0
2083  nanosleep({0, 10000}, 0xbea922a8) = 0
2083  --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
2083  getpid()                          = 2083
2083  sigreturn({mask=[]})              = 0

Garbled/Intermittent display on NOOBS 1.9.1 / Raspbian 2016-05-10 or newer

On Raspbian 2016-05-10 / NOOBS 1.9.1 booting to X seems to do something with analog audio, where it would have otherwise been left alone and worked, mostly, by sheer luck. You need to force your Pi to HDMI audio, thus leaving the PWM hardware that analog audio normally uses to Unicorn HAT, using these lines in /boot/config.txt

hdmi_force_hotplug=1
hdmi_force_edid_audio=1

( Use sudo nano /boot/config.txt to edit the file )

This pretends an HDMI monitor is plugged in, and that it supports audio.

You can also start in CLI mode, which doesn't load whatever audio stuff is being used in X and has the same effect.

unicornd daemon install fails

If I try to install the daemon from ~/unicorn-hat/c/unicornd
using sudo make install

I get the following error message:

cp unicornd /usr/sbin
cp: cannot stat `unicornd': No such file or directory
Makefile:11: recipe for target 'install' failed
make: *** [install] Error 1

Unicornhat via cgi Webinterface

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

Building rpi-ws281x fails on arch linux

I'm using Arch Linux ARM on my Raspberry Pi 3, about a year ago I used bendo's fork with the instructions from 0. Everything worked. Now I didn't just his fork 1 but also 2 and "pip install rpi_ws281x", but all of them fail while compiling with the error message "/usr/bin/ld: cannot find -lws2811". I already tried to adjust some of the include paths but wasn't able to resolve it. The default python version ("python") in Arch Linux is Python 3.

EDIT: Looks like it is the same issue like in 3, closed without solution. If you're building UnicornHat, rpi-ws281x gets compiled as a dependency.

Linux alarmpi 4.9.34-1-ARCH #1 SMP Mon Jun 26 01:32:24 UTC 2017 armv7l GNU/Linux
[alarm@alarmpi rpi-ws281x]$ gcc --version
gcc (GCC) 7.1.1 20170516

Using the official repo:

[alarm@alarmpi rpi-ws281x]$ sudo make
sudo rm -rf build
sudo ./setup.py build
running build
running build_py
Compiling ws281x library...
creating build
creating build/lib.linux-armv7l-3.6
copying neopixel.py -> build/lib.linux-armv7l-3.6
running build_ext
building '_rpi_ws281x' extension
creating build/temp.linux-armv7l-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -Ilib/ -I/usr/include/python3.6m -c rpi_ws281x_wrap.c -o build/temp.linux-armv7l-3.6/rpi_ws281x_wrap.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-armv7l-3.6/rpi_ws281x_wrap.o -Llib/ -L/usr/lib -lws2811 -lpython3.6m -o build/lib.linux-armv7l-3.6/_rpi_ws281x.cpython-36m-arm-linux-gnueabihf.so
/usr/bin/ld: cannot find -lws2811
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make: *** [Makefile:9: build] Error 1

Using pip:

[alarm@alarmpi rpi-ws281x]$ sudo pip install rpi_ws281x
Collecting rpi_ws281x
  Using cached rpi_ws281x-2.0.5.tar.gz
Installing collected packages: rpi-ws281x
  Running setup.py install for rpi-ws281x ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur01deto/rpi-ws281x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-f2_rqb8k-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    Compiling ws281x library...
    creating build
    creating build/lib.linux-armv7l-3.6
    copying neopixel.py -> build/lib.linux-armv7l-3.6
    running build_ext
    building '_rpi_ws281x' extension
    creating build/temp.linux-armv7l-3.6
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -Ilib/ -I/usr/include/python3.6m -c rpi_ws281x_wrap.c -o build/temp.linux-armv7l-3.6/rpi_ws281x_wrap.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-armv7l-3.6/rpi_ws281x_wrap.o -Llib/ -L/usr/lib -lws2811 -lpython3.6m -o build/lib.linux-armv7l-3.6/_rpi_ws281x.cpython-36m-arm-linux-gnueabihf.so
    /usr/bin/ld: cannot find -lws2811
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur01deto/rpi-ws281x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-f2_rqb8k-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ur01deto/rpi-ws281x/

Is it normal ?

Hi,

I bought unicorn phat and I installed in my raspi 2.

When I launch simple.py. I have already 3 leds lighted

img_20160912_174738

Normally the code show all led, no ?

And when I write :

unicorn.set_layout(unicorn.PHAT)
unicorn.brightness(0.8)
unicorn.rotation(0)

unicorn.set_pixel(0, 0, 255, 0, 0)

unicorn.show()

I have

img_20160912_174848

We are oki, it's not normal ?

Thanks

Doesn't work in IE11

Chrome
192.168.111.22 - - [27/Feb/2015 00:53:49] "GET /pixel/0/7/132/0/0 HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:53:49] "GET /show HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:53:49] "GET /pixel/1/7/132/0/0 HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:53:49] "GET /show HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:53:49] "GET /pixel/2/7/132/0/0 HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:53:51] "GET /show HTTP/1.1" 200 -

IE11 (Desktop and Windows Phone 8.1)
192.168.111.22 - - [27/Feb/2015 00:54:47] "GET /pixel/0/7/132/0/0 HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:54:48] "GET /pixel/1/7/132/0/0 HTTP/1.1" 200 -
192.168.111.22 - - [27/Feb/2015 00:54:48] "GET /pixel/2/7/132/0/0 HTTP/1.1" 200 -

IE is missing the /show [pun intended? :)]

unicorn-paint.js

function update_pixels(){
    var changed = false;
    $('td').each(function( index, obj ){
            if( $(obj).data('changed') ){
                    $(obj).data('changed',false);
                    changed = true;

                    var x = $(this).index();
                    var y = $(this).parent().index();
                    var col = tinycolor($(obj).css('background-color')).toRgb();

                    var data = [x,y,col.r,col.g,col.b];

                    $.get('/pixel/' + data.join('/'));
            }
    });
    if(changed){
            $.get('/show');
    }

Script stops after a few seconds when started on boot

I made a little script that shows a different color based on the hour of the day. When I run it by hand it runs properly. When I hook it up to a crontab or put it in rc.local, it goes for a couple seconds, then stops. I'm not really sure what causes it, but I do know that both crontab and rc.local have the same effect.

#!/usr/bin/env python
# @reboot /home/pi/clock.py >> /home/pi/clock.log 2>&1

import math
import time
import datetime
# datetime.datetime.now()

import unicornhat as unicorn

unicorn.set_layout(unicorn.AUTO)
unicorn.rotation(0)
unicorn.brightness(0.5)
width,height=unicorn.get_shape()

def mainLoop():
    i = 0.0;
    while True:
        current_time = datetime.datetime.now()
        current_hour = current_time.hour
        # orange, red for nighttime
        # blue, green for awake time
        if(current_hour <= 6):
            setLight(255, 0, 0, 0.2) # Low red
        elif(current_hour == 7):
            setLight(255, 128, 0, 0.2) # orange
        elif(current_hour == 8):
            setLight(65, 105, 225, (current_time.minute / 180.0)+0.2) # royal blue
        elif(current_hour > 20):
            setLight(255, 0, 0, 0.2) # Low red
        else:
            setLight(138, 43, 226, 0.5)
        i = i + 0.3
        unicorn.set_pixel(0,0,int(math.cos(i) * 64.0 + 128.0), 0, 0)
        time.sleep(0.1)

def setLight(r,g,b,intensity):
    unicorn.brightness(intensity)
    for y in range(height):
        for x in range(width):
            if(x == 0 and y == 0): # control pixel
                continue
            unicorn.set_pixel(x,y,int(r),int(g),int(b))
    unicorn.show()

mainLoop()

How can I to keep the led lighted ?

Hi,

I would like to turn on the led with command and turn off the led with another command

#!/usr/bin/env python

import argparse
import unicornhat as unicorn

unicorn.set_layout(unicorn.PHAT)
unicorn.brightness(0.2)

parser = argparse.ArgumentParser()

parser.add_argument("-sw", "--show", action="store_true", help="turn on the led")
parser.add_argument("-st", "--stop", action="store_true", help="stop the led")

args = parser.parse_args()

if args.show:
    for x in range(8):
        unicorn.set_pixel(x, 1, 255, 0, 255)
    unicorn.show()

elif args.stop:
    unicorn.off()

But when this script is executed (it's work) the leds turn off automaticly when the script python is finish Exiting cleanly

How can I to keep the led lighted ?

Thanks

ws2811_init failed with code -1

I have recently wiped my Raspi (model b 2) and I'm now unable to use my unicorn hat.

Using the matrix example running as sudo the following happens:

pi@raspberrypi:~/Pimoroni/unicornhat $ sudo ./matrix.py
Traceback (most recent call last):
File "./matrix.py", line 3, in
import unicornhat as unicorn
File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 14, in
ws2812.begin()
File "/usr/local/lib/python2.7/dist-packages/neopixel.py", line 114, in begin
raise RuntimeError('ws2811_init failed with code {0}'.format(resp))
RuntimeError: ws2811_init failed with code -1
Exiting cleanly

Python 3 doesn't work.

Using the curl setup in the README doesn't work on python3 and produced:
Traceback (most recent call last): File "rainbow.py", line 6, in <module> import unicornhat as unicorn File "/usr/local/lib/python3.5/dist-packages/unicornhat.py", line 3, in <module> from rpi_ws281x import __version__ as __rpi_ws281x__, PixelStrip, Color ImportError: cannot import name '__version__' when using import unicornhat

even a sudo pip3 install unicornhat doesn't work.

Audio issue

I have a speaker connected to my A+. I have set the audio output to the 3.5mm jack. Launching python examples causes sound glitches. Is it normal ?

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.