Websocket keep on closing with the reason "Going Away"

65 views
Skip to first unread message

Akmal Hakimi

unread,
Aug 1, 2017, 6:46:06 AM8/1/17
to ws4py
Previously I have a problem where I kept getting SSL error bad write retry. I found out that the real problem was that my websocket connection keep getting closed after some time during audio streaming. I swear I didn't experience this problem before (3-4 months ago). I'm using Watson STT websocket interface and basing my code using this tutorial from IBM: https://www.ibm.com/blogs/watson/2016/07/getting-robots-listen-using-watsons-speech-text-service/

The problem seems to come from "self.send(bytearray(data), binary=True)" line. I also attached a stripped down version of my code.
ws-test.py

Sylvain Hellegouarch

unread,
Aug 1, 2017, 7:49:00 AM8/1/17
to ws...@googlegroups.com
Hello Akmal,

Thanks for sending some code, that's helpful. Now I need to find time to replay it.

In the meantime, do you recall which version you used of ws4py that worked and which you are using now? See what's changed.

Thanks,
- Sylvain

2017-08-01 12:46 GMT+02:00 Akmal Hakimi <akmalha...@gmail.com>:
Previously I have a problem where I kept getting SSL error bad write retry. I found out that the real problem was that my websocket connection keep getting closed after some time during audio streaming. I swear I didn't experience this problem before (3-4 months ago). I'm using Watson STT websocket interface and basing my code using this tutorial from IBM: https://www.ibm.com/blogs/watson/2016/07/getting-robots-listen-using-watsons-speech-text-service/

The problem seems to come from "self.send(bytearray(data), binary=True)" line. I also attached a stripped down version of my code.

--
You received this message because you are subscribed to the Google Groups "ws4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ws4py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Akmal Hakimi

unread,
Aug 1, 2017, 8:00:05 AM8/1/17
to ws...@googlegroups.com
Hey Sylvain. Thanks for the reply.

Actually I only been using 1 version so far which is 0.4.2. Just to add, the problem occur on a new Nao Robot that we got today. I had tested the same code on my ubuntu VM and it seems to work almost fine (i can still see the error but it happened very rarely while in the robot, it happened every few seconds to the point it is unusable). Do you think it could be device related? 

You received this message because you are subscribed to a topic in the Google Groups "ws4py" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ws4py/kGr2dCN4A_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ws4py+unsubscribe@googlegroups.com.

Sylvain Hellegouarch

unread,
Aug 1, 2017, 8:13:53 AM8/1/17
to ws...@googlegroups.com
Hey Akmal,

Well that's quite a trail you're setting me on :)
It's hard to say what is wrong really. On that robot, it could be Python being too old, a lack of resources, poor connection. ws4py isn't hungry in resources but the Watson support may be.
However, since you do see the issue from a proper machine (I am assuming your VM is using a network bridge rather than NAT) there is clearly something odd.

- Sylvain

Akmal Hakimi

unread,
Aug 1, 2017, 8:41:53 AM8/1/17
to ws...@googlegroups.com
The robot's python version is 2.7.3. Actually this is the 5th robot that I used and this is the first time I see such issue (previously it happened but not this bad). 

Sylvain Hellegouarch

unread,
Aug 1, 2017, 8:47:50 AM8/1/17
to ws...@googlegroups.com
I see.

Had it been Python3, I would have suggested trying the asyncio backend support, see if that would have offered a more stable experience.
In fact, would you be able to try on your VM, see if that leads to the same issue nonetheless? If you have Python 3.5 that is.

- Sylvain

Akmal Hakimi

unread,
Aug 1, 2017, 8:55:39 AM8/1/17
to ws...@googlegroups.com
Thanks for the suggestion. I will definitely try it on my future projects. Unfortunately the robot only able to support Python 2.7.3

Sylvain Hellegouarch

unread,
Aug 1, 2017, 8:57:55 AM8/1/17
to ws...@googlegroups.com
Yeap, this was merely as a benchmark, there is an issue we need to understand with your setup (and likely ws4py code). But not sure how to help you debug this simply.

Akmal Hakimi

unread,
Aug 2, 2017, 12:17:26 AM8/2/17
to ws4py
Just a little update. It started to happen in my VM as well =(. Not sure what's the problem. I also tested the code from IBM tutorial and it crash within few seconds (due to similar problem I supposed). I attached the IBM code as well.
ibm-ws.py
Reply all
Reply to author
Forward
0 new messages