07-30-2015 01:55 AM
Hello
I am trying to measure the temperatue with TEMPer USB Thermometer, using 1 USB port on my CGR1120. This port is mapped to the GOS and device is correctly discovered with dmesg. As a next step, I have found that it can be used in Linux, using libusb 0.1 library and I also found a C code, ready for getting the temperature ( code from Relavak labs: http://www.relavak.com/downloads/temper-1.0.tgz ). So I have compiled the code with static linking, so I can bring the libusb within binary and moved the binary to GOS. However, I only recieve error messages after running the binary:
root@CGR1000-GOS-1:/software/temper-sw# ./temper
Found device: 1130:660c
Found deviceNum 0
Trying to detach kernel driver
Device already detached
Device already detached
TemperCreate: Broken pipe
I tried the same binary on another Linux machine, with same architecture i686 and it worked flawlessly. So I assumed it must be something platform specific, maybe something in Yocto or kernel?
I know the information is very vague, but I am completely new to low-level programming and I don't really know where to work on fix.
Thanks for any help or suggestions.
07-30-2015 02:45 AM
Hi Lukas,
As CGR1120 is running Yocto Linux on an X86 processor, generally speaking it should be working for the applications built from a general Linux with kernel of 3.8 or above.
Regarding your case, you'd better do some debug (usb_set_debug(x)), and add some print information in the source code to get the exact point of failure. Hope it helps.
Thanks,
Steve
03-15-2016 06:19 AM
Hi Steve,
I do some testing around this case. The Thermometer is correctly detected by kernel and I can see the configuration of the usb device. But when I sending something via usb_control_msg() (https://www.kernel.org/doc/htmldocs/usb/API-usb-control-msg.html) I still getting: connection timeout. When the timeout is set to 0 the program never ends. I am not sure if this issue is kernel or hardware or what can I do next.
Thanks for any help or suggestions.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide