Websockets questions

23 Feb 2012

I'm trying websockets to connect my mbed to a browserpage. There is progress, communiations both ways. Still some questions:

1) When I look at the status of my channel at sockets.mbed I see 57 connections and the number seems to bee growing. Is this normal? Do I have to close the channel after every ws.send() ??

2) At the mbed I open my sockets channel for rw. This means that my mbed als receives its own messages. Can I avoid this? or do I have to live with it?

Thank you.

24 Feb 2012

Hi Ton,

  • In fact the number of connections is growing when an mbed is reseted and when a tcp connection was opened. Maybe I should have on the server a mean to detect that an mbed has been reseted.
  • Yes you can avoid the reception of messages on your mbed by changing the connection mode: "wo" (write only) instead of "rw" (read write): the mbed will only send messages.

Sam

24 Feb 2012

Thank you for your answer Samuel.

yes, I have reset my mbed many times when I configured my program. I was worried about this growing number of connections because I thought there might be a limit to it somewhere. It works well now and I do need a RW connection. So I put a code in my messages to enable the mbed to recognize its own messages. Simple enough but I thought I had missed a setting somewhere.

I'm really excited about these Websockets, although I don't understand a lot of it. But it works like I don't know what!

I will try to publish my project in the mbed community when it is finished.

Ton

24 Feb 2012

Is there some way to get Android to work with web sockets ?

Cheers

Ceri

24 Feb 2012

Hi Ceri,

Apparently if you install firefox for android, that should work. Haven't tried it myself, though.

25 Feb 2012

Hi Ceri,

You can try to follow these instructions for Opera.

Sam

26 Feb 2012

thanks for the opera info, I got it to work on my phone, but cannot get it to work on my tablet :(

I can get a truly massive list of settings, on my tablet, but nothing about web socket. think it might be because my tablet is not Google certified.

because, when I try to download the .apk, it gets sent to my phone !

would love a solution still.

BTW FireFox didn't work, and Chrome will not install.

cheers Ceri.