Python websockets
- or -
Post a project like this2542
$100
- Posted:
- Proposals: 0
- Remote
- #1539600
- PRE-FUNDED
- Awarded
Description
Experience Level: Intermediate
General information for the business: Art project
Description of requirements/functionality: We are making a mechanical turk chatbot as an art project.
There is a sculpture of a head, with a keyboard, a 20×4 character LCD screen, and a receipt printer. I'll call this the face.
There is also a regular web client in a browser. I'll call this the brain.
Between these two is a server, currently on heroku (because it's easy).
At the face end, users type in messages, that appear on the LCD screen. They are then sent, via websockets, to the server when the user presses enter. The face and the brain both subscribe to the redis pubsub stream on the server. When the face sees a new message, it prints it. When the brain sees a new message it displays it in the browser.
I need the raspberry pi to communicate reliably with a server via websockets.
The repos are:
Raspberry pi: https://github.com/admiralstrand/turk
Server: https://github.com/notionparallax/turkServer
What I actually need:
I have a semi-working version, in that it works when connected to a local server, but not when on a remote server. I need it to work when connected to the remote server.
It is right at the edge of my understanding. You can think of it as a specification rather than an implementation. If there is a better way to do it, then I'm happy to use that.
Specific technologies required: Python, Websockets
OS requirements: Linux
Extra notes: Currently, I think it's failing during the connection upgrade negotiations. Here's the trace:
ben@um:~/projects/git/turk$ python pi/ouija.py
I think I'm running on Ben's computer
I think I'm running on Ben's computer
--- request header ---
GET /submit/submit HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: nameless-dusk-67549.herokuapp.com
Origin: http://nameless-dusk-67549.herokuapp.com
Sec-WebSocket-Key: 9JzGLmjeA+4OG7QNcNQEbQ==
Sec-WebSocket-Version: 13
--- request header ---
-----------------------
GET /submit/receive HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: nameless-dusk-67549.herokuapp.com
Origin: http://nameless-dusk-67549.herokuapp.com
Sec-WebSocket-Key: GDcXJMFlwbx0TzqAj9Da2A==
Sec-WebSocket-Version: 13
--- response header ---
-----------------------
--- response header ---
HTTP/1.1 101 Switching Protocols
HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Connection: Upgrade
Upgrade: websocket
Upgrade: websocket
Sec-Websocket-Accept: nZkqiyt4dn3Lyn42dRBTvDQIm24=
Sec-Websocket-Accept: 5fIkK0oNnmv8+vpRiXYv4zqgOw0=
Via: 1.1 vegur
-----------------------
Via: 1.1 vegur
here we go
Welcome to the turk
send: '\x88\x82L\xa8\x97\x0fO@'
I accept: 0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;?@[\]^_`{|}~
-----------------------
start typing dood!### closed ###
--------------------
ben@um:~/projects/git/turk$
Description of requirements/functionality: We are making a mechanical turk chatbot as an art project.
There is a sculpture of a head, with a keyboard, a 20×4 character LCD screen, and a receipt printer. I'll call this the face.
There is also a regular web client in a browser. I'll call this the brain.
Between these two is a server, currently on heroku (because it's easy).
At the face end, users type in messages, that appear on the LCD screen. They are then sent, via websockets, to the server when the user presses enter. The face and the brain both subscribe to the redis pubsub stream on the server. When the face sees a new message, it prints it. When the brain sees a new message it displays it in the browser.
I need the raspberry pi to communicate reliably with a server via websockets.
The repos are:
Raspberry pi: https://github.com/admiralstrand/turk
Server: https://github.com/notionparallax/turkServer
What I actually need:
I have a semi-working version, in that it works when connected to a local server, but not when on a remote server. I need it to work when connected to the remote server.
It is right at the edge of my understanding. You can think of it as a specification rather than an implementation. If there is a better way to do it, then I'm happy to use that.
Specific technologies required: Python, Websockets
OS requirements: Linux
Extra notes: Currently, I think it's failing during the connection upgrade negotiations. Here's the trace:
ben@um:~/projects/git/turk$ python pi/ouija.py
I think I'm running on Ben's computer
I think I'm running on Ben's computer
--- request header ---
GET /submit/submit HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: nameless-dusk-67549.herokuapp.com
Origin: http://nameless-dusk-67549.herokuapp.com
Sec-WebSocket-Key: 9JzGLmjeA+4OG7QNcNQEbQ==
Sec-WebSocket-Version: 13
--- request header ---
-----------------------
GET /submit/receive HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: nameless-dusk-67549.herokuapp.com
Origin: http://nameless-dusk-67549.herokuapp.com
Sec-WebSocket-Key: GDcXJMFlwbx0TzqAj9Da2A==
Sec-WebSocket-Version: 13
--- response header ---
-----------------------
--- response header ---
HTTP/1.1 101 Switching Protocols
HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Connection: Upgrade
Upgrade: websocket
Upgrade: websocket
Sec-Websocket-Accept: nZkqiyt4dn3Lyn42dRBTvDQIm24=
Sec-Websocket-Accept: 5fIkK0oNnmv8+vpRiXYv4zqgOw0=
Via: 1.1 vegur
-----------------------
Via: 1.1 vegur
here we go
Welcome to the turk
send: '\x88\x82L\xa8\x97\x0fO@'
I accept: 0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;?@[\]^_`{|}~
-----------------------
start typing dood!### closed ###
--------------------
ben@um:~/projects/git/turk$
Ben D.
100% (4)Projects Completed
4
Freelancers worked with
4
Projects awarded
100%
Last project
24 Mar 2022
Australia
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies