jlab-sensing / soil-power-sensor-firmware

Firmware for STM32 and ESP32 microcontrollers on the Soil Power Sensor board
MIT License
0 stars 3 forks source link

Protobuf python library decode TypeError #73

Closed jmadden173 closed 2 months ago

jmadden173 commented 2 months ago

Describe the Bug A clear and concise description of what the bug is.

To Reproduce

  1. Install soil-power-sensor-protobuf package
  2. Run decode_measurement on valid data
...
backend-1  |   File "/app/backend/api/resources/util.py", line 32, in process_measurement
backend-1  |     meas = decode_measurement(data)
backend-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
backend-1  |   File "/usr/local/lib/python3.11/site-packages/soil_power_sensor_protobuf/decode.py", line 53, in decode_measurement
backend-1  |     meta_dict = MessageToDict(meas.meta, including_default_value_fields=True)
backend-1  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1  | TypeError: MessageToDict() got an unexpected keyword argument 'including_default_value_fields'

Expected Behavior No error is thrown

Screenshots N/A

Environment

Linux

Additional Context

The soil-power-sensor-protobuf python package specifies protobuf requirement but no version. Therefore when protobuf was update MessageToDict has changed causing excpetions on new installations. Didn't realize it since I was decoding messages on original venv.