DroneScout Receiver Manual - version 1.0 May 2022 - © BlueMark Innovations BV 2022
26/28
[OperatorIdType] = struct.unpack('i',
UASdata[OperatorID_start_byte:OperatorID_star 4])
print("Operator ID Type......", OperatorIdType)
print("Operator ID......", UASdata[OperatorID_star
4:OperatorID_star 4 + 20].decode('ascii'))
print("")
except:
pass
try:
status_json = json_obj.get('status')
status_json.get('sensor ID') # fail if it is data json
print("status message")
print("sensor ID......", status_json.get('sensor ID'))
print("timestamp......", status_json.get('timestamp'))
epoch_timestamp =
datetime.datetime.fromtimestamp(status_json.get('timestamp')/1000)
print("time (UTC)......",
epoch_timestamp.strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
print("firmware version......", status_json.get('firmware version'))
print("model......", status_json.get('model'))
print("status......", status_json.get('status'))
print("")
except:
pass
except:
pass
client.subscribe(topic)
client.on_message = on_message
def run():
client = connect_mqtt()
client.loop_forever()
if __name__ == '__main__':
run()