littlejo / huawei-lte-examples

Examples of codes using python huawei-lte-api api
GNU General Public License v3.0
52 stars 18 forks source link

ValueError #6

Open jeremie-baboukhian opened 4 years ago

jeremie-baboukhian commented 4 years ago

Hi, I got an Error on launch "ValueError: invalid literal for int() with base 10: '-12.0'" any idea to fix it? Massive work btw

ArtursGailis1995 commented 4 years ago

The latest firmware for some devices seems to be reporting RSRQ values in double/float format, not integer.

RSRQ-11.0dB

You need to open \huawei-lte-examples-master\huawei-lte-monitoring\SignalInfo.py and modify function def get_int(value): return int(value.split('d')[0])

to look like def get_int(value): return float(value.split('d')[0])

Also need to edit file \huawei-lte-examples-master\huawei-lte-band\huawei_lte_lib.py and find code def get_signal_int(value): return int(value.split('d')[0])

and make it look like def get_signal_int(value): return float(value.split('d')[0])