Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3872650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:56:56+00:00 2026-05-19T21:56:56+00:00

I have a USB HID scale that I need to fetch the weighing reports

  • 0

I have a USB HID scale that I need to fetch the weighing reports from. I am able to do this on Linux by reading 7 bytes at a time from /dev/hidraw#, but I would like to get the same information using libusb-1.0.

Even when I do get some non-null bytes, I get error -9: LIBUSB_ERROR_PIPE

I am attempting to use a control transfer like so:

#define WEIGH_REPORT_SIZE 7

    /*
     * Open a handle to the found scale
     */
    libusb_open(dev, &handle);
#ifdef __linux__
    libusb_detach_kernel_driver(handle, 0);
#endif
    libusb_claim_interface(handle, 0);

    /*
     * Try to transfer data about status
     *
     */
    unsigned char data[WEIGH_REPORT_SIZE];
    unsigned int len = libusb_control_transfer(
        handle,
        LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS |
            LIBUSB_RECIPIENT_INTERFACE,
        HID_REPORT_GET,
        //wValue => hid report, no report ID
        0x0100,
        0x00,   //windex => interface 0
        data,
        WEIGH_REPORT_SIZE,    //wLength
        10000 //timeout => 10 sec
        );
    int i;
    printf("Got %d bytes from control transfer:\n", len);
    for(i = 0; i < WEIGH_REPORT_SIZE; i++) {
        printf("%x\n", data[i]);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:56:56+00:00Added an answer on May 19, 2026 at 9:56 pm

    An example to read from a USB HID card reader using libusb-win –

    http://rowsandcolumns.blogspot.com/2011/02/read-from-magtek-card-swipe-reader-in.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a USB weighing scale that I'm trying to import the reading into
I have a USB weighing from stamps.com (Model 510: http://www.stamps.com/postage-online/digital-postage-scales/ ) I was able
I have a USB device that I need to be able to talk to
I have a Linux USB HID device (a Hama MCE ), and I can
I am trying to read data from a HID device. I have a USB
I currently have some code that sets up notifications of connected USB HID devices
I have device that is a USB HID Human Interface that sends keycodes to
I have a Mettler Toledo postal scale (PS60) that I need to configure and
I have been trying to get a USB HID keyboard working on an Android
I need to test the bandwidth I have on my USB RNDIS connection. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.