Bokeh server plot won't plot json data but plots user data

Hi, I am trying to display aircraft locations on a bokeh server by using an antenna, SDR dongle, and running dump1090. This script has worked for over a year now and all of a sudden stopped working this past week. It will sometimes plot the ADSB data but the last two days it will only plot the user input points and not the aircraft points. I’m thinking it has something to do with the json data but when I go to the url http://localhost:8080/data.json the data is there. Any help would be appreciated.

import pandas as pd
import urllib.request
import json
import ssl
from bokeh.plotting import figure, show, ColumnDataSource, curdoc
from bokeh.tile_providers import get_provider, OSM, CARTODBPOSITRON, Vendors
import numpy as np
from bokeh.models import HoverTool, LinearColorMapper, LabelSet, TapTool
from bokeh.palettes import RdYlBu as palette
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
import time
from datetime import datetime
import os
import sys
import subprocess
from bokeh.models import Arrow, VeeHead
import math
from math import cos, sin, atan, sqrt, acos
import pickle
from classes import Calculations as calc
import great_circle_calculator.great_circle_calculator as gcc
import atexit
from threading import Thread


global intTime

datapath = input()
data = datapath.split(':')
pklDataFilePath = str(data[0].strip())
cirFile = str(data[1].strip())
wayptFile = str(data[2].strip())

raceTrkFile = str(data[3].strip())

#HEADER INFO
url = 'http://localhost:8080/data.json'

flightDict = {}
flightDict['FlightSeries'] = {}
flightDictStatic = {}
flightDictStatic['WayPtSeries'] = {}
flightDictStatic['WayPtSeries']['NumSeries'] = 0
flightDictStatic['WayPtSeries']['Series'] = {}
flightDictStatic['CircleSeries'] = {}
flightDictStatic['CircleSeries']['NumSeries'] = 0
flightDictStatic['CircleSeries']['Series'] = {}
flightDictStatic['RacetrackSeries'] = {}
flightDictStatic['RacetrackSeries']['NumSeries'] = 0
flightDictStatic['RacetrackSeries']['Series'] = {}



intTime = 0
headers = {'User-agent': 'your bot 0.1', 'Cache-Control':'no-cache','Pragma':'no-cache','If-Modified-Since':'Sat, 1 Jan 2000 00:00:00 GMT',}


strDateTime = datetime.now().strftime("%m-%d-%y_%I,%M%p")


def wgs84_to_web_mercatorwaypoint(lat, lon):
    k = 6378137
    x = float(lon)*(k*np.pi/180)
    y = np.log(np.tan((90+float(lat))*np.pi/360))*k

    return x,y

def wgs84_to_web_mercator(df, lon='lon', lat='lat'):
    k = 6378137
    df["x"] = df[lon]*(k*np.pi/180)
    df["y"] = np.log(np.tan((90+df[lat])*np.pi/360))*k

    return df

def convertHdgtoRad(df, hdg='track', lon='lon',lat='lat'):
    df["radhdg"] = (df[hdg])*(np.pi/180)
    return df

def OffsetLatLon(df, radhdg='radhdg', lat='lat',lon='lon'):
    R = 6378.1 #radius of the earth
    d = 5 #distance in km
    df['offLat']= np.degrees(np.arcsin(np.sin(np.radians(df[lat])*np.cos(d/R) + np.cos(np.radians(df[lat]))*np.sin(d/R)*np.cos(df[radhdg]))))

    df['offLon'] = np.degrees(np.radians(df[lon]) + np.arctan2(np.sin(df[radhdg])*np.sin(d/R)*np.cos(np.radians(df[lat])),np.cos(d/R)-np.sin(np.radians(df[lat]))*np.sin(np.arcsin(np.sin(np.radians(df[lat])*np.cos(d/R) + np.cos(np.radians(df[lat]))*np.sin(d/R)*np.cos(df[radhdg]))))))

    return df
def OffsetXY(df, offLat = 'offLat',offLon='offLon'):
    k = 6378137
    df["offx"] = df[offLon]*(k*np.pi/180)
    df["offy"] = np.log(np.tan((90+df[offLat])*np.pi/360))*k

    return df
def get_race_track(p,lftTopLat, lftTopLon,lftBotLat,lftBotLon, RtTopLat, RtTopLon, RtBotLat, RtBotLon, flightDictStatic):
    lftTopLat = float(lftTopLat)
    lftTopLon = float(lftTopLon)
    lftBotLat = float(lftBotLat)
    lftBotLon = float(lftBotLon)
    RtTopLat = float(RtTopLat)
    RtTopLon = float(RtTopLon)
    RtBotLat = float(RtBotLat)
    RtBotLon = float(RtBotLon)

    p1, p2 = (lftTopLon, lftTopLat), (lftBotLon, lftBotLat)

    #get the midpoint and distance
    startLon, startLat = gcc.midpoint(p1,p2)

    dist = gcc.distance_between_points(p1,(startLon,startLat))

    xR = []
    yR = []

    xloc, yloc = wgs84_to_web_mercatorwaypoint(lftBotLat,lftBotLon)

    xR.append(xloc)
    yR.append(yloc)

    LatCircle = []
    LonCircle = []

    LatCircle.append(float(lftBotLat))
    LonCircle.append(float(lftBotLat))

    for alpha in range(180,360):
        #get circle points for Lat/Long charts
        LLData = []
        LLData = calc.GetLatLong(float(startLat), float(startLon), float(alpha), int(dist))

        xloc, yloc = wgs84_to_web_mercatorwaypoint(float(LLData[0]),float(LLData[1]))

        xR.append(xloc)
        yR.append(yloc)


    xloc, yloc = wgs84_to_web_mercatorwaypoint(float(lftTopLat),float(lftTopLon))

    xR.append(xloc)
    yR.append(yloc)

    xloc, yloc = wgs84_to_web_mercatorwaypoint(float(RtTopLat),float(RtTopLon))

    xR.append(xloc)
    yR.append(yloc)

    #get the midpoint and distance
    p1, p2 = (RtTopLon, RtTopLat), (RtBotLon, RtBotLat)

    #get the midpoint and distance
    startLon, startLat = gcc.midpoint(p1,p2)

    dist = gcc.distance_between_points(p1,(startLon,startLat))


    for alpha in range(0,180):
        #get circle points for Lat/Long charts
        LLData = []
        LLData = calc.GetLatLong(float(startLat), float(startLon), float(alpha), int(dist))
        xloc, yloc = wgs84_to_web_mercatorwaypoint(float(LLData[0]),float(LLData[1]))

        xR.append(xloc)
        yR.append(yloc)


    xloc, yloc = wgs84_to_web_mercatorwaypoint(float(RtBotLat),float(RtBotLon))

    xR.append(xloc)
    yR.append(yloc)

    xloc, yloc = wgs84_to_web_mercatorwaypoint(float(lftBotLat),float(lftBotLon))

    xR.append(xloc)
    yR.append(yloc)

    p.line(xR,yR, line_width=4, line_color='red', level='underlay')

    flightDictStatic['RacetrackSeries']['NumSeries']+=1
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])] = {}
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])]['x'] = []
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])]['x'] = xR
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])]['y'] = []
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])]['y'] = yR
    flightDictStatic['RacetrackSeries']['Series'][str(flightDictStatic['RacetrackSeries']['NumSeries'])]['color'] = 'red'

    return p,flightDictStatic
def AddCircles(p, cirFile, flightDictStatic):
    cir = open(cirFile)
    next(cir)
    circles = []
    for line in cir:
        line.strip('\n')
        if line != "":
            data = []
            data = line.split('\t')
            circles.append(data)
    cir.close()

    for circle in range(len(circles)):
        latcir = circles[circle][0]
        loncir = circles[circle][1]
        radcir = circles[circle][2]

        latcir_f = float(latcir)

        loncir_f = float(loncir)

        radcir_f = float(radcir)*1000

        dot_size = 10

        xCircle = []
        yCircle = []
        for alpha in range(0,360):
            #get circle points for Lat/Long charts
            LLData = []
            LLData = calc.GetLatLong(latcir_f, loncir_f, float(alpha), radcir_f)
            xloc, yloc = wgs84_to_web_mercatorwaypoint(float(LLData[0]),float(LLData[1]))
            xCircle.append(float(xloc))
            yCircle.append(float(yloc))


        p.line(xCircle,yCircle, line_width=4, line_color='green', level='underlay')
        flightDictStatic['CircleSeries']['NumSeries']+=1
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])] = {}
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])]['x'] = []
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])]['x'] = xCircle
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])]['y'] = []
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])]['y'] = yCircle
        flightDictStatic['CircleSeries']['Series'][str(flightDictStatic['CircleSeries']['NumSeries'])]['color'] = 'green'


    return p, flightDictStatic

