Skip to content
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

Closed
HFMan opened this issue Apr 11, 2022 · 6 comments
Closed

Turbo-flask not able to push() on Raspberry Pi #29

HFMan opened this issue Apr 11, 2022 · 6 comments
Labels
question Further information is requested

Comments

@HFMan
Copy link

HFMan commented Apr 11, 2022

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?

@miguelgrinberg
Copy link
Owner

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?

@miguelgrinberg miguelgrinberg added the question Further information is requested label Apr 11, 2022
@HFMan
Copy link
Author

HFMan commented Apr 12, 2022 via email

@HFMan
Copy link
Author

HFMan commented Apr 12, 2022

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
client browser, but it does not dynamically update.

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?

@miguelgrinberg
Copy link
Owner

that the RPi does not make a WebSocket connection to my Chrome browser

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.

@HFMan
Copy link
Author

HFMan commented Apr 12, 2022

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!

@HFMan HFMan closed this as completed Apr 12, 2022
@HFMan
Copy link
Author

HFMan commented Apr 12, 2022

User issue, not an issue with Turbo-flask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants