You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
First of all thank you for the the library!
So I am having troubles understanding how to connect to WinTAK. Basically for now I just want to test sending GPS data to WinTAK so it shows as a marker of some type. Later I plan to integrate the device with UAS plugin in order to manage waypoint navigation (I hope this is possible).
The thing is, I have slightly modified the example send.py script, to send fake data to my WinTAK (both the script and WinTAK are running on the same PC).
However I do not receive anything at all in WinTAK (I guess there is network configuration problem in WinTAK) and I can not figure out why.
Here is the code:
importasyncioimportxml.etree.ElementTreeasETfromconfigparserimportConfigParserimportpytakimporttakprotoimporttimeimportdatetimeclassMySerializer(pytak.QueueWorker):
""" Defines how you process or generate your Cursor on Target Events. From there it adds the CoT Events to a queue for TX to a COT_URL. """asyncdefhandle_data(self, data):
"""Handle pre-CoT data, serialize to CoT Event, then puts on queue."""event=dataresp=awaitself.put_queue(event)
print(resp)
asyncdefrun(self, number_of_iterations=-1):
"""Run the loop for processing or generating pre-CoT data."""while1:
# data = tak_pong()# await self.handle_data(data)# print("pong data has been sent")# await asyncio.sleep(20)now=datetime.datetime.utcnow()
stale=nowstale+=datetime.timedelta(hours=1)
now_iso=now.isoformat()[:-4] +"Z"stale_iso=stale.isoformat()[:-4] +"Z"# 2023-12-05T08:46:22.96Z# 2023-12-07T12:01:37.681452Zprint(now_iso)
print(stale_iso)
cot=f"""<?xml version='1.0' encoding='utf-16' standalone='yes'?><event version='2.0' uid='S-1-5-21-3327203913-228467099-2355216783-1001' type='a-f-G' time='{now_iso}' start='{now_iso}' stale='{stale_iso}' how='h-e'> <point lat='43.545231' lon='-5.661920' hae='9999999' ce='9999999' le='9999999' /> <detail> <takv version='4.1.0.231' platform='WinTAK-CIV' os='Microsoft Windows 11 Home' device='HP HP Laptop 15-da0xxx' /> <contact callsign='FONG' endpoint='' /> <uid Droid='FONG' /> <__group name='Cyan' role='Team Member' /> <status battery='50' /> <track course='0.00000000' speed='0.00000000' /> </detail></event>"""buf=takproto.xml2proto(cot, takproto.TAKProtoVer.STREAM)
print(buf)
awaitself.handle_data(buf)
# await asyncio.sleep(20)time.sleep(2)
deftak_pong():
"""Generate a simple takPong CoT Event."""root=ET.Element("event")
root.set("version", "2.0")
root.set("type", "t-x-d-d")
root.set("uid", "takPong")
root.set("how", "m-g")
root.set("time", pytak.cot_time())
root.set("start", pytak.cot_time())
root.set("stale", pytak.cot_time(3600))
returnET.tostring(root)
asyncdefmain():
"""Main definition of your program, sets config params and adds your serializer to the asyncio task list. """config=ConfigParser()
config["mycottool"] = {"COT_URL": "tcp://192.168.99.108:4242"}
config=config["mycottool"]
# Initializes worker queues and tasks.clitool=pytak.CLITool(config)
awaitclitool.setup()
# Add your serializer to the asyncio task list.clitool.add_tasks(set([MySerializer(clitool.tx_queue, config)]))
# Start all tasks.awaitclitool.run()
if__name__=="__main__":
asyncio.run(main())
Also I attach some WinTAK screenshots which may be useful:
Some help is greatly appreciate it. Thanks!!
BR
The text was updated successfully, but these errors were encountered:
Hey guys! I am also trying to send some sample COT drone detection event from python in the way mentioned above. It seems data is being sent to winTAK, but I am not able to see anything on winTAK. Can anyone please help me to understand?
Hi all, I am facing the same issue as well. I am trying to send COT messages to the server, the server port shows bytes received; but I can see nothing on webtak (the one which is available on the TAK server installation, and when the TAK server is launched on the web).
Hello!
First of all thank you for the the library!
So I am having troubles understanding how to connect to WinTAK. Basically for now I just want to test sending GPS data to WinTAK so it shows as a marker of some type. Later I plan to integrate the device with UAS plugin in order to manage waypoint navigation (I hope this is possible).
The thing is, I have slightly modified the example send.py script, to send fake data to my WinTAK (both the script and WinTAK are running on the same PC).
However I do not receive anything at all in WinTAK (I guess there is network configuration problem in WinTAK) and I can not figure out why.
Here is the code:
Also I attach some WinTAK screenshots which may be useful:
Some help is greatly appreciate it. Thanks!!
BR
The text was updated successfully, but these errors were encountered: