尝试运行一些代码。我这样做时会出现此错误。我以为我安装了所有必需的依赖项,但仍然遇到此错误。
的Linux; GNU C ++版本4.8.1; Boost_105300; UHD_003.007.000-133-g6bd9fed2
Traceback (most recent call last):
File "/usr/local/bin/tpms_rx", line 274, in <module>
main()
File "/usr/local/bin/tpms_rx", line 265, in main
tb = top_block(source, args)
File "/usr/local/bin/tpms_rx", line 229, in __init__
self.source = source_rtlsdr(args.tuned_frequency, args.if_rate)
File "/usr/local/lib/python2.7/dist-packages/tpms/source.py", line 98, in __init__
rf_decimation, rf_decimation_remainder = divmod(rf_sampling_rate, if_sampling_rate)
TypeError: unsupported operand type(s) for divmod(): 'int' and 'NoneType'
答案 0 :(得分:0)
运行程序时,您需要传递参数-i
/ --if-rate
,否则默认值为None
,最终会在2层之后传递给divmod
另请参阅https://github.com/jboone/gr-tpms/blob/master/apps/tpms_rx和https://github.com/jboone/gr-tpms/blob/master/python/source.py。