def RaceTrack(p, raceTrkFile, flightDictStatic):
    race = open(raceTrkFile)

    next(race)
    racetrack = []

    for line in race:
        line.strip('\n')
        if line != "":
            data = []
            data = line.split('\t')

            racetrack.append(data)

    race.close()

    for rt in range(len(racetrack)):
        TL_lat = racetrack[rt][0].strip()
        TL_lon = racetrack[rt][1].strip()
        BL_lat = racetrack[rt][2].strip()
        BL_lon = racetrack[rt][3].strip()
        RT_lat = racetrack[rt][4].strip()
        RT_lon = racetrack[rt][5].strip()
        BR_lat = racetrack[rt][6].strip()
        BR_lon = racetrack[rt][7].strip()

        get_race_track(p,TL_lat, TL_lon,BL_lat,BL_lon,RT_lat,RT_lon,BR_lat,BR_lon, flightDictStatic)

    return p, flightDictStatic

def AddWayPt(p, wayptFile, flightDictStatic):
    wp = open(wayptFile)

    next(wp)
    waypoints = []

    for line in wp:
        line.strip('\n')
        if line != "":
            data = []
            data = line.lower().split('\t')
            latVal = data[0].strip()
            lonVal = data[1].strip()
            typeVal = data[2].strip()
            typeVal = data[2].strip('/n')
            waypoints.append(data)

    wp.close()

    for wpt in range(len(waypoints)):
        latwp = waypoints[wpt][0]
        lonwp = waypoints[wpt][1]
        type_wp = waypoints[wpt][2]
        type_wp = type_wp.strip()
        type_wp = type_wp.upper()

        latwp_f = float(latwp)

        lonwp_f = float(lonwp)

        wp_size = 20

        xloc, yloc = wgs84_to_web_mercatorwaypoint(latwp_f,lonwp_f)

        if type_wp == 'S':
            # plot the system marked with a green star
            p.star([xloc],[yloc],color="#99D594", size = wp_size, fill_alpha =.8, line_width=.5)

        elif type_wp == 'F':
            # plot the system marked with a red plus
            p.plus([xloc],[yloc],color="#DE2D26",  size = wp_size,fill_alpha =.8, line_width=.5)
        elif type_wp == 'L':
            # plot the system marked with a blue triangle
            p.triangle([xloc],[yloc],color="#386CB0",  size = wp_size,fill_alpha =.8, line_width=.5)


        flightDictStatic['WayPtSeries']['NumSeries']+=1
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])] = {}
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['x'] = []
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['x'] = xloc
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['y'] = []
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['y'] = yloc
        if type_wp == 'S':
            flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['color'] = '#99D594'
        elif type_wp == 'F':
            flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['color'] = '#DE2D26'
        elif type_wp == 'L':
            flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['color'] = '#386CB0'
        flightDictStatic['WayPtSeries']['Series'][str(flightDictStatic['WayPtSeries']['NumSeries'])]['type'] = type_wp
    return p, flightDictStatic



