RPi 3G/4G Wireless Connection Backup Switcher

From EnigmaGuy Wiki
Revision as of 12:59, 24 January 2019 by Enigmaguy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You can get this application in Python including source code for free at Github/.../WirelessSwitch

Preface

While I was developing surveillance camera I was facing a few challenges:

  1. There might be power outage
  2. Monthly cost should be kept to minimum (using 3G/4G pre-paid card as backup with primary cable network connection)

I was looking for a simple way how to switch between cable and 3G/4G connection in case of power failure (cable network modem is powered up by home electricity). I was hoping to find some simple Linux tool which will switch connection automatically but unfortunately I was unable to find any one. So I programmed one myself in Python. It was difficult to test it completely for all scenarios but currently most functionality should be stable and with correct 3G/4G settings it should reconnect you automatically in case of power outage longer than 5 minutes to backup connection and send notification e-mail.

To function properly you should have these set-up correctly:

  1. Battery backed-up Raspberry Pi - 5V UPS for Raspberry Pi
  2. 3G/4G connection - RPi 3G Mobile connection with Huawei E173
  3. E-mail account - e.g. GMail

Diagram