Getting notification if a specific Aircraft is in the air?

Discussion in 'Other technical not related to ADSBx Feeding' started by Luca Field, Jan 16, 2020.

  1. Luca Field

    Luca Field New Member

    Hey guys, greetings from Germany,

    I am currently setting up my feeder for ADS-B Exchange. Nevertheless i bought the API Key

    I want to get notifications via E-Mail or Telegram if a Aircraft with a specific Regristration is in the air.

    I hope some of you guys can help me:
    I have problems creating the wright code. The evaluation does work, but the representation does only work in the "consol.log". On the "local.host" server just appears the first file. I don“t know the reason??

    It would be perfect, wheater we would get a mail, as soon the Value "Total" is between 0-1.

    I do have a platform / PC in which the Code could run in the future. I am testing on Local - but even this does not work.

    I have attached the code, I am using (without the API key and the regristration)

    I hope someone can help me....

    Cheers,
    Luca
     

    Attached Files:

  2. James

    James Guest

    You bought API key? You mean rapid api.

    This is a bit more complex.

    API returns JSON.

    Parse it and do work ...

    Why are you not doing this in PHP? Are you trying to use nodeJS?
     
  3. Ron Guest

    Ron Guest New Member

    Not sure if this is helpful but I have a python code snippet that will return 'Found' if an airplane is currently in view of my dump1090 (via JSON). But it is based on the airplane's ICAO code (lower case). You can use this if you can look up or find that from the registration # (which isn't in the JSON) to ICAO. Or you can also switch it to use callsign aka flight. I used to have a setup to send me an SMS when certain planes were "in sight". Just need to replace "found" with your SMS action.
    #! /usr/bin/python

    import json
    import urllib2

    j = urllib2.urlopen('http://10.0.1.50/dump1090-fa/data/aircraft.json')
    j_obj = json.load(j)

    aircraft = j_obj["aircraft"]

    for item in aircraft:
    hex = item.get("hex")
    if hex == "ae080f":
    print "Found"
    Here is a typical airplane's entry in the JSON file showing fields you should use
    {"hex":"aa3bf0","flight":"SKW3213 ","alt_baro":23100,"alt_geom":24125,"gs":474.7,"track":94.8,"geom_rate":256,"squawk":"3667","emergency":"none","category":"A2","nav_qnh":1012.8,"nav_altitude_mcp":31008,"lat":32.660678,"lon":-95.794840,"nic":8,"rc":186,"seen_pos":0.5,"version":2,"nic_baro":1,"nac_p":10,"nac_v":1,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":10425,"seen":0.1,"rssi":-11.0},
     
  4. Big Tony

    Big Tony New Member

    Hello. I am new to ADSB exchange. I've recently set up a pi feeder [KPHL_ME_KACY]. Is there any sort of reference material online to research the above rapid api and JSON information. I would like to have this ability for aircraft in my area.
     
  5. James

    James Guest

  6. Big Tony

    Big Tony New Member

    I understand that but I need a project during this shutdown. My industry is at 0% work and I am trying to fill the down time.
     
  7. James

    James Guest

    Rock on then! Open the local Pi website map and look at network traffic in developer mode ...

    I'd assign a static IP to your Pi on your router and build away!
     
  8. Big Tony

    Big Tony New Member

    Thanks...my first task will be finding that resource!