Skip to content

Record your dog

Once you have installed the program and created a telegram bot, you can start recording and monitor your dog.

Set up the configuration file

The bark monitor will read the configuration from a json file. By default, it will read the file config.json but use the option config-file to point to any path.

The config file should look like this:

{
    "py/object": "bark_monitor.cli.get_param.Parameters",
    "output_folder": {
        "py/reduce": [
            {
                "py/type": "pathlib.PosixPath"
            },
            {
                "py/tuple": [
                    "outputs"
                ]
            }
        ]
    },
    "config_folder": {
        "py/reduce": [
            {
                "py/type": "pathlib.PosixPath"
            },
            {
                "py/tuple": [
                    "config"
                ]
            }
        ]
    },
    "api_key": null,
    "config_file": null,
    "microphone_framerate": 16000,
    "sampling_time_bark_seconds": 1,
    "accept_new_users": false,
    "google_creds": null,
    "matrix_parameters": {
        "py/object": "bark_monitor.cli.get_param.MatrixParameters",
        "homeserver": "https://HOMESERVER",
        "user_id": "USER_ID",
        "password": "PASSWORD"
    },
    "nextcloud_parameters": {
        "py/object": "bark_monitor.cli.get_param.NextCloudParameters",
        "server": "https://SERVER.URL",
        "user": "USERNAME",
        "passwd": "PASSWORD"
    },
    "cloud_parameters": {
        "py/object": "bark_monitor.cli.get_param.CloudParameters",
        "server_url": "https://cloud.example.com",
        "device_token": null
    },
    "thingsboard_parameters": null
}

The json has the py/object attributes because it is a jsonpickle export.

Missing sections are null — including cloud_parameters, which only exists once you pair your device with the hosted cloud (the pairing tool fills it in for you).

Do not edit device_token by hand; it is written by bark-monitor-cloud-pair. matrix_parameters, nextcloud_parameters and cloud_parameters can all be present at the same time: the sync options combine (see where your data lives).

Register users

If it is your first time launching the bark monitor, the first step is to register your user. Users can only be registered if the monitor is launched in register mode: bark-monitor --accept-new-users. Once the monitor is launched, open your telegram bot, and send /register. You should now be register to this machine, and able receive notifications and control it.

Launch the recordings

Launching the bark monitor is as simple as entering bark-monitor --config-file <path to config file>.

As of now, bark-monitor --config-file <path to config file> launches the telegram bot. However, the matrix bot is recommanded and how to launch it is shown in its documentation.

If the set-up is correct you should receive a notification when the monitor is ready the record. To start a recording send /start to the bot. To stop it send /stop. See the matrix or telegram bot documentation for more details on what the bots can do.

If you are on Raspberry Pi or other device, consider using the TFlite version of Yamnet by using bark-monitor-lite --config-file <path to config file> instead.

Both commands need TensorFlow installed: with pip that means the [tf] extra (see install). The snap includes it.

Where the recordings are stored

Everything the monitor measures lands in recording.db in your output folder — a tamper-evident event log, one file to rule them all. If you upgrade from an older version, the old recording.json history is migrated automatically on first start. See where your data lives for the details and the sync options.