PermaLink Hacking Radioshack's USB Electronic Scale with libusb-win/libusb-java02/11/2013 05:18 PM
I upgraded to Windows8 64-bit recently and found out the Radioshack postal scale I bought a while back no longer works.  Radioshack no longer plans to update the ancient drivers so, thanks to posts from Eric Jiang and Caskey Dickson, I wrote up a quick utility in Java that uses Swing for the GUI:
Image:Ken's Blog - Hacking Radioshack's USB Electronic Scale with libusb-win/libusb-java
Not a pretty graphicical UI of the front of a typical electronic scale like the OEM application, but it shows the info I need to put into various shipping sites.  One thing that bugged me about the old UI is that it didn't display the weight in Pounds w/ a decimal point that some sites wanted, so I had to convert the display Lb/Oz values to a straight Lb value so that's why there are two English units readouts.

To install it:

1) download libusb-win32 and from the bin directory in the zip file, move the appropriate files to your system. The libusb0.dll file goes into your windows\system32 directory. The libusb0.sys file goes into your windows\system32\drivers directory. Plug in the USB scale and run the inf-wizard.exe to create a .inf file for USB scale and then right click and install the .inf file (on Windows8.x, you'll have to reboot into a mode that lets you install unsigned drivers). Run the install-filter-win.exe program and choose the device that's "vid:2233 pid:6323 rev:0100" which is the USB scale. Run the testlibusb-win32.exe program and you should see this:

If you still have problems installing it, try the Zadig program instead, and tell it to use libusb for the driver. Select All Devices to see the USB scale.

2) download the appropriate libusb-java zip for your system. The libusbjava.dll inside it goes into windows\system32. If you run java -jar ch.ntb.usb-0.5.9.jar, you should see the USB scale as well:


3) Take these two files and put them in a directory of your choosing:
Scale_1.icoScale_1.pngUSBScale.jar
Right click the .jar file and send a shortcut to your Desktop. Then right click the desktop icon and go into the properties to change the icon and point it at the .ico file. The Scale_1.png file is used by the USBScale.jar file. If it displays an error message, make sure the USB Scale is plugged in and restart the program.
This only supports the Radioshack USB Scale, but it should be easy enough to add support for "standard" USB scales mention in Eric Jiang's blog...I don't have one though, so I can't add support for it.

Comments :v

1. chad05/13/2017 23:49:11


Thanks alot for this!

But you know original app works in compatibility mode right? I'm running it in 98/me mode on win81




2. J Smith04/10/2013 02:22:39


Perfect! You rock!




3. ken04/09/2013 19:28:58


Sorry about that...forgot to include the Scale_1.png file. The Java code uses the .png file because it can't use the .ico file and the Windows desktop can't use a .png file as the icon so you need both




4. J Smith04/09/2013 03:53:55


Love that you came up with this. One problem, though. Everything works until I try to use your .jar file. Have downloaded a couple times to make sure I wasn't getting a corrupted file. Anyway, using v7update 17 x64, it hangs if I double-click on the .jar file, and if I run it from the console I get the following:

D:\Netstuff>java -jar USBScale.jar
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)

Any thoughts?

Thanks!




Start Pages
RSS News Feed RSS Comments Feed CoComment Integrated
The BlogRoll
Calendar
June 2024
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Search
Contact Me
About Ken
Full-stack developer (consultant) working with .Net, Java, Android, Javascript (jQuery, Meteor.js, AngularJS), Lotus Domino