tatobari / hx711py

HX711 Python Library for Raspberry Pi.
Apache License 2.0
215 stars 153 forks source link

diffrent values when auto run this script on boot/login #43

Closed Bearforce01 closed 3 years ago

Bearforce01 commented 3 years ago

Hi I plan to run this script on boot and use the printed value in CODESYS.

When I run this script in the Pi Desktop view via remote control on windows or in Putty, everything is fine. But when I auto start this on boot/login, I get random numbers between -800 and + 1200 for exsample after the tare. While having the start command in the "sudo nano /etc/profile" file to auto start it, I also get the random rumbers in Putty after stoping the script and starting it manuell again.

2Unbenannt

But when I remove the line in the profile, starting the script manuelly in Putty has nu issue and the numbers are fine.

image

It looks like the issue when having the referenceUnit = 1. When I changed the referenceUnit to 424, my printed values are pretty accurate. Also I power the the hx711 with 3.3V. I use only one load cell.

Unbenannt

Also, when I change the GPIOs, I still get the same error message you see in the screenshot. This message I get also when I start it manually in shell directly on the pi (without Putty). Is this error a/the problem?

What might be the reason?