4:33 AM
5:02 AM
Now I am going back to my hx711 test program v0.3. I found the first bug in the PyPi hx711 library. It appears to be a typo error. But as the wise man *Warren Buffett says, "There ain't be just one cockroach in the kitchen. So I am expecting more bugs or incompatibility of the PyPi library with the Rpi Thonny library. So I am read the library more closely, just in case I need to troubleshooting:
This is the full listing fo the pypi hx711 library. It is less than 300 line long. So should be easy to debug.
# ****************************************************************************************** # Program description # hx711test03.py tlfong01 2020oct28hkt2201 # System Config # Rpi4B 2GB buster Thonny python 3.7.3 # HX711 PyPi Library Install # pi@raspberrypi:~ $ date | Tue 27 Oct 2020 09:14:01 PM HKT # pi@raspberrypi:~ $ uname -a | Linux raspberrypi 4.19.118-v7l+ #1311 SMP # Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux # pi@raspberrypi:~ $ pip3 install hx711 # Looking in indexes: pypi.org/simple, piwheels.org/simple
5:39 AM
I am also considering the Arduino Library of HX711. I don;t have much confidence on the PyPi hx711 Library, because I already found a bug in the demo program. Now I googled the Arduino Library to check out if it is good. The links are listed below.
(1) HX711 Arduino Library - Arduino CC
https://www.arduino.cc/reference/en/libraries/hx711-arduino-library/
(2) HX711 Arduino Library - GitHub
https://github.com/bogde/HX711
https://www.arduino.cc/reference/en/libraries/hx711-arduino-library/
(2) HX711 Arduino Library - GitHub
https://github.com/bogde/HX711
Blocking mode - The library is usually used in blocking mode, i.e. it will wait for the hardware becoming available before returning a reading.
This might be a program for me using more that two hx711 modules. The Rpi version can use multi-threading and can execute two hx711's in parallel, therefore should be more time efficient.
(a) ATmega328: Arduino Uno
(b) ESP8266: WeMos D1 mini, Adafruit HUZZAH
(c) Arduino core for ESP32 (ESP32 DEVKIT V1, Heltec WiFi Kit 32, Adafruit Feather HUZZAH32)
(d) Arduino core for STM32 (STM32 F1 (Cortex-M3): STM32F103C8T6 STM32 Blue Pill Board)
(b) ESP8266: WeMos D1 mini, Adafruit HUZZAH
(c) Arduino core for ESP32 (ESP32 DEVKIT V1, Heltec WiFi Kit 32, Adafruit Feather HUZZAH32)
(d) Arduino core for STM32 (STM32 F1 (Cortex-M3): STM32F103C8T6 STM32 Blue Pill Board)
But I only know Arduino UNO and nothing about STM32 (Though I know ESP8266 WeMos D1 Mini, but found its microPython a bit slow). So my contingency plan is to switch to STM32, in case I get stuck in PyPi hx711 library and have to give up.
1 hour later…
7:08 AM
7:34 AM
Now I am coming back to PyPi hx711 library package. As I said earlier, the complete library is only some 300 lines long, and only a couple of main functions, such as reset, getRawData, conver to decimal etc. I have written a penzu reading log as I read the program listing.
I am reading my penzu hx711 library reading log a second time, make sure I have not missed reading any important functions. penzu.com/p/bb7ed5c8
6 hours later…
1:43 PM
Now I have written and debugged testHx711v04b. This program tests hx711 measuring only One hx711 module's Channel A with a 500g LoadCell loaded with 250g. Multimeter measures 2.6mV, and average of 8 measurements is 885762. The complete listing of the program with a sample output is shown below.
# Program description # hx711test04a.py tlfong01 2020oct29hkt2113 # System Config # Rpi4B 2GB buster Thonny python 3.7.3 # HX711 PyPi Library Install # pi@raspberrypi:~ $ date | Tue 27 Oct 2020 09:14:01 PM HKT # pi@raspberrypi:~ $ uname -a | Linux raspberrypi 4.19.118-v7l+ #1311 SMP # Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux # pi@raspberrypi:~ $ pip3 install hx711 # Looking in indexes: pypi.org/simple, piwheels.org/simple # Requirement already satisfied: hx711 in ./.local/lib/python3.7/site-packages (1.1.2.3)
1:56 PM
@Cem I have written and debugged my test program v0.4b. As I said, I am making things as simple as possible: Just one hx711 module, using only Channel A, using a single loading of 250g to the 500g load cell, only raw results, no tare. Multimeter for the 250g load is 2.6mV, and the average of 8 hx711 measurements is 885765. If you like to try it, the procedure is just two steps:
« first day (2 days earlier) ← previous day next day → last day (16 days later) »
Transcript for
Oct28
Oct '2029
Oct30
Discussion between tlfong01 and Cem
Imported from a comment discussion on raspberrypi.stackexchang...