0

I am trying to code a WebSocket server in python that is capable of handling several clients simultaneously.

My objective is to run a python script that will receive Serial Port Data from an Arduino (via USB to serial port), and will serve a WebSocket to send/receive data from multiple clients (web browser, android app...).

I have found very complicated examples and libraries but nothing to start working with multi-client. The closest is this, but can only work with 1 client: https://gist.github.com/jkp/3136208

Any suggestion on how to implement my project? I have read of socket.io, and others, but I really would like to do all in python, unless proven to be a very bad decision.

Serge
  • 312
  • 5
  • 20
  • How is [Autobahn/Twisted](http://autobahn.ws/python/websocket/examples.html) not multi-client? I'm a Ruby person, but just browsing through this site (StackOverflow) it's easy to see that some multi-client websocket servers are written in Python, often leveraging Autobahn/Twisted. – Myst Dec 05 '15 at 18:44
  • ok, thanks I am going to give it a try. any idea why I am getting this error? **six** module seems to be installed but then when running the example server.py it says it is not. http://imgur.com/gwGQtNX – Serge Dec 05 '15 at 20:28
  • Are you sure it's installed (updated version and all? there was [a question about it here](http://stackoverflow.com/questions/21222458/python-error-importerror-no-module-named-six), maybe it would help. – Myst Dec 05 '15 at 22:58
  • Thanks. I just managed 5min ago. I had to go to the website download it, copy it to the raspberry and the run the setup.py. got the server running. Next test is to try and see if I can integrate it into my current script which is also doing mysql and serial port .thanks – Serge Dec 05 '15 at 23:01

0 Answers0