New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turbo-flask not able to push() on Raspberry Pi #29
Comments
Are both tests establishing a websocket connection? That is probably what the difference is. If the test based on the RPi does not make a WebSocket connection, why is that? The client should have attempted a connection. Did it? If it did, why did it fail? |
Miguel,
I don't know exactly how to determine if a websocket connection has been
made. No errors or any indication that a websocket connection failed was
found in the server console output or anywhere else. Any suggestions on
how to make this determination?
…On Mon, Apr 11, 2022 at 4:59 PM Miguel Grinberg ***@***.***> wrote:
Are both tests establishing a websocket connection? That is probably what
the difference is. If the test based on the RPi does not make a WebSocket
connection, why is that? The client should have attempted a connection. Did
it? If it did, why did it fail?
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNYRCQURGLLLLFLV2OMGVTVESVGXANCNFSM5TESM2LQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Okay- a bit more information. Using Chrome developer tools-> Network Tab, I have verified that the RPi does not make a WebSocket connection to my Chrome browser (but no errors indicated on the server side). I do see my HTML page in the OTOH, running the same exact code on Windows Python, the same Chrome browser with developer tools enabled shows a WebSocket connection and it all works as expected. Thoughts? |
It's the reverse. The client makes the connection, not the server. Did the client attempt to connect? If it did, then you should see it in the network tab, maybe with an error response. You may also want to look in the console section to see if there are any errors or interesting messages. |
Okay, now I understand. After you suggestion, via Chrome tools I determined that the rPi server was not serving up the script<> tag that defines the websocket that the client should be connecting to. So, that told me the Turbo object was not instantiating correctly. Alas- I discovered a small typo in my code where I instantiate the Turbo object, I had written {{ turbo }} as opposed to {{ turbo() }}. Small detail that was easy to miss, yet catastrophic. After fixing this, all is working properly. Thanks for your swift replies to this issue! |
User issue, not an issue with Turbo-flask |
I can't get Push() to work when running the example demo on a Raspberry Pi (Debian Linux, stretch release). Python 3.8.13, Flask 2.0.3, Werkzeug 2.1.1.
turbo.can_push returns false when client is using Chrome or Edge. The same exact code running on Windows with same versions of Python, Flask, and Turbo-Flask works as expected (and identical Chrome and Edge clients).
Any idea what might be causing this?
The text was updated successfully, but these errors were encountered: