I'm using a fairly basic home networking setup, and would like to know when it becomes unreachable due to electricity blackout or internet being offline. My idea was to use my raspberry pi to send out/or receive signals regularly, and when it doesn't, receive a notification/alert on my android phone.

Also, I would like to do this without opening ports and/or exposing my (dynamic) ip address if possible, and free if possible (but I'm okay with paying for a basic service too, as long as it's not too expensive).

How would one go do such thing?

EDIT: I'm not asking really for a step by step solution, just point me in the right direction on how to properly do this with suggestions of software/services, I'll try to find my way through there. Thanks in advance!

  • Receiving messages constantly that your network is online will get annoying very quickly. I would suggest registering with a dyn-dns service and check/ping your domain from outside your network and only send notifications that actually matter.
    – BulletBob
    Feb 17, 2021 at 21:15
  • Sure, but for example, using an intermediate solution to expect notifications form the pi and then when not getting them raising an alert or something? Could that work?
    – Leftorro
    Feb 17, 2021 at 21:39
  • I doubt that using an RPi will be your best option. There are "smart home" solutions that do this sort of thing. If you want DIY, I'd use my laptop for this... for example I could monitor the logs in my macOS to send a text message if power were disconnected (battery charger no longer charging). A laptop has the advantages of battery backup and more connectivity options. Those are certainly "do-able" on an RPi, but you'll spend time and money getting them working.
    – Seamus
    Feb 17, 2021 at 23:33

2 Answers 2


Get some free web hosting somewhere have the Pi upload a file it creates with the date in time in it. Run a cron job at the interval desired use a program like rsync to upload the file. Check in your browser and the web page can use the file for its data. Displaying a message it is up at this date and time. A cron job run on that machine checking if the file has been updated or not in the last set amount of time, if it has not it emails you to let you know file has not been update in the last number of hours.


To do this without constantly polling your network would require monitoring your power and then having your Pi send a message to your phone. Twilio offers an affordable service that allows you to send sms text messages programmatically and their API is easy to use. To monitor your power would require that you operate Pi off of a battery, and then have a monitoring circuit that can send a digital signal when power is lost. This can be achieved in a number of ways. The easiest, but most expensive is to buy a UPS that has a relay contact you can monitor. I'll let you investigate that on your own. The other option is to run the Pi on a battery (alkaline, LiPo, or other) and create a separate comparator circuit that changes state when it detects a voltage change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.