Blinkstick on breadboard

Hello,
I have downloaded the v1.0 firmware and I’m trying to create a blinkstick on a breadboard.
I have declared my programmer (I used an Arduino Uno) in the Makefile and I flashed the firmware on a Attiny85 without any changes in the code.
I hooked up the wires/diodes/capacitors with the microcontroller and a common anode RGB LED and connected everything using a USB cable with my Mac. I installed libusb, pip and blinkstick Python package.
The RGB flashes in white colour every 6 seconds but I cannot control it.
I installed this library on Processing but I get the message: “Not found…”
What else should I do?
Should I declare anything else in the firmware code before flashing the microcontroller?

You also have to write EEPROM for BlinkStick and set fuses. For this you will need:

  • serial.txt file with 0 inside it
  • Ruby interpreter
  • Hex gem

The easiest way to do everything is to run the following command:

make deploy

It automatically programs the chip, increments serial, flashes EEPROM and sets fuses.

Alternatively you can run the following command which will only write EEPROM and set fuses:

make defaults fuse

As long as you already have BlinkStick package for Python installed, you can run the following command to see if BlinkStick is detected:

blinkstick --info

Test the color control:

blinkstick red
blinkstick --pulse blue

If it shows the information about BlinkStick and you can control it, then you can use Processing.

Happy hacking! :wink:

Thanks for your reply.
I followed your instructions (hadn’t noticed the serial.txt file) and it seems to work now.
I had [this][1] error but solved it following your instructions.
Giving the command:

blinkstick --info

I get this:

Found device:
    Manufacturer:  Agile Innovative Ltd
    Description:   BlinkStick
