Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years ago.
Connecting mbed to tornado websocket?
I am trying to connect a k64f mbed board to a websocket so basic commands can be sent from and to the k64f from the websocket, just single characters that will be dealt with in the mbed software.
I currently have a very basic chat websocket using tornado python, now when i run the server I can view it on any PC connected to my LAN and send messages to the server. I am struggling however to connect my Mbed k64f.
I am using the websocketclient library alongside the ethernetinterface library, and have it running with the sockets.mbed.org websocket. when I change the ws definiion line to Websocket ws("ws:192.168.1.247:8888");, the while(!ws.connect()); function always returns -1 so never exits the while loop. My server reports that the mbed has been connected, and every time my mbed software reattempts ws.connect() the python server side index handler def get(self): code runs.
Can anybody help get the k64f connected properly?
5 years ago.
Hi. The websocket libraries I have used on MBED for the K64F require an ending slash. So, be careful to create your websocket like so:
Websocket ws("ws://192.168.1.247:8888/"); // note that the ending slash is required