#flight tracking function
def flight_track(doc):
    #initiate bokeh column data source
    flight_source = ColumnDataSource({'hex':[],'squawk':[],'flight':[],'lat':[],'lon':[],'validposition':[],'altitude':[],'vert_rate':[],'track':[],'validtrack':[],'speed':[],'messages':[],'seen':[],'x':[],'y':[],'radhdg':[],'offLat':[],'offLon':[],'offx':[],'offy':[]})
    current_source = ColumnDataSource({'hex':[],'squawk':[],'flight':[],'lat':[],'lon':[],'validposition':[],'altitude':[],'vert_rate':[],'track':[],'validtrack':[],'speed':[],'messages':[],'seen':[],'x':[],'y':[],'radhdg':[],'offLat':[],'offLon':[],'offx':[],'offy':[]})
    arrow_source = ColumnDataSource({'hex':[],'squawk':[],'flight':[],'lat':[],'lon':[],'validposition':[],'altitude':[],'vert_rate':[],'track':[],'validtrack':[],'speed':[],'messages':[],'seen':[],'x':[],'y':[],'radhdg':[],'offLat':[],'offLon':[],'offx':[],'offy':[]})

    #update flight data
    def update():
        global intTime
        flightDict = {}
        flightDict['FlightSeries'] = {}

        intTime = intTime + 1
        #send request to get data from ADSB and load as JSON
        request=urllib.request.Request(url, None, headers)
        response = urllib.request.urlopen(request)

        data = response.read().decode('utf8')
        jsonPlane = json.loads(data)

        #convert to pandas dataframe
        flight_df = pd.DataFrame(jsonPlane)

        wgs84_to_web_mercator(flight_df)
        convertHdgtoRad(flight_df)
        OffsetLatLon(flight_df)
        OffsetXY(flight_df)
        flight_df = flight_df.fillna('No Data')

        n_rollArrow = len(flight_df.index)
        n_rollCurrent = len(flight_df.index)
        n_rollFlight = 2500
        flight_source.stream(flight_df.to_dict(orient='list'),n_rollFlight)
        current_source.stream(flight_df.to_dict(orient='list'),n_rollCurrent)
        arrow_source.stream(flight_df.to_dict(orient='list'),n_rollArrow)
        currentUTC = datetime.now().strftime("%m-%d-%y_%I:%M:%S.%f%p")

        asX = []
        asY = []
        asHex = []
        asSquawk = []
        asFlight = []
        asLat = []
        asLon = []
        asValidPos = []
        asAlt = []
        asVertRate = []
        asTrack =[]
        asValidTrack = []
        asSpeed = []
        asMessages = []
        asSeen = []
        asRadHdg = []
        asOffLat = []
        asOffLon = []
        asOffx = []
        asOffy = []

        asX = arrow_source.data['x']
        asY = arrow_source.data['y']
        asHex = arrow_source.data['hex']
        asSquawk = arrow_source.data['squawk']
        asFlight = arrow_source.data['flight']
        asLat = arrow_source.data['lat']
        asLon = arrow_source.data['lon']
        asValidPos = arrow_source.data['validposition']
        asAlt = arrow_source.data['altitude']
        asVertRate = arrow_source.data['vert_rate']
        asTrack =arrow_source.data['track']
        asValidTrack = arrow_source.data['validtrack']
        asSpeed = arrow_source.data['speed']
        asMessages = arrow_source.data['messages']
        asSeen = arrow_source.data['seen']
        asRadHdg = arrow_source.data['radhdg']
        asOffLat = arrow_source.data['offLat']
        asOffLon = arrow_source.data['offLon']
        asOffx = arrow_source.data['offx']
        asOffy = arrow_source.data['offy']


        fsX = []
        fsY = []
        fsHex = []
        fsSquawk = []
        fsFlight = []
        fsLat = []
        fsLon = []
        fsValidPos = []
        fsAlt = []
        fsVertRate = []
        fsTrack =[]
        fsValidTrack = []
        fsSpeed = []
        fsMessages = []
        fsSeen = []
        fsRadHdg = []
        fsOffLat = []
        fsOffLon = []
        fsOffx = []
        fsOffy = []

        fsX = flight_source.data['x']
        fsY = flight_source.data['y']
        fsHex = flight_source.data['hex']
        fsSquawk = flight_source.data['squawk']
        fsFlight = flight_source.data['flight']
        fsLat = flight_source.data['lat']
        fsLon = flight_source.data['lon']
        fsValidPos = flight_source.data['validposition']
        fsAlt = flight_source.data['altitude']
        fsVertRate = flight_source.data['vert_rate']
        fsTrack =flight_source.data['track']
        fsValidTrack = flight_source.data['validtrack']
        fsSpeed = flight_source.data['speed']
        fsMessages = flight_source.data['messages']
        fsSeen = flight_source.data['seen']
        fsRadHdg = flight_source.data['radhdg']
        fsOffLat = flight_source.data['offLat']
        fsOffLon = flight_source.data['offLon']
        fsOffx = flight_source.data['offx']
        fsOffy = flight_source.data['offy']

        csX = []
        csY = []
        csHex = []
        csSquawk = []
        csFlight = []
        csLat = []
        csLon = []
        csValidPos = []
        csAlt = []
        csVertRate = []
        csTrack =[]
        csValidTrack = []
        csSpeed = []
        csMessages = []
        csSeen = []
        csRadHdg = []
        csOffLat = []
        csOffLon = []
        csOffx = []
        csOffy = []

        csX = current_source.data['x']
        csY = current_source.data['y']
        csHex = current_source.data['hex']
        csSquawk = current_source.data['squawk']
        csFlight = current_source.data['flight']
        csLat = current_source.data['lat']
        csLon = current_source.data['lon']
        csValidPos = current_source.data['validposition']
        csAlt = current_source.data['altitude']
        csVertRate = current_source.data['vert_rate']
        csTrack =current_source.data['track']
        csValidTrack = current_source.data['validtrack']
        csSpeed = current_source.data['speed']
        csMessages = current_source.data['messages']
        csSeen = current_source.data['seen']
        csRadHdg = current_source.data['radhdg']
        csOffLat = current_source.data['offLat']
        csOffLon = current_source.data['offLon']
        csOffx = current_source.data['offx']
        csOffy = current_source.data['offy']

        flightDict['FlightSeries'][str(currentUTC)] = {}
        flightDict['FlightSeries'][str(currentUTC)]['NumSeries']=1
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'] = {}
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries']['color'] = 'red'
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])] = {}
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['x'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['x'] = csX
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['y'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['y'] = csY
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['hex'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['hex'] = csHex
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['squawk'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['squawk'] = csSquawk
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['flight'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['flight'] = csFlight
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['lat'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['lat'] = csLat
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['lon'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['lon'] = csLon
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['validposition'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['validposition'] = csValidPos
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['altitude'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['altitude'] = csAlt
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['vertRate'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['vertRate'] = csVertRate
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['track'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['track'] = csTrack
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['validtrack'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['validtrack'] = csValidTrack
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['speed'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['speed'] = csSpeed
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['messages'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['messages'] = csMessages
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['seen'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['seen'] = csSeen
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['radhdg'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['radhdg'] = csRadHdg
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offlat'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offlat'] = csOffLat
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offlon'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offlon'] = csOffLon
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offx'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offx'] = csOffx
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offy'] = []
        flightDict['FlightSeries'][str(currentUTC)]['CurrentSeries'][str(flightDict['FlightSeries'][str(currentUTC)]['NumSeries'])]['offy'] = csOffy




    #callback update in an interval
    doc.add_periodic_callback(update,500)
    #plot the aircraft data
    #bounding box for map in web mercator units
    x_range,y_range = ([-15187814,-6458032],[2505715,6567666])
    p=figure(x_range=x_range,y_range=y_range,x_axis_type='mercator',y_axis_type='mercator',sizing_mode='scale_width', plot_height=300, tools="pan,wheel_zoom,box_zoom,reset,zoom_in,zoom_out")

    p.add_tile(get_provider(Vendors.OSM))

    if cirFile != 'NONE':
        AddCircles(p, cirFile, flightDictStatic)

    if wayptFile != 'NONE':
        AddWayPt(p,wayptFile, flightDictStatic)

    if raceTrkFile != 'NONE':
        RaceTrack(p,raceTrkFile, flightDictStatic)


    pickle.dump(flightDictStatic,open(pklDataFilePath,'ab'))

    arrow = Arrow(end=VeeHead(size=10,fill_color = 'blue', line_width=1), line_width=1,line_color='blue', x_start='x', y_start='y',x_end='offx', y_end='offy', source=arrow_source)

    p.add_layout(arrow)
    arrow.level = 'underlay'


    reddot = p.circle('x','y', source= current_source,fill_color='red',size=10,fill_alpha=.8,line_width=.5, name='redcirclehover')

    bluedot = p.circle('x','y', source= flight_source,fill_color='blue',size=10,fill_alpha=.8,line_width=.5, name='bluecirclehover')
    bluedot.level = 'underlay'

    p.axis.visible = False

    #set hover
    # SET COLOR PALETTE
    #color_mapper = LinearColorMapper(palette=palette)

    my_hover = HoverTool(renderers=[reddot])
    #my_tap = TapTool()
    #set color palette
    #color_mapper = LinearColorMapper(palette=palette)
    my_hover.tooltips=[('hex','@hex'),('altitude','@altitude'),('lat', '@lat'), ('lon','@lon'),('speed','@speed'),('heading','@track')]
    #my_tap.tooltips=[('hex','@hex'),('altitude','@altitude'),('lat', '@lat'), ('lon','@lon'),('speed','@speed'),('heading','@track')]
    #set label
    #labels = LabelSet(x='x',y='y', text='Call', level = 'glyph',x_offset=5,y_offset=5, source=flight_source, render_mode='canvas',background_fill_color='skyblue',text_font_size='8pt')


    #ADD HOVER TOOL AND LABELS
    p.add_tools(my_hover)
    #p.add_tools(my_tap)
    #show(p)
    #doc = curdoc()
    doc.add_root(p)
    doc.title = "REAL TIME FLIGHT TRACKING"
    doc.on_session_destroyed(cleanup_session)

def cleanup_session(session_context):
    pass


#Server Code
apps = {'/': Application(FunctionHandler(flight_track))}
server = Server(apps, port=4002)

server.start()


if __name__=='__main__':

    server.io_loop.add_callback(server.show,"/")
    server.io_loop.start()

“stopped working” is very vague and not much to go on. Are there errors in the app console log? In the browser’s javascript log? Does “stop working” mean nothing shows up on the page at all? Something shows up, but not correctly? Have any software versions changed recently? Regardless, what are all the relevant software versions?

Hi, the bokeh version on the computer is 2.3.3. When I say “stopped working” I mean that it isn’t plotting the aircraft plots in realtime. It will plot the user input files (waypoint, circle, racetrack plots).

Here is a description of what is and has been happening…

  • there are no errors in the app console log

  • no software versions have changed recently

  • the map of the united states pops up on http://localhost:4002/ and if the user chooses to add waypoints, racetracks, or circle plots (through user input file) those show up but none of the aircraft points show up

  • it doesn’t look like the doc.add_periodic_callback(update,500) is working because when I check the pickle file that I dump data to I don’t get the flightDict key

Description of errors I am seeing…

  • last week I was running it to show a coworker who was bringing it out on a work trip and at first it didn’t work. I restarted the computer and then it started working.

  • On Sunday morning it wouldn’t work again, even after restarting the computer. I thought something may have happened to the script while I had my IDE open so I downloaded a version of the script from a cloud folder and then it started working.

  • coworker took the computer and equipment for a work test out of town and it hasn’t worked since Sunday except once.

  • I am trying to debug it without actually having the equipment to test and can only periodically test what I think could be wrong when he can call me.

So based on troubleshooting for some reason the callback isn’t working. That is where I have pinpointed it so far. When he calls back I will ask him to check the javascript log. I was just hoping there was some obvious reason of what is going on that I wasn’t seeing.

Thanks for your help!

I also asked him to send me a screenshot of the package version numbers when he gets a chance.

Assuming you aren’t otherwise capturing or redirecting stdout, this can be quickly confirmed one way or the other by putting a print in the callback an observing the process console log.

Thanks, I will have him try that.

Hi, I finally got the equipment back and after testing it I found it only works when connected to the internet, which wasn’t the case before. I did add sending UDP packets and that is what the problem is not the bokeh server. I thought I could use socket without internet but anyways that is another problem. Thanks for your help!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.