Save HX711 Parameters with DeepSleep



  • Hello,

    In my projet, I use a Lopy4 and an HX711 to mesure beehive weight. I must use the DeepSleep function, in order to maximize the battery life. Weight datas are send on Sigfox. In order to tare the Load Cell, I use a function which is trigged by an interupted push button. I want to tare only one time at the placement of the scale under the beehive. After, Lopy4 measure weight and send it every x minutes. Deepsleep is used bettween each measurment and sending phases.

    But, I have a problem with HX711 parameters. It looks that HX711 parameters are losted during deepsleep. So my measurments are wrong.

    Do you know how to fix this problem ? Is it possible to save HX711 parameter's ?

    Thank you for your answers !

    boot.py
    main.py
    hx711.py



  • @Simon-RAPP Wake-up from Deep Sleep is a power on cycle. After that, you have to re-instantiate all devices.



  • @robert-hh
    Hello,

    I don't think that is the tare which causes problems. I think that the HX711 statement reset HX711. ( hx711 = HX711('P8', 'P9') # P8 Data - P9 Clock ).

    What do you think about that ? How can I do for that statement be executing only at the power ON ?



  • @Simon-RAPP you can write it to a file. If the file then contains valid python code, like:
    tare = 12345
    You can simply import it to get the value.


Log in to reply
 

Pycom on Twitter