Tp-Link Tapo C210 camera without internet

Posted on December 07, 2021 in Misc • 2 min read

It is quite challenging today to find a “security camera” (IP camera) which offers cloudless features, decent price and standard RTSP feeds. The only one I could come across is the Tp-Link Tapo C210 with this setup.

Tp-Link Tapo C210 camera is a cheap security camera, having 360 degrees rotation (which in my case is useful to physically ensure the camera is not filming when set to confidentiality mode) and exposing a basic API on the local network which can be used in Python script.

It can be configured in a cloud-less (without internet connection) environment with the following steps:

  • Install the “Tp-Link Tapo” app on your smartphone and create a cloud account. This is counterintuitive for this scenario, but required. We will never use an internet connection from now on.
  • Switch your smartphone to airplane mode and install the camera as usual (connect your smartphone to the camera wifi, set up the real wifi to use). The real wifi to use does not need to have access to Internet (it is fully firewalled in my case).
  • Connect to your firewalled wifi, camera should be working locally through the app.

From this point, you can use the “Tp-Link Tapo” app to control your camera on your local network. You can use a VPN interface to connect remotely.

Provided you are fluent with scripting, you can also discard completely the “Tp-Link Tapo” app from now on:

  • The camera can expose standards RTSP feeds (which VLC supports for instance). You just need to set up a local camera account by going to “Advanced settings” > “Camera Account” in the “Tp-Link Tapo” app. You can then connect to rtsp://<YOUR_TAPO_IP>/stream1 in VLC and provide these credentials.
  • The camera itself can be fully controlled outside of the app through its API. In Python, pytapo library will help you a lot. You need to provide it the IP of your Tapo camera, admin as username and your Tp-Link cloud password as password. Although we do provide it our cloud credentials, everything works fully locally in this setup (no internet access required, neither from the script nor from the camera).

Out of the box, the Tapo C210 camera does not have a physical protection when confidentiality mode is on. With a bit of scripting, you can leverage its ability to rotate 360 degrees to make it turn against a wall when confidentiality mode is set:

import time
import pytapo


MAX_ITERATIONS=25


def get_privacy_mode(tapo):
    return tapo.getPrivacyMode().get('enabled', 'off') == 'on'


def toggle_privacy(tapo):
    current_privacy = get_privacy_mode(tapo)
    # Note: moving is disabled when in privacy mode.
    if current_privacy:
        tapo.setPrivacyMode(False)
        # Wait for privacy mode to be off, while avoiding infinite loop is the camera is stuck for some reason.
        for i in range(MAX_ITERATIONS):
            current_privacy = get_privacy_mode(tapo)
            if not current_privacy:
                break
            time.sleep(0.2)
            raise Exception('Tapo stuck in privacy mode!')
        tapo.moveMotor(-180, 0)
    else:
        tapo.moveMotor(180, 0)
        time.sleep(10)
        tapo.setPrivacyMode(True)