User avatar
PeterO
Posts: 5005
Joined: Sun Jul 22, 2012 4:14 pm

Watterott 8x8 working

Tue Mar 24, 2015 8:51 pm

Somewhere at the Pi Party the other week I acquired one of these http://www.watterott.com/en/RPi-WS2812-HAT

I've finally got round to giving it a try, and after a bit of "phap" it is working (ish). I have a build of the Arduino IDE (1.6) on a PI2 and I tried using that to reprogram the board as an I2C slave.
But be warned, the tools provided have an X86 executable buried in them and I had to rebuild that for the PI, You can get the sourc code from here
https://github.com/watterott/wattuino/t ... ommandline

However running the Random.py demo it seems unstable and keeps stopping with an IOError when executing

Code: Select all

bus.write_i2c_block_data(addr, x, [r, g, b]) #led red green blue  
I've tried it at the lowest I2C speed and it is still unstable :-( Maybe this is why they were given away ?

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

awatterott
Posts: 8
Joined: Sat Aug 23, 2014 11:14 am
Contact: Website

Re: Watterott 8x8 working

Wed Mar 25, 2015 11:48 am

Hi,
I also had the IOError problems, and lowering the I2C baudrate (<= 20kHz) fixed it. In the mean time I read about the I2C clock stretching problem and I think it has to do something with it. Currently I am looking into it and I will try to make workaround for the ATtiny85 Arduino lib.

Here are some topics about the problem:
http://www.raspberrypi.org/forums/viewt ... 41&t=52517
http://www.raspberrypi.org/forums/viewt ... 32&t=81751
http://www.raspberrypi.org/forums/viewt ... 44&t=13771
https://github.com/raspberrypi/linux/issues/254
http://stackoverflow.com/questions/1524 ... an-arduino

Regards
Andreas

awatterott
Posts: 8
Joined: Sat Aug 23, 2014 11:14 am
Contact: Website

Re: Watterott 8x8 working

Wed Mar 25, 2015 7:33 pm

Hi,
I found a solution. The problem seems to appear if the I2C interrupts can not be executed fast enough on the ATtiny85. I have now disabled the timer interrupts in the I2C-Slave example and on my RPi 2 (I2C @ 400kHz) the communication works without the IOError errors.

https://github.com/watterott/RPi-WS2812 ... _Slave.ino

Regards
Andreas

User avatar
PeterO
Posts: 5005
Joined: Sun Jul 22, 2012 4:14 pm

Re: Watterott 8x8 working

Wed Mar 25, 2015 7:49 pm

Yes that certainly seems to have fixed it..

Thanks for the quick fix :-)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5005
Joined: Sun Jul 22, 2012 4:14 pm

Re: Watterott 8x8 working

Sun Mar 29, 2015 8:08 pm

My Binary Clock code for this board is now up at https://github.com/watterott/RPi-WS2812 ... master/src
At the moment the code there has a bug! It uses gmtime instead of localtime to get the current time of day.
The problem only became apparent this morning as it was still showing UTC and not BST !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Return to “Troubleshooting”