Open tlp19 opened 1 year ago
Can try using my circuit python library: https://github.com/Timo614/dfrobot_hx711_i2c_circuit_python/blob/main/dfrobot_hx711.py
The python logic in this repo didn't work for me as well. One thing I noticed was the python logic has the wrong i2c address hardcoded in the library file (0x60) albeit the example file you're using has the correct one of 0x64. https://github.com/DFRobot/DFRobot_HX711_I2C/blob/master/DFRobot_HX711_I2C.h#L26
I didn't dig into why the current library didn't work as I was happy with it working with circuit python for my needs but one thing I did notice was the python library, unlike the arduino library, does not write the following during initialization:
REG_DATA_INIT_SENSOR is 0x70 The arduino library calls this as its first action https://github.com/DFRobot/DFRobot_HX711_I2C/blob/master/DFRobot_HX711_I2C.cpp#L23
Hi, I am trying to use the "Gravity: I2C 1Kg Weight Sensor Kit - HX711" with a Raspberry Pi 4 Model B with Python 3.9 and I can't get the Python scripts provided in this repository to work.
My Setup
0x64
and it is successfully recognized by the Raspberry Pi when I run thesudo i2cdetect -y 1
command in a terminal.smbus2
library instead ofsmbus
(I have updated this in theDFRobot_HX711_I2C.py
library file).My Problem
When running the
get_calibration.py
example on my device, the orange light turns on but then I get the following error in my terminal after a few seconds:The orange light then turns off about 7 or 8 seconds later (no blinking, so the calibration failed).
The traceback is as follows:
Similarly, when I run the
readWeight.py
, I receive 2 or 3 weight readings of 0g before getting the same error.I am not sure if this is an error due to the
DFRobot_HX711_I2C.py
Python library, or from the hardware, or from both.Can you please help me to fix this issue?
Thank you.