snstac / adsbcot

Display Aircraft in TAK - ADS-B to TAK Gateway
https://adsbcot.rtfd.io
Apache License 2.0
86 stars 22 forks source link

TypeError: unsupported type for timedelta hours component: str #1

Open zyntacz opened 3 years ago

zyntacz commented 3 years ago

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