Coder Social home page Coder Social logo

snstac / adsbcot Goto Github PK

View Code? Open in Web Editor NEW
80.0 7.0 20.0 32.09 MB

Display Aircraft in TAK - ADS-B to TAK Gateway

Home Page: https://adsbcot.rtfd.io

License: Apache License 2.0

Makefile 7.37% Python 92.63%
atak wintak sa cot ads-b adsb aircraft cursor-on-target itak tak

adsbcot's People

Contributors

ampledata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

adsbcot's Issues

ValueError: too many values to unpack (expected 3)

pi@adsbexchange:~ $ adsbcot -c /etc/adsbcot.ini
2023-02-02 22:52:44,246 pytak INFO - CoT_URL Dest: udp://239.2.3.1:6969
2023-02-02 22:52:44,247 pytak INFO - CoT_URL Dest: udp://239.2.3.1:6969
2023-02-02 22:52:44,247 pytak INFO - Run: <class 'pytak.classes.CLITool'>
2023-02-02 22:52:44,249 pytak INFO - Run: <class 'pytak.classes.TXWorker'>
2023-02-02 22:52:44,250 pytak INFO - Running <class 'adsbcot.classes.ADSBNetReceiver'> for tcp+raw://localhost:30002
2023-02-02 22:52:44,252 pytak INFO - Running <class 'adsbcot.classes.ADSBNetWorker'> for data_type: raw
2023-02-02 22:52:44,252 pytak INFO - Run: <class 'pytak.classes.RXWorker'>
2023-02-02 22:52:46,481 pytak INFO - Complete: <Task finished name='Task-4' coro=<ADSBNetWorker.run() done, defined at /home/pi/.local/lib/python3.9/site-packages/adsbcot/classes.py:184> exception=ValueError('too many values to unpack (expected 3)')>
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-4' coro=<ADSBNetWorker.run() done, defined at /home/pi/.local/lib/python3.9/site-packages/adsbcot/classes.py:184> exception=ValueError('too many values to unpack (expected 3)')>
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.9/site-packages/adsbcot/classes.py", line 241, in run
    decoder.process_raw(
  File "/home/pi/.local/lib/python3.9/site-packages/pyModeS/streamer/decode.py", line 158, in process_raw
    ac["HPL"], ac["RCu"], ac["RCv"] = pms.adsb.nuc_p(msg)
ValueError: too many values to unpack (expected 3)
pi@adsbexchange:~ $

pyModeS version: pymodes==2.15

rtl versions:

pi@adsbexchange:~ $ dpkg -l | grep -i sdr
ii  librtlsdr-dev:armhf                  0.6.0-3                          armhf        Software defined radio receiver for Realtek RTL2832U (development)
ii  librtlsdr0:armhf                     0.6.0-3                          armhf        Software defined radio receiver for Realtek RTL2832U (library)
ii  libsoapysdr0.7:armhf                 0.7.2-2                          armhf        software defined radio interface library
ii  rtl-sdr                              0.6.0-3                          armhf        Software defined radio receiver for Realtek RTL2832U (tools)
ii  soapysdr-module-rtlsdr:armhf         0.3.0-2                          armhf        RTL-SDR device support for SoapySDR (default version)
ii  soapysdr0.7-module-rtlsdr:armhf      0.3.0-2                          armhf        RTL-SDR device support for SoapySDR

-S "stale" CLI command broken

using the "stale" time -S parameter spits the following errors:

user1@DESKTOP-1234:~$ adsbcot -U udp:127.0.0.1:4242 -S 25 -D http://192.168.0.146:8080/data/aircraft.json -I 2
------------------------------------------------------------------------
! Warining: pyrtlsdr not installed (required for using RTL-SDR devices)
------------------------------------------------------------------------
2021-05-02 20:29:03,085 pytak INFO - Running ADSBWorker with URL 'http://192.168.0.146:8080/data/aircraft.json'
2021-05-02 20:29:03,087 pytak INFO - Running EventReceiver
2021-05-02 20:29:03,088 pytak INFO - Running EventTransmitter
Task completed: <Task finished coro=<ADSBWorker.run() done, defined at /home/user1/.local/lib/python3.7/site-packages/adsbcot/classes.py:86> exception=TypeError('unsupported type for timedelta seconds component: str')>
Task exception was never retrieved
future: <Task finished coro=<ADSBWorker.run() done, defined at /home/user1/.local/lib/python3.7/site-packages/adsbcot/classes.py:86> exception=TypeError('unsupported type for timedelta seconds component: str')>
Traceback (most recent call last):
  File "/home/user1/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 92, in run
    await self._get_dump1090_feed()
  File "/home/user1/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 84, in _get_dump1090_feed
    await self.handle_message(aircraft)
  File "/home/user1/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 57, in handle_message
    event = adsbcot.adsb_to_cot(craft, stale=self.cot_stale)
  File "/home/user1/.local/lib/python3.7/site-packages/adsbcot/functions.py", line 103, in adsb_to_cot
    event.stale = time + datetime.timedelta(seconds=stale)
TypeError: unsupported type for timedelta seconds component: str

Event loop is closed

Hello
Cant get my head around this:

Jun 27 14:27:34 localhost.localdomain systemd[1]: adsbcot.service: Scheduled restart job, restart counter is at 39.
Jun 27 14:27:34 localhost.localdomain systemd[1]: Stopped ADS-B to TAK Gateway.
Jun 27 14:27:34 localhost.localdomain systemd[1]: Started ADS-B to TAK Gateway.
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: Traceback (most recent call last):
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/bin/adsbcot", line 8, in
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: sys.exit(main())
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ^^^^^^
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/adsbcot/commands.py", line 31, in main
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: pytak.cli(name.split(".", maxsplit=1)[0])
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/pytak/client_functions.py", line 395, in cli
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: asyncio.run(main(app_name, config), debug=debug)
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: return runner.run(main)
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ^^^^^^^^^^^^^^^^
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/runners.py", line 118, in run
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: return self._loop.run_until_complete(task)
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/base_events.py", line 653, in run_until_complete
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: return future.result()
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ^^^^^^^^^^^^^^^
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/pytak/client_functions.py", line 293, in main
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: clitool.add_tasks(create_tasks(config, clitool))
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/adsbcot/functions.py", line 88, in create_tasks
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: raise ValueError
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: ValueError
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: Exception ignored in: <function DatagramStream.del at 0x7f03b59b5f80>
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: Traceback (most recent call last):
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/pytak/asyncio_dgram/aio.py", line 49, in del
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/selector_events.py", line 839, in close
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/base_events.py", line 761, in call_soon
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/base_events.py", line 519, in _check_closed
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: RuntimeError: Event loop is closed
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: Exception ignored in: <function DatagramStream.del at 0x7f03b59b5f80>
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: Traceback (most recent call last):
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/local/lib/python3.11/site-packages/pytak/asyncio_dgram/aio.py", line 49, in del
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/selector_events.py", line 839, in close
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/base_events.py", line 761, in call_soon
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: File "/usr/lib64/python3.11/asyncio/base_events.py", line 519, in _check_closed
Jun 27 14:27:34 localhost.localdomain adsbcot[6686]: RuntimeError: Event loop is closed
Jun 27 14:27:34 localhost.localdomain systemd[1]: adsbcot.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 14:27:34 localhost.localdomain systemd[1]: adsbcot.service: Failed with result 'exit-code'.
Jun 27 14:27:39 localhost.localdomain systemd[1]: adsbcot.service: Service RestartSec=5s expired, scheduling restart.
Jun 27 14:27:39 localhost.localdomain systemd[1]: adsbcot.service: Scheduled restart job, restart counter is at 40.

Has it something to do with Python version and event handling or anything else.
Best regards

Not all aircrafts get sent to the destination TAK server.

Not all aircrafts get sent to the destination TAK server. Only some.
Here is a dump:

DEBUG=1 adsbcot -C 127.0.0.1 -P 8087 -D http://127.0.0.1:/data/aircraft.json -I 5
2020-10-26 18:10:19,878 pycot INFO pycot.classes.__init__:175 - Using CoT Host 127.0.0.1:8087
2020-10-26 18:10:19,878 pycot DEBUG pycot.classes._setup_unicast_socket:184 - Setting up Unicast Socket.
2020-10-26 18:10:19,879 adsbcot INFO adsbcot.classes.run:94  - Running ADSBWorker
2020-10-26 18:10:19,880 adsbcot INFO adsbcot.classes.run:153  - Running CoTWorker
2020-10-26 18:10:19,887 adsbcot DEBUG adsbcot.classes._get_dump1090_feed:81  - Retrieved 2 aircraft
2020-10-26 18:10:19,888 adsbcot DEBUG adsbcot.classes._put_queue:65  - Handling ICAO24: 4409ae Flight: TAY4804
2020-10-26 18:10:19,890 adsbcot DEBUG adsbcot.classes._put_queue:65  - Handling ICAO24: 45ac54 Flight: SAS43E
2020-10-26 18:10:19,890 adsbcot DEBUG adsbcot.classes.run:159  - From msg_queue: "b'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><event version="2.0" type="a-n-A-C-F" uid="ICAO24.4409ae" time="2020-10-26T18:10:19.888372Z" start="2020-10-26T18:10:19.888372Z" stale="2020-10-26T19:10:19.888372Z" how="m-g"><point lat="58.788208" lon="14.305262" hae="23550" ce="10" le="10" /><detail><uid Droid="ICAO24.4409ae" /><contact callsign="TAY4804" /><track course="226.0" speed="340.9" /></detail></event>'"
2020-10-26 18:10:19,892 pycot DEBUG pycot.classes.send_cot:203 - Sending CoT to 127.0.0.1:8087: "b'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><event version="2.0" type="a-n-A-C-F" uid="ICAO24.4409ae" time="2020-10-26T18:10:19.888372Z" start="2020-10-26T18:10:19.888372Z" stale="2020-10-26T19:10:19.888372Z" how="m-g"><point lat="58.788208" lon="14.305262" hae="23550" ce="10" le="10" /><detail><uid Droid="ICAO24.4409ae" /><contact callsign="TAY4804" /><track course="226.0" speed="340.9" /></detail></event>\n'"
2020-10-26 18:10:19,893 adsbcot DEBUG adsbcot.classes.run:159  - From msg_queue: "b'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><event version="2.0" type="a-n-A-C-F" uid="ICAO24.45ac54" time="2020-10-26T18:10:19.890306Z" start="2020-10-26T18:10:19.890306Z" stale="2020-10-26T19:10:19.890306Z" how="m-g"><point lat="58.514161" lon="13.805695" hae="24625" ce="10" le="10" /><detail><uid Droid="ICAO24.45ac54" /><contact callsign="SAS43E" /><track course="230.8" speed="313.5" /></detail></event>'"
2020-10-26 18:10:19,894 pycot DEBUG pycot.classes.send_cot:203 - Sending CoT to 127.0.0.1:8087: "b'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><event version="2.0" type="a-n-A-C-F" uid="ICAO24.45ac54" time="2020-10-26T18:10:19.890306Z" start="2020-10-26T18:10:19.890306Z" stale="2020-10-26T19:10:19.890306Z" how="m-g"><point lat="58.514161" lon="13.805695" hae="24625" ce="10" le="10" /><detail><uid Droid="ICAO24.45ac54" /><contact callsign="SAS43E" /><track course="230.8" speed="313.5" /></detail></event>\n'"
^C2020-10-26 18:10:22,668 adsbcot DEBUG adsbcot.classes.stop:50  - Stopping ADSBWorker
2020-10-26 18:10:22,669 adsbcot DEBUG adsbcot.classes.stop:134  - Stopping ADSBWorker
2020-10-26 18:10:22,669 adsbcot DEBUG adsbcot.classes.stop:50  - Stopping ADSBWorker
2020-10-26 18:10:22,669 adsbcot DEBUG adsbcot.classes.stop:134  - Stopping ADSBWorker

Of the two aircrafts, this is the one that shows in the WinTAK client, connected to the server.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><event version="2.0" type="a-n-A-C-F" uid="ICAO24.4409ae" time="2020-10-26T18:10:05.511772Z" start="2020-10-26T18:10:05.511772Z" stale="2020-10-26T19:10:05.511772Z" how="m-g"><point lat="58.80474" lon="14.338165" hae="22675" ce="10" le="10" /><detail><uid Droid="ICAO24.4409ae" /><contact callsign="TAY4804" /><track course="226.0" speed="340.9" /></detail></event>

TypeError: unsupported type for timedelta hours component: str

Script running on raspberry pi 4, Raspbian OS.
Sending the data from dump1090-fa to FreeTAKServer 1.1.
Error seem to be related to the stale option.

Command:
DEBUG=1 adsbcot -C 127.0.0.1 -P 8087 -D http://127.0.0.1:/data/aircraft.json -I 5 -S 1

Error:

2020-10-26 18:01:18,529 adsbcot DEBUG adsbcot.classes._get_dump1090_feed:81  - Retrieved 3 aircraft
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/pi/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 98, in run
    self._get_dump1090_feed()
  File "/home/pi/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 82, in _get_dump1090_feed
    self._put_queue(aircraft)
  File "/home/pi/.local/lib/python3.7/site-packages/adsbcot/classes.py", line 59, in _put_queue
    cot_event = adsbcot.adsb_to_cot(craft, stale=self.stale)
  File "/home/pi/.local/lib/python3.7/site-packages/adsbcot/functions.py", line 82, in adsb_to_cot
    event.stale = time + datetime.timedelta(hours=stale)
TypeError: unsupported type for timedelta hours component: str

2020-10-26 18:01:18,545 adsbcot DEBUG adsbcot.classes.stop:50  - Stopping ADSBWorker
2020-10-26 18:01:18,546 adsbcot DEBUG adsbcot.classes.stop:134  - Stopping ADSBWorker

Request - Dockerfile for easy deploy

Will be grate if there exist docker file to build and start this application inside docker container.
I am ready to help here but unfortunately i cannot install and run any of your applications.

Winsock error

This seems like a cool project, but I'm not sure about the Windows support.
Since for any configuration, I get this error:

....
  File "F:\gv\Python310\lib\site-packages\pytak\client_functions.py", line 80, in create_udp_client
    reader = await dgbind((host, port))
  File "F:\gv\Python310\lib\site-packages\pytak\asyncio_dgram\aio.py", line 238, in bind
    transport, protocol = await loop.create_datagram_endpoint(
  File "F:\gv\Python310\lib\asyncio\base_events.py", line 1371, in create_datagram_endpoint
    raise exceptions[0]
  File "F:\gv\Python310\lib\asyncio\base_events.py", line 1355, in create_datagram_endpoint
    sock.bind(local_address)
OSError: [WinError 10049] Cannot assign requested address.

10049 == WSAEADDRNOTAVAIL.
Ref: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

With some added trace, I see the address in pytak/asyncio_dgram/aio.py is ('239.2.3.1', 6969) and family == 0 (AF_UNSPEC).

Even after adding COT_URL = udp://239.255.255.250:6969 to my config.ini, it fails.

adsbexchange Pi image fails to install

Install fails on python3 -m pip install adsbcot[with_pymodes], this is with fresh adsbexchange image running on a Pi3.

pi@adsbexchange:~ $ python3 -m pip install adsbcot[with_pymodes]
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting adsbcot[with_pymodes]
  Downloading https://www.piwheels.org/simple/adsbcot/adsbcot-5.1.1-py3-none-any.whl (13 kB)
Collecting pytak>=5.4.0
  Downloading https://www.piwheels.org/simple/pytak/pytak-5.4.1-py3-none-any.whl (21 kB)
Collecting aircot>=1.2.0
  Downloading https://www.piwheels.org/simple/aircot/aircot-1.2.0-py3-none-any.whl (12 kB)
Collecting aiohttp<4.0.0
  Downloading https://www.piwheels.org/simple/aiohttp/aiohttp-3.8.3-cp39-cp39-linux_armv7l.whl (926 kB)
     |████████████████████████████████| 926 kB 284 kB/s
Collecting pymodes>=2.8
  Downloading pymodes-2.14.tar.gz (392 kB)
     |████████████████████████████████| 392 kB 1.9 MB/s
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/resolvelib-0.5.4-py2.py3-none-any.whl/resolvelib/resolvers.py", line 171, in _merge_into_criterion
    crit = self.state.criteria[name]
KeyError: 'pymodes'

Multicast over localhost and not ETH0

Hi,
when we run adsbcot set to multicast udp+wo://239.2.3.1:6969 we see the multicast data over localhost and not over our LAN connected NIC.
Is there a (pytak) variable to set the destination network interface?
Funny enough we tried 2 different Raspberry Pi installs and get the same result on both. Wireshark shows all multicast data on 127.0.0.1 and not on eth0.

We must be missing something trivial.

pyModeS and generic install issues

Just wanted to post this but I think you are already aware;

for ubuntu users (20.04, 22.04) some additional packages need to be installed. I ran:

sudo apt install python3-pip -y
sudo python3 -m pip install --upgrade toml
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install pymodes>=2.8 (also tried with out the '>=2.8' but had mixed results saw that versions noted in the source code)

The default python version is 3.8

Also installed it from source via the latest in releases (zip file)

Functions otherwise via that method did not have much luck with installing via pip (with pyModeS)

When reading a feed from dump1090-fa get the error:

2023-08-03 00:17:38,647 pytak INFO - COT_URL: tcp://192.168.1.10:8093
2023-08-03 00:17:38,648 pytak INFO - COT_URL: tcp://192.168.1.10:8093
2023-08-03 00:17:38,648 pytak INFO - Using KNOWN_CRAFT: /home/admin/adsbcot/known_craft.csv
2023-08-03 00:17:38,648 pytak INFO - Run: <class 'pytak.classes.CLITool'>
2023-08-03 00:17:38,649 pytak INFO - Run: <class 'pytak.classes.TXWorker'>
2023-08-03 00:17:38,649 pytak INFO - Run: <class 'pytak.classes.RXWorker'>
2023-08-03 00:17:38,650 pytak INFO - Running <class 'adsbcot.classes.ADSBNetWorker'> for data_type: beast
2023-08-03 00:17:38,650 pytak INFO - Running <class 'adsbcot.classes.ADSBNetReceiver'> for tcp+beast://192.168.1.11:30005
2023-08-03 00:17:38,864 pytak INFO - Complete: <Task finished name='Task-4' coro=<ADSBNetWorker.run() done, defined at /usr/local/lib/python3.8/dist-packages/adsbcot-6.2.0b5-py3.8.egg/adsbcot/classes.py:248> exception=ValueError('too many values to unpack (expected 2)')>
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-4' coro=<ADSBNetWorker.run() done, defined at /usr/local/lib/python3.8/dist-packages/adsbcot-6.2.0b5-py3.8.egg/adsbcot/classes.py:248> exception=ValueError('too many values to unpack (expected 2)')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/adsbcot-6.2.0b5-py3.8.egg/adsbcot/classes.py", line 305, in run
    decoder.process_raw(
  File "/usr/local/lib/python3.8/dist-packages/pyModeS/streamer/decode.py", line 170, in process_raw
    ac["HVE"], ac["VVE"] = pms.adsb.nuc_v(msg)
ValueError: too many values to unpack (expected 2)

Seems to be an issue with pyModeS reading beast or raw feeds. The source machine is the latest version of dump1090-fa. Reading beats via 30005 with VRS and TAR1090.

JSON is not suitable in my application as it does not provide close to realtime data.

Test pyModeS it with:

modeslive --source net --connect 192.168.1.11 30005 beast

output shows no aircraft

any thoughts or pointers are appreciated! Can post more detail if needed.

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

>>> import pyModeS
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/usr/local/lib/python3.9/dist-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/usr/local/lib/python3.9/dist-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/pyModeS/__init__.py", line 12, in <module>
    from .decoder import adsb
  File "/usr/local/lib/python3.9/dist-packages/pyModeS/decoder/adsb.py", line 19, in <module>
    from pyModeS.decoder.bds.bds05 import (
  File "/usr/local/lib/python3.9/dist-packages/pyModeS/decoder/bds/__init__.py", line 21, in <module>
    import numpy as np
  File "/usr/local/lib/python3.9/dist-packages/numpy/__init__.py", line 144, in <module>
    from . import core
  File "/usr/local/lib/python3.9/dist-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/usr/bin/python"
  * The NumPy version is: "1.22.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libcblas.so.3: cannot open shared object file: No such file or directory

Add custom filter support

Add the ability to customize the ICAO filter for different users, for example, some users might only want to see their own aircraft.

Possibly use a YAML-based file to define these filters.

ADSB tracks received are reported with undefined course (9999999.0) to CoT network

Library version: 5.1.1
Platform: Raspberry Pi 4 8 GB running Ubuntu Server
TAK Server: Taky 0.8.4

I'm seeing tracks that are received by dump1090 being reported with an undefined course when received at my TAK application. When I poll the /data/aircraft.json page it shows that the aircraft has a course, however it is received as undefined when reported from Taky.

/data/aircraft.json

{"hex":"c0211f","flight":"MAL7054 ","alt_baro":34000,"alt_geom":33725,"gs":422.9,"track":245.6,"baro_rate":64,"squawk":"1053","emergency":"none","category":"A4","nav_qnh":1013.6,"nav_altitude_mcp":34016,"nav_heading":253.8,"nav_modes":["vnav","tcas"],"lat":45.140076,"lon":-76.108458,"nic":8,"rc":186,"seen_pos":3.2,"version":2,"nic_baro":1,"nac_p":9,"nac_v":1,"sil":3,"sil_type":"perhour","mlat":[],"tisb":[],"messages":4396,"seen":2.9,"rssi":-16.7}

CoT

<event version="2.0" uid="ICAO-C0211F" type="a-n-A-C-F" how="m-g" time="2022-12-16T03:20:08.437Z" start="2022-12-16T03:20:08.437Z" stale="2022-12-16T03:22:08.437Z"><point lat="45.612396" lon="-74.596163" hae="5227.3" ce="9.0" le="1.0"/><detail uid="ICAO-C0211F"><UID Droid="ICAO-C0211F"/><contact callsign="MAL7054"/><track course="9999999.0" speed="208.34982"/><remarks>MAL7054 Squawk: 1053 C0211F Cat.: A4 adsbcot@ubuntu</remarks></detail></event>

pytak no CoTWorker Attribute

Fresh install of adsbcot (after also installing asdbxcot)
Seems changes in pyTAK have resulted in breaking adsbcot

Command:
adsbcot -U 127.0.0.1:8087 -D tcp+beast:127.0.0.1:30005

Output:
File "/home/tak/.local/lib/python3.8/site-packages/adsbcot/commands.py", line 67, in cli
pytak.CoTWorker(
AttributeError: module 'pytak' has no attribute 'CoTWorker'

Fix systemd service for adsbexchange image

Service should be:


[Unit]
Description=ADSBCOT Service
After=multi-user.target

[Service]
ExecStart=/home/pi/.local/bin/adsbcot -c /etc/adsbcot.ini
Environment=PYTHONPATH=/home/pi/.local/lib/python3.9/site-packages
WorkingDirectory=/home/pi
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

adsbcot not found in /usr/local/bin/

First time running through the documents so pardon the ignorance.

I'm running a raspberry pi 4 8gb ( Bookworm version released 3-15-2024)

when look at the journalctl logs I see:
adsbcot.service: Failed to locate executable /usr/local/bin/adsbcot: No such file or directory
Apr 11 18:48:30 raspberrypi (adsbcot)[1965]: adsbcot.service: Failed at step EXEC spawning /usr/local/bin/adsbcot: No such file or directory

What did I do wrong?

Thank you in advance!

ADSBCOT No COT Data outbound on network to TAK Server

First Git post so go easy.

I have ADSBCOT running on Ubuntu server. 1090 data is coming in on the network port tcp+beast. This is confirmed.

ADSBCOT should be sending data outbound to tcp://x.x.x.x:YYYY. No data leaves the server to the TAK Server/Multicast/Any Endpoint. Confirmed with iftop.

Adding DEBUG = 1 to the adsbcot.ini file and executing adsbcot appears to load correctly at first. Then this "WARNING" appears and repeats until the process dies.

WARNING:asyncio:Executing <Task pending name='Task-3' coro=<ADSBNetWorker.run() running at /usr/local/lib/python3.10/dist-packages/adsbcot/classes.py:263> wait_for=<Future pending cb=[Task.task_wakeup()] created at /usr/lib/python3.10/asyncio/base_events.py:429> cb=[_wait.._on_completion() at /usr/lib/python3.10/asyncio/tasks.py:475] created at /usr/lib/python3.10/asyncio/tasks.py:636> took 0.101 seconds

The TAK Server reports ADSBCOT is connected on the port specified and gets 1x "read received" counter but no messages are received.

I have RTFM, Googled and finally looked at all the blogs and forum posts. It could be my TAK Server telling ADSBCOT to not send data, it could be ADSBCOT not sending it.

I've run out of ideas. I have either found a bug or reached the limit of my imagination. Either way I would like to know please.

Stuck in epoll_pwait

ADSBCOT will stop reading /run/*/aircraft.json after some time, and prints nothing else to the logs. An strace shows:

root@airtak-home:/boot# ps -ef|grep -i adsb
root       65480       1  0 May17 ?        00:00:00 /bin/bash /usr/local/sbin/run_adsbcot.sh
root       65481   65480  0 May17 ?        00:33:23 /usr/bin/python3 /usr/local/bin/adsbcot
root      499726   64351  0 23:31 pts/1    00:00:00 grep -i adsb
root@airtak-home:/boot# strace -p 65481
strace: Process 65481 attached
epoll_pwait(3, [], 3, 87, NULL, 8)      = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
...

NoneType error when finding aircrafts

It seems ADSBCOT crashes when a aircraft is missing any one piece of information (id, lat, long, etc). My question is how should this be handled? Should it be logged and the program continues or if the piece of information isn't critical (lat, long I would consider the critical part), should it just not provide that information? My current workaround is having a try and except check in classes.py on line 255 and it just ignores any aircraft missing a certain piece of information.

Crash if lost connection to FTS server

2023-05-13 09:45:39,906 pytak INFO - Complete: <Task finished name='Task-4' coro=<RXWorker.run() done, defined at /usr/local/lib/python3.9/site-packages/pytak/classes.py:173> exception=IncompleteReadError('0 bytes read on a total of undefined expected bytes')>
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-4' coro=<RXWorker.run() done, defined at /usr/local/lib/python3.9/site-packages/pytak/classes.py:173> exception=IncompleteReadError('0 bytes read on a total of undefined expected bytes')>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pytak/classes.py", line 179, in run
data: bytes = await self.readcot()
File "/usr/local/lib/python3.9/site-packages/pytak/classes.py", line 168, in readcot
return await self.reader.readuntil("".encode("UTF-8"))
File "/usr/local/lib/python3.9/asyncio/streams.py", line 629, in readuntil
raise exceptions.IncompleteReadError(chunk, None)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of undefined expected bytes

ERROR from adsbcot Please reinstall adsbcot with pyModeS support:

          If you try to run debug with config, you gonna receive different err. output

DEBUG=1 adsbcot -c /configpath/myconfig.ini


ERROR from adsbcot
Please reinstall adsbcot with pyModeS support:
$ python3 -m pip install adsbcot[with_pymodes]


i am not a programmer....
however i think is something related to pymodes 2.15, the pymodes cannot be installed correctly in my machine

it seams there have problem with pymodes and python version in my case
Python 2.7.18 or Python 3.8.10 i am not sure which one is used.

Originally posted by @daskalovst in #22 (comment)

Too many aircraft -- [WARNING] Queue full, dropping oldest data, not all the aircraft show up

I have an ADSB feeder with a rather good view and antenna. I get the following WARNINGs when feeding.

[INFO] Retrieved 214 ADS-B aircraft messages. [WARNING] Queue full, dropping oldest data. [WARNING] Queue full, dropping oldest data. [WARNING] Queue full, dropping oldest data. [WARNING] Queue full, dropping oldest data. ....
etc etc.

1090 Map shows:

image

And the following data ends up through my TAK server.

image

Latest install instructions do not properly install pytak

Following the install instruction on Ubuntu via the .deb file route does not result in a working install.

Everything seems to install, but adsbcot complains about the pytak module not being available. I can see the pytak folder in the right spot, but python3 can't pick it up.

Doing a pytak install via pip, followed by installing adsbcot from source did work.

Debian package build is broken

running sdist_dsc
running egg_info
writing adsbcot.egg-info/PKG-INFO
writing dependency_links to adsbcot.egg-info/dependency_links.txt
writing entry points to adsbcot.egg-info/entry_points.txt
writing requirements to adsbcot.egg-info/requires.txt
writing top-level names to adsbcot.egg-info/top_level.txt
adding license file 'LICENSE' (matched pattern 'LICENSE')
reading manifest file 'adsbcot.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'requirements.txt'
writing manifest file 'adsbcot.egg-info/SOURCES.txt'
running sdist
running check
creating adsbcot-6.2.0b4
creating adsbcot-6.2.0b4/adsbcot.egg-info
copying files to adsbcot-6.2.0b4...
copying LICENSE -> adsbcot-6.2.0b4
copying MANIFEST.in -> adsbcot-6.2.0b4
copying README.rst -> adsbcot-6.2.0b4
copying setup.cfg -> adsbcot-6.2.0b4
copying setup.py -> adsbcot-6.2.0b4
copying adsbcot.egg-info/PKG-INFO -> adsbcot-6.2.0b4/adsbcot.egg-info
copying adsbcot.egg-info/SOURCES.txt -> adsbcot-6.2.0b4/adsbcot.egg-info
copying adsbcot.egg-info/dependency_links.txt -> adsbcot-6.2.0b4/adsbcot.egg-info
copying adsbcot.egg-info/entry_points.txt -> adsbcot-6.2.0b4/adsbcot.egg-info
copying adsbcot.egg-info/requires.txt -> adsbcot-6.2.0b4/adsbcot.egg-info
copying adsbcot.egg-info/top_level.txt -> adsbcot-6.2.0b4/adsbcot.egg-info
Writing adsbcot-6.2.0b4/setup.cfg
Creating tar archive
removing 'adsbcot-6.2.0b4' (and everything under it)
dpkg-buildpackage: info: source package adsbcot
dpkg-buildpackage: info: source version 6.2.0b4-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Greg Albrecht <[email protected]> <[email protected]>
 dpkg-source --before-build .
dpkg-source: info: using options from adsbcot-6.2.0b4/debian/source/options: --extend-diff-ignore=\.egg-info$
 fakeroot debian/rules clean
dh clean --with python3 --buildsystem=python_distutils
dh: warning: Compatibility levels before 10 are deprecated (level 9 in use)
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/gba/src/SNS/adsbcot/deb_dist/adsbcot-6.2.0b4'
python3 setup.py clean -a
Traceback (most recent call last):
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 387, in _parse_attr
    return getattr(StaticModule(module_name), attr_name)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 25, in __init__
    with open(spec.origin) as strm:
AttributeError: 'NoneType' object has no attribute 'origin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gba/src/SNS/adsbcot/deb_dist/adsbcot-6.2.0b4/setup.py", line 25, in <module>
    setup()
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/gba/.pyenv/versions/3.9.6/lib/python3.9/distutils/core.py", line 121, in setup
    dist.parse_config_files()
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/dist.py", line 715, in parse_config_files
    parse_configuration(self, self.command_options,
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 157, in parse_configuration
    meta.parse()
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 463, in parse
    section_parser_method(section_options)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 436, in parse_section
    self[name] = value
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 220, in __setitem__
    value = parser(value)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 552, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/config.py", line 390, in _parse_attr
    module = importlib.import_module(module_name)
  File "/home/gba/.pyenv/versions/3.9.6/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'adsbcot'
make[1]: *** [debian/rules:10: override_dh_auto_clean] Error 1
make[1]: Leaving directory '/home/gba/src/SNS/adsbcot/deb_dist/adsbcot-6.2.0b4'
make: *** [debian/rules:7: clean] Error 2
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
Traceback (most recent call last):
  File "/home/gba/src/SNS/adsbcot/setup.py", line 25, in <module>
    setup()
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/gba/.pyenv/versions/3.9.6/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/gba/.pyenv/versions/3.9.6/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/gba/.pyenv/versions/3.9.6/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/stdeb/command/sdist_dsc.py", line 137, in run
    build_dsc(debinfo,
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/stdeb/util.py", line 1569, in build_dsc
    dpkg_buildpackage(*args, cwd=fullpath_repackaged_dirname)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/stdeb/util.py", line 585, in dpkg_buildpackage
    process_command(args, cwd=cwd)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/stdeb/util.py", line 226, in process_command
    check_call(args, cwd=cwd)
  File "/home/gba/.pyenv/versions/tak/lib/python3.9/site-packages/stdeb/util.py", line 59, in check_call
    raise CalledProcessError(retcode)
stdeb.util.CalledProcessError: 2

Native Debian Support

Would be nice to deploy natively in Debian along with pytak to allow for rapid setup and headless operation, for instance on remote communication sites.

Slow update speed

The speed at which ADSB data is sent to FTS is slow. Running dump1090-fa and looking at the local web interface, it shows that multiple updates are received each second for every visible aircraft. Despite having sub 1 second position updates for all aircraft, aircraft position information is uploaded/updated on the server at a rate of one aircraft every 2-5 seconds using the http json method. Using tcp+beast results in an upload/update rate of one aircraft every 5-15 seconds and typically the application hangs after 4-6 aircraft are uploaded. Using tcp+raw results in a hang after the first aircraft is uploaded. The script doesn't generate any errors when it hangs.

The slow update speed does not appear to be a server resource limitation. While I have been testing on a Pi4, this same issue is (was?) occurring on the public server which I believe is more powerful than a Pi. In further support of this, it is possible to simultaneously run adsbcot and aprscot on the same pi without any negative impact on the rate of position updates, despite the server being subjected to twice the load. Conversely, stopping aprscot will not improve the refresh rate of adsbcot. Sending multiple cots and map objects using an EUD will also not have any negative impact on the rate of updates coming from adsbcot.

A significant problem will arise from this slow update rate in the form of a queue developing. It would seem that when a poll is performed, a snapshot in time is taken of all currently received aircraft. This list of aircraft is then sent slowly, one by one, to the server at a rate of one aircraft every 2-5 seconds. If another poll is performed before this list is finished being sent, the new snapshot is simply added to the end of the current list. As time goes on the list grows, and the positions of the aircraft begin to lag behind their real world locations. The result is the appearance of aircraft traveling in slow motion. Attempting to reduce the polling interval in order to update the aircraft positions more frequently will worsen the issue as it adds more snapshots to the queue. The workaround for this is to estimate the largest number of aircraft that might be simultaneously received, and plan for a large enough polling interval that the full queue will be cleared before the next poll. In high traffic areas this will necessitate very slow updates, and at times when the skies are relatively clear there will be large needless delays in position updates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.