Skip to content
Discussion options

You must be logged in to vote

Ok, I think I figured it out. The while True would send Nones to the websocket even with the filter within if there was no new information.

This fixed it:

def passthrough(inputstream):
if inputstream is None:
return ""
else:
return inputstream

@app.route('/echo')
@with_websocket
async def echo(request, ws):
while True:
await ws.send(passthrough(uart.read()))

The output looks actually very nice now:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JohannesNeu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant