Reading Weighing scale data from USB host in Yun

Hello,

I have weighing scale machine which support USB interface to report the weight of the item. I have connected that USB interface to the Arduno Yun's USB host. I found it connected/listed under /dev/bus/usb/001/00X. I would like to know how to read incoming weight from that interface.

I tried below stuff without success:

  1. When I connect that USB inteface on WIndows box, I get a COM port and I am able to read the weight there.

  2. I don't see this device under /dev/input/eventX.

  3. I tried running python script that opens '/dev/bus/usb/001/00X' and dumps data but no success.

  4. 'lsusb' command list my device '/dev/bus/usb/001/00X' so I believe there are enough drives already installed.

Do you have the correct usb/serial driver installed? If so, you should see a /dev/ttyUSBx device.

kind regards,

Jos

I have below drivers installed (related to USB)

kmod-usb-acm 3.8.3-1
kmod-usb-core 3.8.3-1
kmod-usb-hid 3.8.3-1
kmod-usb-serial 3.8.3-1
kmod-usb-serial-ftdi 3.8.3-1
kmod-usb-serial-pl23033.8.3-1
kmod-usb-storage 3.8.3-1
kmod-usb2 3.8.3-1
libusb-1.01.0.9-1
libusb-compat0.1.4-1
usbutils006-1

Do ls /dev/tty* before and after you plug in the device. There should be a new port opened when you plug it in, whatever is new will be the equivalent of a COM in windoze

You don't need both the ftdi and the prolifix device drivers; one of them should be enough and you should see a /dev/ttyUSBx device popping up.

kind regards,

Jos

Nagesh: I have below drivers installed (related to USB)

kmod-usb-acm 3.8.3-1 kmod-usb-core 3.8.3-1 kmod-usb-hid 3.8.3-1 kmod-usb-serial 3.8.3-1 kmod-usb-serial-ftdi 3.8.3-1 kmod-usb-serial-pl23033.8.3-1 kmod-usb-storage 3.8.3-1 kmod-usb2 3.8.3-1 libusb-1.01.0.9-1 libusb-compat0.1.4-1 usbutils006-1

Most digital scale USB interface is HID, You installed a load of unused driver which could kills correct driver. If I were you start with fresh copy YunOS.

lsusb
...
Bus 001 Device 005: ID 0922:8000 Dymo-CoStar Corp.

This confirms OS know USB port.

opkg update 
opkg install kmod-usb-hid
...
Configuring kmod-input-core.
Configuring kmod-input-evdev.
Configuring kmod-hid.
Configuring kmod-usb-hid.
...

Install the HID driver we needed.

cat /dev/usb/hiddev0  | hexdump
0001c50 008d 0073 0000 0000 008d 0074 0000 0001
0001c60 008d 0041 ffff ffff 008d 0040 0000 0039

0039 in Hex is 57 in DEC, my Iphone weight 5.7 Oz.

cd /mnt/sda1
wget https://www.dropbox.com/s/uwy1d0lgawljf3b/evdev.py --no-check-certificate
chmod 755 evdev.py
./evdev.py '/dev/usb/hiddev0'
...
<Event timestamp=9244935.9672950006 type=141 code=64 value=57>
...

You should add powered USB Hub between Yun and Scale, since Yun has hardware bug at USB power line.

Thanks sonnyyu !!!

External Powered USB Hub solved my problem.

I believe I can connect multiple USB device to USB Hub now. I am assuming Yun is detects the devices at run-time (i.e. plug-n-play).