echan
echan
RRailway
Created by echan on 3/26/2024 in #✋|help
Inspect volume data?
N/A
5 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Thank you so much for the spoonfeed
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
sorry if you specified that already
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
at the end
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
had to use /ws
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
GOT IT
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
running websocket server on port 6939
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Im getting this though
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Alright, still nothing
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
hahaha okay okay
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
I only need the client to send data to the server
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
I'm assuming it's failing bc I don't have 2-way channel? Although I though that's what a socket was lmao.
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Okay so it's receiving, but it fails on websocket.send from the server
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Oh! Error output finally:
connection handler failed
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/server.py", line 240, in handler
await self.ws_handler(self)
File "/app/test.py", line 8, in echo
await websocket.send(message)
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 635, in send
await self.ensure_open()
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 944, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: received 1000 (OK); then sent 1000 (OK)
connection handler failed
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/server.py", line 240, in handler
await self.ws_handler(self)
File "/app/test.py", line 8, in echo
await websocket.send(message)
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 635, in send
await self.ensure_open()
File "/usr/local/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 944, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: received 1000 (OK); then sent 1000 (OK)
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
yes
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
No errors either
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Well perhaps I'm doing something wrong, but I see no output in the deploy section
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Okay, then using
async def send_data():
uri = "wss://test-production-6637.up.railway.app/"
async with websockets.connect(uri) as websocket:
sensor_data = {
"temperature": random.uniform(20.0, 25.0),
"humidity": random.uniform(30.0, 40.0),
}
await websocket.send(json.dumps(sensor_data))

asyncio.get_event_loop().run_until_complete(send_data())
async def send_data():
uri = "wss://test-production-6637.up.railway.app/"
async with websockets.connect(uri) as websocket:
sensor_data = {
"temperature": random.uniform(20.0, 25.0),
"humidity": random.uniform(30.0, 40.0),
}
await websocket.send(json.dumps(sensor_data))

asyncio.get_event_loop().run_until_complete(send_data())
223 replies
RRailway
Created by csd4ni3l on 5/14/2023 in #✋|help
how to use and configure python websockets module and stuff
Why is that though? Just because the default is 443 for wss?
223 replies