Skip to main content

Control a Kamoer Dripping Pro pump

Project description

btdripper

Control your Kamoer Dripping Pro plant irrigation pump with Python.

You can read more about the idea behind this in this blog post.

Installation

pip3 install btdripper

Demo

You can run btdripper.py from the command line.

$ btdripper.py --help
usage: btdripper.py [-h] [--adapter ADAPTER] [--mac MAC] [--duration DURATION]

Dripper Pro SDK Demo

optional arguments:
  -h, --help           show this help message and exit
  --adapter ADAPTER    Name of Bluetooth adapter, defaults to 'hci0'
  --mac MAC            Mac address of Dripper Pro device to connect to
  --duration DURATION  Duration in seconds to turn on the pump. Default is 1s

Or you can directly import it into your project

$ python
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
>>> import btdripper
>>> dripper = btdripper.BtDripper()
>>> dripper.on()
>>> dripper.off()

API

First, you need to create a new BtDripper instance. When you use an empty constructor, the library will try to connect to the first BLE device called "grow_c" that it finds. If you already know your dripper's MAC address, you can provide it as a parameter to speed up connection. The parameter is mac_address and it takes an address in the format "90:e2:02:9c:db:50". Should you have more than one bluetooth adapter, you can supply that with the adapter_name parameter (default is "hci0") There is also a way to reuse a gatt.DeviceManager via the manager parameter if you need to support more than one bluetooth device.

The BtDripper class supports the following methods:

  • on - turns dripper on
  • off - turns dripper off
  • send_sequence - sends a sequence of user-defined byte strings, should you want to experiment yourself.

Note that if you send malformed custom sequences, it can cause the driiper's software to hang. It will not reconnect and only a power cycle helps.

Todo

This is a very basic implementation. It should be possible to find out how the timer mode works and integrate that. Maybe there is even a way to run the pump at lower speeds?

There are currently no timeouts or error handling. Also I wouldn't be surprised if the library breaks in an unexpected situation. Use at your own risk :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

btdripper-0.1.0.post1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

btdripper-0.1.0.post1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file btdripper-0.1.0.post1.tar.gz.

File metadata

  • Download URL: btdripper-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for btdripper-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 856d37e61fead9a9439d8e6d5844e030f6fd2d1d25a79b6a59e2b3010620748c
MD5 add05026c6bfedeb5f7542e6e0de3e4b
BLAKE2b-256 50edb456c369860a958d41622c456f6c536f1ec4a3daa0041618723c347581e9

See more details on using hashes here.

File details

Details for the file btdripper-0.1.0.post1-py3-none-any.whl.

File metadata

  • Download URL: btdripper-0.1.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for btdripper-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 72f98de06bdc8c45152fd6e78f522848bcd8a85f41684b302b8b231a42257087
MD5 3e43e0fdf3582a8bb5382490970c9dcc
BLAKE2b-256 cf018e4aaf88a3cca8a622dd314aea86df8423f2636b97cab9ed32b3a30f7d31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page