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

Posting to server. #21

Open
djoey123 opened this issue Nov 1, 2020 · 1 comment
Open

Posting to server. #21

djoey123 opened this issue Nov 1, 2020 · 1 comment

Comments

@djoey123
Copy link

djoey123 commented Nov 1, 2020

Maybe someone can help me.

I post the data to an server, but sometimes the raspberry pi loses its internet connection.
When that happens the post requests will stop forever, is it maybe an option to make an check, if ther is an connection active. so when the raspberry does have internet again, it can start posting again. Now i need to restart the script to start posting to te server again.

Thanks 👍

@dmitryelj
Copy link
Owner

dmitryelj commented Nov 3, 2020

You can use a try-except block to prevent posting thread from stop when the error happens.

https://stackoverflow.com/questions/16511337/correct-way-to-try-except-using-python-requests-module

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

No branches or pull requests

2 participants