rouyng / airspotbot

twitter bot for automatically posting adsbexchange activity
GNU General Public License v3.0
5 stars 0 forks source link

API Key ADSBx #1

Closed countryboy057 closed 4 years ago

countryboy057 commented 4 years ago

Hello,

First of all Thank You for doing this! I run the buffskycircles twitter account using John Wiseman Advisory Circular code. I would like to make a server and run your code on it. What do I have to do to use mt ADSBx key that was given to me since I am a feeder.

rouyng commented 4 years ago

Hi, great to hear you would like to use it. Using the adsbx api for feeders should be pretty easy to accomplish with minimal modifications to the code. I just haven't supported it yet because I cannot personally test it. If you're ok with doing a little testing and giving me feedback on any problems, I can make an experimental branch with this capability. Let me know.

countryboy057 commented 4 years ago

Yes absolutely I can test it out.

I can also try and get another api key since I have like 8 different sites to ADSBx

On Wed, Jun 17, 2020 at 5:17 PM Ross notifications@github.com wrote:

Hi, great to hear you would like to use it. Using the adsbx api for feeders should be pretty easy to accomplish with minimal modifications to the code. I just haven't supported it yet because I cannot personally test it. If you're ok with doing a little testing and giving me feedback on any problems, I can make an experimental branch with this capability. Let me know.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-645629940, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMFWKQG7QV2WTWBC7FDRXEXHVANCNFSM4OA7CDAQ .

rouyng commented 4 years ago

Ok, here you go https://github.com/rouyng/airspotbot/tree/adsb-api

countryboy057 commented 4 years ago

Ok rally stupid stupid question. I have never done a merge with Git. I already have your master cloned on my server. What command do I run to merge them ?

On Wed, Jun 17, 2020 at 6:00 PM Ross notifications@github.com wrote:

Ok, here you go https://github.com/rouyng/airspotbot/tree/adsb-api

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-645648161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMH4XRN4VKK3CLXKD7DRXE4G5ANCNFSM4OA7CDAQ .

countryboy057 commented 4 years ago

Nevermind. I got it! Looks like it is running. Is email better for then via issues?

On Wed, Jun 17, 2020 at 6:57 PM Branden Watson w2brw1@gmail.com wrote:

Ok rally stupid stupid question. I have never done a merge with Git. I already have your master cloned on my server. What command do I run to merge them ?

On Wed, Jun 17, 2020 at 6:00 PM Ross notifications@github.com wrote:

Ok, here you go https://github.com/rouyng/airspotbot/tree/adsb-api

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-645648161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMH4XRN4VKK3CLXKD7DRXE4G5ANCNFSM4OA7CDAQ .

rouyng commented 4 years ago

Looks like you missed a word or two in that reply? Glad it seems to be working. If you're not seeing any unexpected behavior after running for a couple days let me know and I will merge the adsb-api branch into master. Thank you!

countryboy057 commented 4 years ago

It has been running for a day but I don't believe it is detecting anything. I have 2 USAF tankers 5 miles from the listed lat and long in the config and nothing has happened?

On Wed, Jun 17, 2020 at 7:17 PM Ross notifications@github.com wrote:

Looks like you missed a word or two in that reply? Glad it seems to be working. If you're not seeing any unexpected behavior after running for a couple days let me know and I will merge the adsb-api branch into master. Thank you!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-645674845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMH7ACAJS5O3KBTP4MDRXFFIJANCNFSM4OA7CDAQ .

rouyng commented 4 years ago

Can I see your asb.config (with api keys removed) and watchlist.csv? What does the log look like?

rouyng commented 4 years ago

remove your keys from the log as well, plz ;)

countryboy057 commented 4 years ago

Lol Ill just regen the secret token. Its just a twitter key lol but here it is again

On Thu, Jun 18, 2020 at 1:13 PM Ross notifications@github.com wrote:

remove your keys from the log as well, plz ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-646185674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMDHJAFY4NHVDCOMNDDRXJDM5ANCNFSM4OA7CDAQ .

bot@bot5:~/airspotbot/airspotbot$ python3 airspotbot.py

18-Jun-20 15:00:54 - INFO: Authentication OK 18-Jun-20 15:00:54 - INFO: Twitter API created 18-Jun-20 15:00:54 - INFO: Loading ADSB exchange configuration from asb.config 18-Jun-20 15:00:54 - INFO: Loading watchlist from watchlist.csv 18-Jun-20 15:00:54 - INFO: Added H60 to type code watchlist. Military only: False Description: "UH-60 Black Hawk" 18-Jun-20 15:00:54 - INFO: Added EC45 to type code watchlist. Military only: True Description: "USAF/US Army/National Guard UH-72 Lakota" 18-Jun-20 15:00:54 - INFO: Added SW4 to type code watchlist. Military only: True Description: "USAF RC-26B spy plane" 18-Jun-20 15:00:54 - INFO: Added N357FB to reg num watchlist. Description: "Eurocopter AS350 owned by Phoenix PD" 18-Jun-20 15:00:54 - INFO: Added N359FB to reg num watchlist. Description: "Eurocopter AS350 owned by Phoenix PD" 18-Jun-20 15:00:54 - INFO: Added N125HD to reg num watchlist. Description: "Eurocopter AS350 KPHO-TV/KTVK/KPNX news helicopter" 18-Jun-20 15:00:54 - INFO: Added N351FB to reg num watchlist. Description: "Eurocopter AS350 owned by Phoenix PD" 18-Jun-20 15:00:54 - INFO: Added N353FB to reg num watchlist. Description: "Eurocopter AS350 owned by Phoenix PD" 18-Jun-20 15:00:54 - INFO: Added N507MP to reg num watchlist. Description: "MD 530F owned by Mesa PD" 18-Jun-20 15:00:54 - INFO: Added N911AZ to reg num watchlist. Description: "Bell 429 owned by AZ Department of Public Safety" 18-Jun-20 15:00:54 - INFO: Added N620FB to reg num watchlist. Description: "Pilatus PC12 surveillance plane owned by Phoenix PD" 18-Jun-20 15:00:54 - INFO: Added N662CV to reg num watchlist. Description: "Bell 407 DEA surveillance helicopter (Silver Creek Aviation)" 18-Jun-20 15:00:54 - INFO: Added AD9ECA to ICAO address watchlist. Description: "Bell 407 owned by Maricopa County Sheriff's Office" 18-Jun-20 15:00:54 - INFO: Added Q1 to type code watchlist. Military only: False Description: "MQ-1 Predator drone" 18-Jun-20 15:00:54 - INFO: Added Q9 to type code watchlist. Military only: False Description: "MQ-9 Predator B drone" 18-Jun-20 15:00:54 - INFO: Added Q4 to type code watchlist. Military only: False Description: "Global Hawk drone" 18-Jun-20 15:00:54 - INFO: Added N1000 to reg num watchlist. Description: "US MIL" 18-Jun-20 15:00:54 - INFO: Added N752AM to reg num watchlist. Description: "DHS" 18-Jun-20 15:00:54 - INFO: Added 18 entries to the watchlist 18-Jun-20 15:00:54 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:05:55 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:10:55 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:15:56 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:20:56 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:25:57 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:30:57 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:35:57 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:40:58 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:45:58 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:50:59 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 15:55:59 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 16:01:00 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 16:06:00 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx) 18-Jun-20 16:11:01 - INFO: Checking for aircraft via ADSBx API (endpoint: adsbx)

rouyng commented 4 years ago

Also you may have to attach the files to the comment on the issue rather than via email, I can't see them.

countryboy057 commented 4 years ago

asb.zip

rouyng commented 4 years ago

You are missing values in the "Type" field for "N1" entries in your watchlist. Values should be "RN". However, I would expect the bot to see AE07C1, for example, with your current settings, unless ADSBx does not have that plane flagged as military for some reason. I've updated the branch with some additional debugging information. Run it again and the log should be much longer now but give me information to figure out what exactly is happening.

