Closed wsv-accidis closed 9 years ago
Hi! On Linux, you'll need to either run the programs as the "root" user (with "sudo" for instance), or install a udev-rule like the one in this directory: https://github.com/todbot/blink1/tree/master/linux
Thanks for your quick reply. I am logged in as root already (I know this is bad practice, but it makes things a lot easier when tinkering). Maybe I still need to add a rule.
Is udev something I need to have installed in order to use blink1? I can't find a clear reference on whether the Linux on my NAS has it by default. Any easy way to check?
Did you recompile the blink1-tool binary too?
Also, if you're running as root, you don't need to worry about udev stuff. But it might be the Synology's kernel doesn't support libusb-style access, only hidraw or even something else. What's the link to how you got cross-compilation going? I'd like to read up on it. Thanks!
I haven't been able to compile blink1-tool on the Synology, I downloaded a binary release for Linux-i686. If I could build it, I could try the HIDDATA/HIDRAW modes. Right now I think it's complaining about missing dependencies.
Cross-compiling would also be an option I guess but I've no clue how that works as of yet... as I mentioned, bit of a newbie, and I'm thinking the issues I am having compiling blink1-tool on the NAS are probably mostly due to that.
FWIW, here are the compiler errors I'm getting:
Building for OS=linux BLINK1_VERSION=v0-linux-x86_64 USBLIB_TYPE=HIDAPI
cc -DUSE_HIDAPI -I./hidapi/hidapi `pkg-config libusb-1.0 --cflags` -fPIC -std=gnu99 -g -DBLINK1_VERSION=\"""v0"-linux-"x86_64""\" -c blink1-tool.c -o blink1-tool.o
cc -DUSE_HIDAPI -I./hidapi/hidapi `pkg-config libusb-1.0 --cflags` -fPIC -std=gnu99 -g -DBLINK1_VERSION=\"""v0"-linux-"x86_64""\" -g ./hidapi/libusb/hid.o blink1-lib.o `pkg-config libusb-1.0 --libs` -lrt -lpthread -ldl blink1-tool.o -o blink1-tool
./hidapi/libusb/hid.o: In function `read_thread':
/root/blink1/commandline/hidapi/libusb/hid.c:760: undefined reference to `libusb_handle_events_completed'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/librt.so: undefined reference to `__librt_enable_asynccancel@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libpthread.so: undefined reference to `__libc_sigaction@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/librt.so: undefined reference to `__librt_multiple_threads@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/librt.so: undefined reference to `__librt_disable_asynccancel@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libpthread.so: undefined reference to `_h_errno@GLIBC_2.0'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libpthread.so: undefined reference to `__on_exit@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libdl.so: undefined reference to `_dl_open@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libdl.so: undefined reference to `_dl_close@GLIBC_PRIVATE'
/opt/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib/libpthread.so: undefined reference to `_errno@GLIBC_2.0'
collect2: ld returned 1 exit status
make: *** [blink1-tool] Error 1
Note, the Synology doesn't have cc, it's actually using gcc. Not sure if this matters.
Ahh, yes, blink1-tool has dependencies that are difficult to satisfy on the smaller embedded Linuxes.
There is a stripped-down tool called "blink1-mini-tool" that uses libusb-0.1 in blink1/commandline/blink1-mini-tool
. Change into that directory and do a make
. That has many fewer dependencies and so should compile if your libusb also has the older function names.
Are you compiling these by sshing into the Synology and compiling directly on it? If so, that's cool, I need to get me one of these.
Blink1-mini-tool compiled and runs just fine, thank you so much for your help! Now I just need to write the software to update the light from what's going on in the NAS. I'm probably going to start off using it as a status light for CrashPlan.
Yeah, the embedded Linux on the Synology is surprisingly competent once you install a development toolchain and package manager. I can wholeheartedly recommend it. Mine is the DS415+.
One oddity with blink1-mini-tool. It seems to work fine but it starts every run printing this error message:
Warning: cannot detach kernel driver from interface 0: could not detach kernel driver from interface 0: No data available
I am trying to use the blink(1) as a status light for an embedded Linux device, a Synology NAS (DS415+). I have managed to build and install libusb-1.0.9 and the blink(1) shows up just fine in lsusb:
And in /dev/bus/usb/devices:
Clearly the device is present but completely unrecognized by blink1-tool. I get the standard "no blink(1) devices found" message. I tried using the blink1raw tool but the hidraw* devices are not present.
Any suggestions on how to troubleshoot this? I am using blink1-tool-v1.6-linux-i686 because it was the newest I could find for i686 Linux.