It looks like you're new here. If you want to get involved, click one of these buttons!
kws = KiteTicker(api_key, access_token)
def on_ticks(ws, ticks):
logging.debug("Ticks: {}".format(ticks))
def on_connect(ws, response):
ws.subscribe(instrumentToken)
ws.set_mode(ws.MODE_FULL, instrumentToken)
kws.on_ticks = on_ticks
kws.on_connect = on_connect
# kws.on_close = on_close
kws.connect(threaded=True)
while True:
def on_ticks(ws, ticks):
tickOperations(ticks)
def tickOperations(ticks):
for tick in ticks:
print(tick)
return 'finished'
#Assign callback
kws.on_ticks=on_ticks
The error message is as follows:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): sheets.googleapis.com:443
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A1%3AO1?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7032%3AO7032?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7033%3AO7033?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7034%3AO7034?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7035%3AO7035?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7036%3AO7036?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7037%3AO7037?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7038%3AO7038?valueInputOption=RAW HTTP/1.1" 200 None
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7039%3AO7039?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7040%3AO7040?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7041%3AO7041?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7042%3AO7042?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7043%3AO7043?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7044%3AO7044?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7045%3AO7045?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7046%3AO7046?valueInputOption=RAW HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "GET /v4/spreadsheets/SPREADSHEET?includeGridData=false HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://sheets.googleapis.com:443 "PUT /v4/spreadsheets/SPREADSHEET/values/%27cof%27%21A7047%3AO7047?valueInputOption=RAW HTTP/1.1" 200 None
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)
We checked the above Websocket code at our end, it's working fine with no connection closure. As seen from the above log, PUT operation seems to cause the closure. Can you re-check on Sheet APIs PUT operation part?
You can implement queue and check.