Traceback (most recent call last):
  File "/usr/local/bin/blinkstick", line 308, in <module>
    sys.exit(main())
  File "/usr/local/bin/blinkstick", line 254, in main
    print_info(stick)
  File "/usr/local/bin/blinkstick", line 80, in print_info
    print("    Serial:        {0}".format(stick.get_serial()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-11: ordinal not in range(128)

Also the serial number of the device appearing with strange characters (ÿÿÿÿÿÿÿÿÿÿÿÿ). Is there any way to fix this?

I’m trying to control it remotely with this command

blinkstick --connect access_code 

but I get this

BlinkStick control script 1.1.5
(c) Agile Innovative Ltd 2013-2014

Usage: blinkstick [options] [color]

blinkstick: error: no such option: --connect

One other thing about the schematic of v1.0(not pro) was the wrong colors on my rgb led. I fixed this by connecting:
red > resistor > pin 3
green > resistor > pin 6
blue > resistor > pin 5

Next thing is to create my homemade blinkstick using a single layer PCB. I have already designed it in Kicad and soon it will be alive.
[1]: https://github.com/arvydas/blinkstick-python/wiki/NotImplementedError-is_kernel_driver_active-on-some-Linux-systems

Strange serial number indicates that EEPROM hasn’t been written. I think you need to run this command:

make increment defaults

Once you write the serial number, the “blinkstick --info” command should work fine.

The --connect option was removed to simplify the package. You can find the explanation and how to write your own script together with required dependencies in the Python example to BlinkStick Control Remotely.

The v1.0 was designed for Piranha LED. There have been a few version of the LED so the pinout may have changed. Good luck with the home made PCB! :smiley:

I’m on a Mac with OS X Yosemite and I get this when I try to write the EEPROM:

ruby increment.rb
/Library/Ruby/Gems/2.0.0/gems/hex-0.2.0/lib/wo_oo/electronics/intel_hex_grammar.rb:101: warning: assigned but unused variable - line_data
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- treetop (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Library/Ruby/Gems/2.0.0/gems/hex-0.2.0/lib/wo_oo/electronics/intel_hex_grammar.rb:4:in `<top (required)>'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/username/Desktop/blinkstick-firmware-master/intel_hex.rb:1:in `<top (required)>'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from increment.rb:4:in `<main>'
make: *** [increment] Error 1

edit: I installed treetop:

sudo gem install treetop

everything is fine now. The info is this:

Manufacturer:  Agile Innovative Ltd
    Description:   BlinkStick
    Serial:        BS000001-1.0
    Current Color: #000000
    Mode:          -1
    Info Block 1:  
    Info Block 2:

Yep, everything looks good with the --info :smiley:

Let me know if you need anything else and please post the pics of your homebrew BlinkStick to Projects category! I’d love to see what you come up with :smile:

I try to control it remotely but there is a problem.
I registered a new device and when I run the python script I can see that my device is online.
I select a color and receive on Terminal something like that: “Received color: #5e4431” but nothing happens on my led.
I replaced the r,g,b with random values in this line:

bstick.set_color(r, g, b)

having something like that

bstick.set_color(50, 50, 200)

but nothing happened. Then replaced the above line with this:

bstick.set_random_color()

and each time I select a new color my led turns on with a new random color.


edit:
fixed this by changing the above line to:

bstick.set_color(red=r, green=g, blue=b)

Oh, thanks for this! I’ve updated the example script with the fix you suggested.

i’ve just been dealing with the same issue. really enjoying working with blinkstick. i’m using it with neopixels strip.

if you run blickstick --info

it returns:
Traceback (most recent call last):
File “/usr/local/bin/blinkstick”, line 308, in
sys.exit(main())
File “/usr/local/bin/blinkstick”, line 254, in main
print_info(stick)
File “/usr/local/bin/blinkstick”, line 78, in print_info
print(" Manufacturer: {0}".format(stick.get_manufacturer()))
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u0409’ in position 0: ordinal not in range(128)

Could you make the blinkstick python ‘first timer’ for Mac docs clearer, its missing the USB lib downgrade.

Did the downgrade sort the issue? I’ll probably release a new version of BlinkStick Python module in order to link it directly to b1 release of PyUSB.

yes. downgrade solved it. i’d recommend the PyUSB downgrade by default as it just breaks too many things.

@marks thanks for your help! I released a new version of BlinkStick Python module to address this issue. Installation should be a lot more smooth now :smile:

Hello folks,
I’ve build the Blinkstick Pro using a ATtiny45-20 on a breadboard. Got the firmware downloaded and compiled using the cli tools from Atmel Studio 6 version 6.0.1996 SP 2 with ARM Toolchain 4.7.0.59 - GCC 4.7.0 successfully for target attiny45. Also generated the eeprom.hex, flashed this and main.hex via AVR.Dragon. Set the fuses to LowFuse = 0xE1 and HighFuse = 0xDD. All looks fine until I give it a try … All I get in Windows 7 is “Unknown Device” if I plug it into a USB Port. If I try it on my Raspberry Pi I find usb read error like this

Feb 18 17:55:17 raspberrypi kernel: [ 4190.628944] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
Feb 18 17:55:17 raspberrypi kernel: [ 4190.708988] usb 1-1.3: device descriptor read/64, error -32
Feb 18 17:55:17 raspberrypi kernel: [ 4190.898958] usb 1-1.3: device descriptor read/64, error -32
Feb 18 17:55:17 raspberrypi kernel: [ 4191.088958] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
Feb 18 17:55:17 raspberrypi kernel: [ 4191.168977] usb 1-1.3: device descriptor read/64, error -32
Feb 18 17:55:17 raspberrypi kernel: [ 4191.359496] usb 1-1.3: device descriptor read/64, error -32
Feb 18 17:55:18 raspberrypi kernel: [ 4191.548992] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
Feb 18 17:55:18 raspberrypi kernel: [ 4191.968882] usb 1-1.3: device not accepting address 6, error -32
Feb 18 17:55:18 raspberrypi kernel: [ 4192.049010] usb 1-1.3: new full-speed USB device number 7 using dwc_otg
Feb 18 17:55:18 raspberrypi kernel: [ 4192.468886] usb 1-1.3: device not accepting address 7, error -32
Feb 18 17:55:18 raspberrypi kernel: [ 4192.469106] hub 1-1:1.0: unable to enumerate USB device on port 3

in the syslog.

Do you have any hints for me? What am I doing wrong?

BTW: On the RPi I install the python-pip package and than via “pip install blinkstick” the python-blinkstick stuff. Also executed “blinkstick --add-udev-rule” and rebooted. The command “blinkstick --info” show nothing … my blinkstick is not recognised by the OS.

Kind regards,
birko

If you are making a Pro based BlinkStick on a breadboard, you need to use the pro branch on Github. Did you use this one?

Thanks! You are right. I’ve grabed the wrong firmware. Also the pro firmware will not fitt on a ATtiny45.

Yes, but I think you can minimize the API to support ATTiny45. First thing to do is to drop LED count to 32, this might be sufficient to fit into 45.

Today I got the ATTiny85 so nothing to change in the code. Will get a IKEA Dioder and play with it at the weekend. With a single NeoPixel it is currently working very well. ;-D

Thanks for your support!

Thanks for letting me know it works for you. Have fun! :smiley:

I got one of these tiny85 dev boards and I thought it would be nice to use it as a blinkstick.

I In the Makefile the first line says:
SHELL=C:/Windows/System32/cmd.exe
I removed it since I’m working on a Mac and it was giving me an error.
I tried to upload the firmware with
```make deploy``
and there wasn’t any error.
When I connect this board with a microusb cable it cannot be recognized.
I think it’s the same circuit with blinkstick except the resistor values.
What could be the problem? Is it possible to use it as blinkstick? Has anyone tried a board like this with blinkstick firmware?

Do you have the schematics for the board? The firmware will probably have to be adjusted and I need to know how the USB signals are connected to ATTIny85.