diff --git a/sensor_to_local.py b/sensor_to_local.py index b1905d6..91fd0a0 100755 --- a/sensor_to_local.py +++ b/sensor_to_local.py @@ -165,7 +165,7 @@ def local(): # print("当前风向为:", int(return_data_hex[10:14], 16))#单位mm # 6号设备是8方位 if subscribe_topic == zhanguan_device_name: - winddirection_data = int(return_data_hex[10:14], 16) + winddirection_data = int(return_data_hex[6:10], 16) else: winddirection_data = int(return_data_hex[6:10], 16) / 10 time.sleep(5) diff --git a/sensor_to_server.py b/sensor_to_server.py index 0475880..2e5e0d0 100755 --- a/sensor_to_server.py +++ b/sensor_to_server.py @@ -169,7 +169,7 @@ def get_data(): # print("当前风向为:", int(return_data_hex[10:14], 16) ) #单位mm # 6号设备是8方位 if subscribe_topic == zhanguan_device_name: - winddirection_data = int(return_data_hex[10:14], 16) + winddirection_data = int(return_data_hex[6:10], 16) else: winddirection_data = int(return_data_hex[6:10], 16) / 10 time.sleep(5)