Websocket is not working
-
I have been testing this for the past few weeks? I people suggested that i am using wrong feed token or client id. i am triple sure about the feed token and the client id.they are cent percent correct. Today i tested in my market hours. I found that still i m gettting wrong data
{"task":"mw","channel":"bse_cm|532921","token":"09959834","user": "R308253","acctid":"R308253"}
this is the request to the web socket
[{"ak":"nk","task":"mw","msg":"mw"}]
this is the response
any issue with this req para to the websocket -
@James-Bond please help me i am also getting same response As of written in this post.
-
@rohithmaccs how did u solved it please help me? I am getting same response
-
@James-Bond solved thanks
-
@rajanprabu said in Websocket is not working:
task='mw' #|'sfi'|'dp'
Do you find any documentation for this change ?
-
@rajanprabu because of you i checked their repo.and found that it is updated 4 days ago .. i will check whether i missed any updates thanks
-
I didnt check the header that its NodeJs.
-
Im sorry for the oversight.
-
@rajanprabu said in Websocket is not working:
Please dont roll back the SDK, otherwise this wont work.. This modification is true only smartapi-python version 1.2.2 onwards..
Hi i am a react-native dev(mobile app dev).so the node js sdk wont works for me since many of the packages are missing or in other name. so i gone through your code. and made in a form for me to work.i am following exactly same as the node js version
here you are providing example of python ver 1.2.2 for me for javascript the latest updated version is 1.0.9 -
@admin 9995527391, rohithmaccs@gmail.com
-
Please dont roll back the SDK, otherwise this wont work.. This modification is true only smartapi-python version 1.2.2 onwards..
-
If you have updated to the recent SDK.. You need to modify the script to have task included..
sample script below.. pay attention to
task='mw'
andws.send_request(token,task)
## WebSocket from smartapi import WebSocket FEED_TOKEN= "your feed token" CLIENT_CODE="your client Id" token="nse_cm|2885&nse_cm|1594&nse_cm|11536" task='mw' #|'sfi'|'dp' ss = WebSocket(FEED_TOKEN, CLIENT_CODE) def on_tick(ws, tick): print("Ticks: {}".format(tick)) def on_connect(ws, response): ws.send_request(token,task) def on_close(ws, code, reason): ws.stop() # Assign the callbacks. ss.on_ticks = on_tick ss.on_connect = on_connect ss.on_close = on_close ss.connect( )
-
hi @rohithmaccs Share your contact details to solve your issues.
-
Can you share your code ?