todbot / blink1

Official software for blink(1) USB RGB LED by ThingM
https://blink1.thingm.com/
Other
953 stars 237 forks source link

Blink(1) mk2 Device w/Buildroot | "no blink(1) devices found" error #334

Open lukemk1 opened 6 years ago

lukemk1 commented 6 years ago

Hello,

I had previous bought one of the blink(1) mk2 devices for testing with an embedded system that I am working on a proof-of-concept for.

I am utilizing Buildroot (link) for creating my embedded system image, with Linux kernel version 4.4.43-v7, and have attempted to get it working.

I am using the pre-compiled raspberry pi blink1-tool executable (found here), but am unable to get the LEDs to trigger.

I am continually greeted with the "no blink(1) devices found" error. I have used the following command, both with and without "sudo" prefixing it (utilizing the udev rule for the non-sudo user), just to do a quick test:

(sudo) ./blink1-tool-rpi -t 400 --random 100

I can see the usb device via "lsusb" (Bus 001 Device 005: ID 27b8:01ed), but it appears that the physical device and application are not linking up.

I have been able to get the blink(1) device working with regular Ubuntu and Raspbian images (I tested this in hopes to glean any information I could, unfortunately this did not get me anywhere).

If you have an ideas how I would be able to get the blink(1) to function on under an embedded buildroot device that would be greatly appreciated.

I could be missing a step somewhere along the way, so I would appreciate your thoughts.

Thanks.

todbot commented 6 years ago

Hi @lukemk1, A few questions:

Assuming all of the above suggest that your host hardware and Linux is seeing the device just fine, I am thinking you will need to recompile blink1-tool for your system. There is enough variability in device drivers and shared libraries among Linuxes that when binary-compatible, they aren't device-driver compatible.

Are there steps I could follow to recreate the buildroot you're making?

Not related but could affect you: I'm in the process of moving blink1-tool and its attendant C-library to its own repo: https://github.com/todbot/blink1-tool You will see the "commandline" directory disappear in the next few days to be replaced by a submodule link to the blink1-tool repo.

lukemk1 commented 6 years ago

Hi @todbot,

I could attempt to add the source and compile it with the other buildroot processes if nothing else would work. I was just hoping to avoid that since it would add some complexity.

I can provide you with the defconfig I am using for my buildroot configuration. Of course you will be missing some of my specific packages which would have to be deselected, but that shouldn't cause any issues if you want to try it.

Let me know if I can provide you with anything else.

lukemk1 commented 6 years ago

Update:

I have compiled the blink-tool from source into my Buildroot generated embedded system but the blink-tool gets the following error:

./blink1-tool: line 6: syntax error: unexpected "(" (expecting ")")

I am going to try compiling the mini-tool and see if that is any better.

todbot commented 6 years ago

Hi, I'm confused. Is your embedded system a Raspberry Pi or something? Are you trying to cross-compile blink1-tool or compile on the target system?

lukemk1 commented 6 years ago

My system is a Raspberry Pi and I am cross-compiling via the Buildroot tool.

todbot commented 6 years ago

So you are running Raspbian on a Raspberry Pi and building a buildroot Linux kernel to also run on a Raspberry Pi?

lukemk1 commented 6 years ago

No, there is not a standard operating system running. Buildroot is a tool which cross-compiles the entire embedded filesystem image from the given parameters.

So I'm on my Ubuntu host machine, utilizing the buildroot tool (which cross-compiles everything I give it) to generate the filesystem image.

Update: I tried cross-compiling the mini-tool as well and received the following error on the embedded system: ./blink1-mini-tool: line 1: syntax error: unexpected ")"

todbot commented 6 years ago

Okay, that's what I was expecting. The reason I asked is that kind of error can happen trying to run a binary compiled for one system on another.

Do you have the steps you used to get to the point where you can compile blink1-tool or blink1-mini-tool so I can try to replicate what you're seeing?

(I have many Raspberry Pis so one can be repurposed for buildroot tests)

lukemk1 commented 6 years ago

Okay. It's a bit odd since the cross-compiling works for everything else that I've been creating.

Certainly, I can give you the steps. It will probably take me a day since I'm in-between some other things currently.

Thanks for your help!

lukemk1 commented 6 years ago

I finally got around to this.

So these are the steps you should need to take to get this up and running on a Raspberry Pi 3 Model B.

1) Download buildroot here

2) Download my customizations here

3) Extract buildroot and then extract my customizations to the same folder to add them.

4) Navigate to the buildroot directory in a terminal and run the following commands:

sudo make clean
sudo make rpi3_instalink_defconfig
sudo make

This will take sometime to build (approx. 30-40 minutes). After the image is built you can use the following command to write it to an SD card:

sudo dd if=output/images/sdcard.img of=DISK_NAME bs=1M

where DISK_NAME is something like "/dev/sdb"

5) Insert the SD card into the Raspberry Pi.

You should be able to run the OS now, and can see that the blink tool doesn't seem to work.

Let me know if you run into any issues getting this running.

lukemk1 commented 6 years ago

Hi @todbot,

I wanted to ping you to see if you have been able to test this out or need any further information from me.

Thanks!

lukemk1 commented 6 years ago

Hi @todbot,

It's been awhile so I wanted to ping you to see if you have been able to test this out or need any further information from me.

Thanks!