Hello!
I'm making an app that revolves around Android phone and Raspberry Pi 3 communication via WiFi (by UDP packets exchange). I'm running a python script on Raspberry Pi which sends some data to the Android phone, but only when it receives a request from the phone. My question is: Is there an elegant way for my phone to know when something is wrong with the remote host (in this case, Raspberry Pi), whether it's a power outage or simply the script isn't running? Currently, when there is no response from the remote host, my app remains in status quo, which means that it shows last received data. My initial idea was to count sent requests and, separately count received packets and compare those numbers, but somehow I believe there must be a more sophisticated solution. My app is already functional, but I'm making a few final cosmetic tweaks and I just thought it would be helpful if the user would be notified if something was wrong with the remote host so they could take appropriate action in order to fix it. Thanks in advance.