« first day    last day (18 days later) » 

2:22 AM
My old hx711 module on proto board does not seem to have collected too much dust. But I have forgotten which wires for which use. So I need to browse my photo gallery again.
 
Cem
3:00 AM
good morning (still kinda), again I really appreciate your support and taking the time to explain the stuff and I understand better but I understand also that this most likely simply doesn't work hence there is no one out there who used 2 HX711 at the same time with a Rpi.
The more I fiddle (this morning another 3 hours) there in a mess I end up.
Currently none of the example.py's run, somehow after making python 3.7 the default and installing HX711 I have another folder under usr/local/lib/ with hx711-1.1.23 which is different to what have in another HX711 folder, this new is reading the mean... but any py I try to run I get Attribute erros for HX711. I will attempt 2 last tries but with the goal to use only one load cell and one hx711 module at a time: 1. default back to python 2.7 use the "old" example py I had modified (tried to modify) if things are stil
 
Cem
3:12 AM
reinstalling Rpi OS ggrrrr
 
3:24 AM
@Cem You said "no one out there who used 2 HX711 at the same time with a Rpi". Well, at least one crazy hobbyist programmer in this Lonely Planet is using more than two HX711's. If you search rpi-org-forum you might find some one was using ESP8266-12 LUA to control a couple of MCP23017's each of which has 16 GPIO ports, each pair of ports control one HX711 module.
So the other crazy guy is controlling 4 x mcp23017 (can be up to 8) each of which is controlling 8 x hx711, each of which is controlling two load cells. So it is 4 x 4 x 8 x 2 = 128 load cells (note: my dodgy calculations is not proofread. )
@Cem Ah, this is what I am doing: "the goal to use only one load cell and one hx711 module at a time ...". This is called the Occam Razor approach - Make the thing as simple as possible, but not simpler."
You might have heard that StackOverflow did a survey a year ago, telling the whole planet the results that SCALA is the most money making language for the programmers. Scala means "A scalable language", which means that once you know how to talk to one hx711, you can talk to as many as hx711's as you like, ...
Yes, I am not using Scala, but you don't need to use Scala to do Scala, You can use LUA C#, or F#, or Python to do Scala. Of course you can also use stupid C/C++ to do Scala, but that would take 100 times longer, and still end up a big mess. By the same token, I am doing OO programming without OO languages, Agile development without using Agile tools (Google Uncle Bob to know more of what I am talking). So I sometimes call myself a "be water programmer", ... :)
 
4:14 AM
Now I am making a 500g load cell testing rig.
Ah, locking down lunch time! See you late this afternoon or evening. Cheers.
 
4:28 AM
Before I go, I would recommend you to watch an Uncle Bob's talk. He is talking about Future Programming. I forgot to mention I am trying to write my programs Future Proof. In other words, I am also a ***Future Programmer***. ***Uncle Bob Martin The Future of Programming*** - 2016may18, 1,530,276 views
https://www.youtube.com/watch?v=ecIWPzGEbFc
 
 
8 hours later…
Cem
12:26 PM
Occam Razor approach - I like that. btw I'm in Singapore though from Germany (been now 16 years here). reinstalled OS, putting things together, calibrated one load cell, tomorrow next and then hopefully final wind tunnel tests which will probably last a day with 4 month research and preparation... enjoy the evening
 
12:45 PM
Ah, I also just calibrated the 500g load cell, with results shown below.
Next is to upgrade the hx711 test program from v0.1 to v0.2. Now I am going to connect Rpi to the real thing, the hx711 module, and see if it can measure something, at least can reset itself. Two years ago this time I used ESP8266/Rpi3B+ stretch LUA/python MCP23017 to try to talk to hx711, but ended up a mess. So I gave up.
This time I don't have much confidence and dare not to write my own program (actually not that difficult, if using python, but at that time Rpi3B+ I2C was buggy, and couldn't change frequency, only flat 100kHz. (OK my excuse :) :( ).
Anyway, Rpi4B I2C is bug free now. Moreover, the PiPy library I am trying now is in python, and I peeked inside and found the logic simple: just send 20 something bytes and read back the 24 bit raw result and convert it to decimal. As usual, I won't write the tedious 2'C compliment to decimal myself, I just steal the conversion code from somewhere. :)
 
 
2 hours later…
2:33 PM
Now I have upgraded my very simple hx711 test v0.1 program to also very simple v0.1. The Rpi to hx711 is also as simple as possible:
Only the right hand side 4 pin connector are used, from top to bottom:
Vcc - connected to 3V3
hx711 Data to Rpi pin 14 (TxD)
hx711 Clock to Rpi pin 15 (RxD)
hx711 Ground to Rpi Ground
The 5 pin of the left side connected is left Not Connected (NC)
The only upgrade function added is just to reset hx711. Last hx711 was connected, excuting reset would hang the program. This time the reset function executes smoothly, verifying Rpi can talk to hx711 and ask it to do something like reset. I have not tried the get raw data yet. I am a humble guy, I dare not to go too fast. The v0.2 program, with sample output, is listed below.
# Program description
#   hx711test02a.py tlfong01 2020oct27hkt2109
# System Config
#   Rpi4B 2GB Thonny python 3.7.3
# HX711 PyPi Library Install
#   pi@raspberrypi:~ $ date Tue 27 Oct 2020 09:14:01 PM HKT
#   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)

# *** Imports ***
import RPi.GPIO as GPIO
from   datetime import datetime
from   hx711    import HX711
Almost bed time. Call it a day. Carry on tomorrow.
Cheers.
 
2:58 PM
 

« first day    last day (18 days later) »