Cross-platform compatible Python 3 script for reading the scale as a human input device (HID).
- Python 3
- libusb
On OS X, install libusb via Homebrew:
$ brew install libusb
Create a local virtual environment for Python:
$ python3 -m venv ./
Install the required Python requirements:
$ pip install -r requirements.txt
$ python3 dymo.py
The output will confirm successful connection to the scale:
Connected to DYMO M25 25 lb Digital Postal Scale
After placing bananas on the scale:
16 grams
178 grams
234 grams
248 grams
248 grams
248 grams
248 grams
248 grams
After removing them:
286 grams
316 grams
28 grams
Note that the resolution of the Dymo M25 scale is 2 grams (or 0.1oz), and the response time seems to be about 1-2 seconds.
To exit, press ctrl+C or turn off the scale.