countryboy057 commented 4 years ago

Here is what I am getting

19-Jun-20 10:55:42 - DEBUG: Setting interval to 3600 Traceback (most recent call last): File "airspotbot.py", line 106, in spots = adsbget.Spotter('asb.config', 'watchlist.csv') File "/home/bot/airspotbot/airspotbot/adsbget.py", line 31, in init self.read_adsb_config() File "/home/bot/airspotbot/airspotbot/adsbget.py", line 44, in read_adsb_config logging.debug(f"Setting latitude to {self.lat}") AttributeError: 'Spotter' object has no attribute 'lat'

rouyng commented 4 years ago

whoops, that's my bad. fixed now, pull it again

countryboy057 commented 4 years ago

I dont think the api key is being processed right. This is what i get The CONTACT ADSBX is what makes me think its not processing the api-auth right or something

19-Jun-20 15:38:16 - DEBUG: Spotted aircraft AD5B00. Full data: {'postime': '1592581096692', 'icao': 'AD5B00', 'reg': 'CONTACTADSBX', 'type': '787', 'wtc': '1', 'spdtyp': '1', 'spd': '999', 'altt': '0', 'alt': '35000', 'galt': '35000', 'talt': '69000', 'lat': '0', 'lon': '0', 'vsit': '0', 'vsi': '0', 'trkh': '0', 'ttrk': '180', 'trak': '50', 'sqk': '7600', 'call': 'NEEDFEED', 'gnd': '0', 'trt': '2', 'pos': '1', 'mlat': '0', 'tisb': '0', 'sat': '0', 'opicao': 'ADSBX', 'cou': 'USA', 'mil': '0'} 19-Jun-20 15:38:16 - DEBUG: No spotting critera met, not added to queue

rouyng commented 4 years ago

Just to confirm, is this key functioning correctly in other applications?

countryboy057 commented 4 years ago

Yes I am using it on a advisory circular app.

On Fri, Jun 19, 2020, 7:44 PM Ross notifications@github.com wrote:

Just to confirm, is this key functioning correctly in other applications?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-646899316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMD5ZMCIZGQIES722ZLRXPZ4DANCNFSM4OA7CDAQ .

rouyng commented 4 years ago

I've consulted with the adsbx dev and that message is usually due to an incorrect API key value, can you please double check the key in your config file?

there's also a possibility that some leading or trailing whitespace was causing an issue, i fixed that in the code so please pull and test again

thanks again for your efforts on this!

countryboy057 commented 4 years ago

I pulled the latest code and still get the same error. When I do a curl -H from the same server I get working data with my api key. See below

