dmitryelj / RPi-P2000Receiver

P2000 paging autonomous receiver with LCD and browser access
15 stars 7 forks source link

Posting to server. #21

Open djoey123 opened 3 years ago

djoey123 commented 3 years ago

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 commented 3 years ago

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