curl -H "api-auth:REMOVEDAPIKEY" https://adsbexchange.com/api/aircraft/json/lat/42.689033/lon/-78.45360/dist/50/ {"ac":[{"postime":"1592749102635","icao":"AAAD8F","reg":"N7875A","type":"B737","wtc":"2","spd":"271.7","altt":"0","alt":"5875","galt":"5915","talt":"10016","lat":"42.882889","lon":"-78.899848","vsit":"0","vsi":"3520","trkh":"0","ttrk":"272.1","trak":"262","sqk":"7424","call":"SWA2177","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"SWA","cou":"United States","mil":"0","interested":"0","from":"KSAN San Diego United States","to":"KSMF Sacramento United States","dst":"22.83"},{"postime":"1592749103723","icao":"A374FD","reg":"N3214T","type":"C177","wtc":"1","spd":"100.3","altt":"0","alt":"2600","galt":"2659","talt":"","lat":"43.315475","lon":"-78.050452","vsit":"1","vsi":"-64","trkh":"0","ttrk":"","trak":"274.6","sqk":"1200","call":"N3214T","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"41.54"},{"postime":"1592749102928","icao":"ACC79D","reg":"N922WS","type":"CH7A","wtc":"1","spd":"93.9","altt":"0","alt":"3000","galt":"3050","talt":"","lat":"42.882897","lon":"-77.800271","vsit":"1","vsi":"0","trkh":"0","ttrk":"","trak":"198.6","sqk":"1200","call":"N922WS","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"31.03"},{"postime":"1592749104010","icao":"A9ED7E","reg":"N739LK","type":"C172","wtc":"1","spd":"96.8","altt":"0","alt":"3075","galt":"3155","talt":"","lat":"42.822612","lon":"-77.723825","vsit":"1","vsi":"0","trkh":"0","ttrk":"","trak":"123.2","sqk":"1200","call":"N739LK","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"33.13"},{"postime":"1592749104378","icao":"AC0882","reg":"N8747C","type":"RV4","wtc":"1","spd":"129.5","altt":"0","alt":"1750","galt":"1789","talt":"","lat":"42.747198","lon":"-78.718446","vsit":"1","vsi":"-448","trkh":"0","ttrk":"","trak":"34.3","sqk":"1200","call":"N8747C","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"12.18"},{"postime":"1592749103719","icao":"ADF1D3","reg":"N998RA","type":"C172","wtc":"1","spd":"104","altt":"0","alt":"3800","galt":"3850","talt":"","lat":"42.845237","lon":"-77.401428","vsit":"1","vsi":"64","trkh":"0","ttrk":"","trak":"128","sqk":"0312","call":"N998RA","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"47.28"},{"postime":"1592749103004","icao":"A0D1BF","reg":"N152BJ","type":"C152","wtc":"1","spd":"93.2","altt":"0","alt":"2600","galt":"2710","talt":"","lat":"42.143462","lon":"-79.255435","vsit":"1","vsi":"-512","trkh":"0","ttrk":"","trak":"22.7","sqk":"1200","call":"N152BJ","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"48.3"},{"postime":"1592749102302","icao":"A1D796","reg":"N218DS","type":"DA40","wtc":"1","spd":"124.5","altt":"0","alt":"5975","galt":"6015","talt":"6016","lat":"42.847092","lon":"-78.582395","vsit":"0","vsi":"-64","trkh":"0","ttrk":"","trak":"330.1","sqk":"3010","call":"N218DS","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"11.05"},{"postime":"1592749102112","icao":"AA61AD","reg":"N7680W","type":"P28A","wtc":"1","spd":"92.1","altt":"0","alt":"1775","galt":"1834","talt":"","lat":"43.046585","lon":"-78.177242","vsit":"1","vsi":"128","trkh":"0","ttrk":"","trak":"267.5","sqk":"1200","call":"N7680W","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"24.66"},{"postime":"1592749101813","icao":"C03D40","reg":"C-FXFB","type":"P28R","wtc":"1","spd":"93.7","altt":"0","alt":"1100","galt":"1100","talt":"","lat":"43.003468","lon":"-79.326063","vsit":"1","vsi":"-192","trkh":"0","ttrk":"","trak":"96.7","sqk":"1200","call":"CFXFB","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"Canada","mil":"0","interested":"0","dst":"42.76"},{"postime":"1592749103720","icao":"AA4618","reg":"N761JS","type":"C560","wtc":"2","spd":"413.7","altt":"0","alt":"23725","galt":"23725","talt":"","lat":"43.204527","lon":"-78.347495","vsit":"0","vsi":"-2368","trkh":"0","ttrk":"","trak":"277.6","sqk":"3435","call":"N761JS","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"31.28"},{"postime":"1592749103721","icao":"AE5778","reg":"","type":"","wtc":"0","spd":"122.7","altt":"0","alt":"4375","galt":"4505","talt":"4480","lat":"42.621918","lon":"-78.129959","vsit":"0","vsi":"0","trkh":"0","ttrk":"300.2","trak":"251","sqk":"1200","call":"R20648","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"1","interested":"0","dst":"14.84"},{"postime":"1592749103673","icao":"A5A8D3","reg":"N464DS","type":"DA40","wtc":"1","spd":"133.9","altt":"0","alt":"2975","galt":"3015","talt":"3008","lat":"43.025347","lon":"-78.856201","vsit":"0","vsi":"-448","trkh":"0","ttrk":"","trak":"21","sqk":"5263","call":"N464DS","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"26.85"},{"postime":"1592749101217","icao":"A3F00A","reg":"N353AZ","type":"B763","wtc":"3","spd":"464.4","altt":"0","alt":"37000","galt":"37010","talt":"36992","lat":"43.113602","lon":"-79.140142","vsit":"0","vsi":"0","trkh":"0","ttrk":"97.7","trak":"87.7","sqk":"3570","call":"ATN3412","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"GTI","cou":"United States","mil":"0","interested":"0","dst":"39.49"}],"total":14,"ctime":1592749108773,"ptime":43}bot@bot5 :~/airspotbot/airspotbot$

On Sat, Jun 20, 2020 at 2:58 PM Ross notifications@github.com wrote:

I've consulted with the adsbx dev and that message is usually due to an incorrect API key value, can you please double check the key in your config file?

there's also a possibility that some leading or trailing whitespace was causing an issue, i fixed that in the code so please pull and test again

thanks again for your efforts on this!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rouyng/airspotbot/issues/1#issuecomment-647033471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODWIMGILEYCA4FHXUNKIETRXUBFLANCNFSM4OA7CDAQ .

rouyng commented 4 years ago

I got an adsb api access today so I could test this myself and I'm unable to replicate your problem when using a valid uuid that has api access enabled. It works as expected for me. Can you please confirm that the end of your asb.config appears as follows: # adsbexchange.com API key info # set adsb_api to "rapidapi" or "free", depending on which endpoint you are using adsb_api = adsbx # if using rapidapi to access ADSBx data, put your api key below. # if using the ADSBx API directly, your feeder uuid should go here as it acts as your api key adsb_api_key = puty0ur-r34l-uu1d-h3r3-b3for3runn1ng

countryboy057 commented 4 years ago

Yes here is my config

airspotbot configuration file

see README.md for more information

[TWITTER]

twitter API key info

consumer_key=MYKEYISHERE consumer_secret=MYKEYISHERE access_token=MYKEYISHERE access_token_secret=MYKEYISHERE

configure twitter behavior with the following options

minimum interval between tweets (seconds)

tweet_interval=30

automatically add descriptions from watchlist.csv in tweets

use_descriptions=y

automatically reply to the tweet with a link to photos of aircraft with that registration number

reply_jetphotos=y

tweet when ADSBexchange API is not responding (down or key expired)

down_tweet=y

[ADSB]

aircraft spotting location configuration

latitude of spot circle center

lat= 42.689036

longitude of spot circle center

long= -78.855017

radius of circle to check for spots (in nautical miles)

radius = 100

interval to check adsb (seconds)

adsb_interval = 300

cooldown timer to re-report a previous spot if still active (seconds).

cooldown = 3600

always spot aircraft with unknown reg number

spot_unknown = y

always spot aircraft with military serial number (i.e. 12-12345)?

spot_mil = y

adsbexchange.com API key info

set adsb_api to "rapidapi" or "free", depending on which endpoint you are using

adsb_api = adsbx

if using rapidapi to access ADSBx data, put your api key below.

if using the ADSBx API directly, your feeder uuid should go here as it acts as your api key

adsb_api_key = MYKEYISHERE

countryboy057 commented 4 years ago

What OS are you using to run this on ? I am using Ubuntu 18.04.

rouyng commented 4 years ago

I am currently running a bot in a Docker container using the python:3.7-slim-buster image (based on Debian Buster). I have also run it on Windows 10. Sorry, I haven't gotten back to you because I cannot reproduce the issue you are having. I'm hoping if someone else encounters it we might be able to have some more data points that will help determine a fix.

countryboy057 commented 4 years ago

Can I see your asb.config file with your keys removed of course.

rouyng commented 4 years ago

Here you go asb_example.zip

countryboy057 commented 4 years ago

Can you make a python script with the below text and then add your api key and let me know if it works for you.

import requests headers = { 'api-auth' : "key removed" } response = requests.get('https://adsbexchange.com/api/aircraft/json/lat/42.689033/lon/-78.45360/dist/50/', headers = headers) data = response.text print(response.text)

rouyng commented 4 years ago

Yeah, works great with my key. {"ac":[{"postime":"1593196832807","icao":"AABC53","reg":"N791GA","type":"GA7","wtc":"1","spd":"96","altt":"0","alt":"1550","galt":"1609","talt":"","lat":"42.467102","lon":"-79.271164","vsit":"1","vsi":"384","trkh":"0","ttrk":"","trak":"56.5","sqk":"1200","call":"N791GA","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"38.5"},{"postime":"1593196832352","icao":"A1DE58","reg":"N21971","type":"C182","wtc":"1","spd":"151","altt":"0","alt":"3000","galt":"3010","talt":"3008","lat":"42.993347","lon":"-78.356025","vsit":"0","vsi":"0","trkh":"0","ttrk":"","trak":"73.8","sqk":"1200","call":"N21971","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"18.76"},{"postime":"1593196832807","icao":"A1F50C","reg":"N225RA","type":"C172","wtc":"1","spd":"60.4","altt":"0","alt":"600","galt":"870","talt":"","lat":"43.121201","lon":"-77.658713","vsit":"0","vsi":"-448","trkh":"0","ttrk":"250.3","trak":"243.4","sqk":"0330","call":"N225RA","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"43.5"},{"postime":"1593196832805","icao":"AC3B24","reg":"N8877A","type":"CRJ2","wtc":"2","spd":"421.5","altt":"0","alt":"20550","galt":"20540","talt":"19008","lat":"42.256897","lon":"-78.566541","vsit":"1","vsi":"-576","trkh":"0","ttrk":"","trak":"80.7","sqk":"4134","call":"EDV4888","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"EDV","cou":"United States","mil":"0","interested":"0","dst":"26.4"},{"postime":"1593196832504","icao":"AD6C3B","reg":"N964NN","type":"B738","wtc":"2","spd":"391.9","altt":"0","alt":"36000","galt":"36010","talt":"36000","lat":"42.186493","lon":"-78.060795","vsit":"0","vsi":"64","trkh":"0","ttrk":"305.2","trak":"289.7","sqk":"1610","call":"AAL516","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"AAL","cou":"United States","mil":"0","interested":"0","from":"KLGA La Guardia New York United States","to":"KORD Chicago OHare United States","dst":"34.81"},{"postime":"1593196832502","icao":"A7566A","reg":"N572FX","type":"CL35","wtc":"2","spd":"482.6","altt":"0","alt":"44000","galt":"43990","talt":"40992","lat":"42.846773","lon":"-78.202318","vsit":"1","vsi":"-1088","trkh":"0","ttrk":"112.5","trak":"102.6","sqk":"2446","call":"LXJ572","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"LXJ","cou":"United States","mil":"0","interested":"0","dst":"14.56"},{"postime":"1593196832353","icao":"AA4E52","reg":"N763SW","type":"B737","wtc":"2","spd":"393.1","altt":"0","alt":"40000","galt":"40010","talt":"40000","lat":"42.217255","lon":"-78.968977","vsit":"0","vsi":"0","trkh":"0","ttrk":"279.1","trak":"260.8","sqk":"2063","call":"SWA406","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"SWA","cou":"United States","mil":"0","interested":"0","from":"KBDL Bradley Hartford United States","to":"KBWI BaltimoreWashington International Thurgood Marshal Baltimore United States","dst":"36.36"},{"postime":"1593196832353","icao":"A44B84","reg":"N376QS","type":"C680","wtc":"2","spd":"464.3","altt":"0","alt":"41000","galt":"41010","talt":"41024","lat":"42.132801","lon":"-78.660576","vsit":"0","vsi":"320","trkh":"0","ttrk":"","trak":"76.8","sqk":"0545","call":"EJA376","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"EJA","cou":"United States","mil":"0","interested":"0","dst":"34.61"},{"postime":"1593196832202","icao":"A4C4AA","reg":"N406TX","type":"C25B","wtc":"1","spd":"284.7","altt":"0","alt":"7000","galt":"7040","talt":"7008","lat":"42.375012","lon":"-77.549616","vsit":"1","vsi":"0","trkh":"0","ttrk":"26","trak":"17.2","sqk":"6231","call":"N406TX","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"44.19"},{"postime":"1593196832059","icao":"A3CD99","reg":"N344QS","type":"E55P","wtc":"2","spd":"433.9","altt":"0","alt":"41000","galt":"40990","talt":"40992","lat":"42.12204","lon":"-77.956051","vsit":"0","vsi":"64","trkh":"0","ttrk":"66.8","trak":"70.9","sqk":"5601","call":"EJA344","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"EJA","cou":"United States","mil":"0","interested":"0","from":"LGKP Karpathos Karpathos Island Greece","to":"ESGG Gothenburg-Landvetter Gothenburg Sweden","dst":"40.54"},{"postime":"1593196832055","icao":"A394AD","reg":"N33NL","type":"H25B","wtc":"2","spd":"18.5","altt":"0","alt":"","galt":"","talt":"","lat":"42.942577","lon":"-78.733733","vsit":"0","vsi":"","trkh":"1","ttrk":"","trak":"126.6","sqk":"4107","call":"N33NL","gnd":"1","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"19.58"},{"postime":"1593196834022","icao":"A7E288","reg":"N607PC","type":"SR22","wtc":"1","spd":"150.2","altt":"0","alt":"4425","galt":"4455","talt":"","lat":"42.923859","lon":"-78.202153","vsit":"1","vsi":"0","trkh":"0","ttrk":"","trak":"287.8","sqk":"2750","call":"N607PC","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"17.92"},{"postime":"1593196833947","icao":"A3F753","reg":"N3549Y","type":"C182","wtc":"1","spd":"120.2","altt":"0","alt":"4400","galt":"4430","talt":"","lat":"43.207443","lon":"-78.211734","vsit":"1","vsi":"-1088","trkh":"0","ttrk":"","trak":"289.9","sqk":"0417","call":"N3549Y","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"","cou":"United States","mil":"0","interested":"0","dst":"32.87"},{"postime":"1593196833109","icao":"A71B6D","reg":"N557WN","type":"B737","wtc":"2","spd":"276.4","altt":"0","alt":"7675","galt":"7715","talt":"4000","lat":"42.635651","lon":"-78.524156","vsit":"0","vsi":"-1792","trkh":"0","ttrk":"0","trak":"351","sqk":"1160","call":"SWA1808","gnd":"0","trt":"5","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"SWA","cou":"United States","mil":"0","interested":"0","from":"KSFO San Francisco United States","to":"KDEN Denver United States","dst":"4.47"}],"total":14,"ctime":1593196835855,"ptime":46}

rouyng commented 4 years ago

FWIW if there's a possibility this is a key issue, the ADSBx team is very responsive on their discord, I'm sure they could check to see if there is anything strange happening.

countryboy057 commented 4 years ago

Ok So I got it working. Instead of using your self.headers section for the API I just defined headers and hard coded my key in there.

headers = { 'api-auth': "my key goes here " }

def check_spots(self): logging.info(f'Checking for aircraft via ADSBx API (endpoint: {self.adsb_api_endpoint})') try: response = requests.request("GET", self.url, headers=headers, timeout=4)

rouyng commented 4 years ago

I'm glad you found a workaround! However I would still like to find the root cause of this issue. I just merged a pull request that allows you to set the verbosity of debug messages from asb.config. When you get a chance, can you please set this option to "debug" and run the bot again without your workaround?

You should see a message like this: 28-Jun-20 10:51:58 - DEBUG: Setting API key value to <your-key-value>

Let me know the full results please, without key values. I still cant reproduce it , but it seems like the issue may be with reading the key from the configuration file.

countryboy057 commented 4 years ago

So I did a git pull and merge and it is working fine without my workaround. Was there a whitespace or something somewhere ?? I did a few reinstalls previous before my work around and it still wasnt working. Now all is well!