Ruuvitag data reporter for fdbk
Project description
fdbk_ruuvi_reporter
Getting started
Originally published in a Medium post.
Following steps assume that you have some RuuviTags transmitting data near the Raspberry Pi. The steps also require some Raspberry Pi, Unix, and AWS knowledge:
- Setup a Raspberry Pi with a fresh Rasbian, connect it to internet, change your password, and optionally enable SSH.
- Install required software dependencies on the Raspberry Pi:
sudo apt-get update
sudo apt-get install bluez-hcidump python3 python3-pip
sudo pip3 install fdbk_ruuvi_reporter fdbk_dynamodb_plugin
- Create AWS DynamoDB tables and a reporter user with CloudFormation template.
- Create Access key for the reporter user in AWS. Configure the access keys and region to the
~/.aws
directory on the Raspberry Pi. - On Raspberry Pi, create topics for your RuuviTags with
fdbk-ruuvi-reporter --create-topic ${name} ${mac} --db-connection fdbk_dynamodb_plugin
where${name}
is the name for your sensor and${mac}
is the MAC address of the RuuviTag. - Try to run the reporter with
fdbk-ruuvi-reporter -v -i 10 --db-connection fdbk_dynamodb_plugin
, where-v
is for verbose,-i 10
sets data push interval to ten seconds, and--db-connection fdbk_dynamodb_plugin
specifies database connection to be used, here DynamoDB. Check from the AWS console that data is being transmitted. - Configure fdbk-ruuvi-reporter to start on reboot with
crontab -e
. For example, to transmit data every 15 minutes with output directed to file/home/pi/.reporter-log.txt
, the crontab row would be:
@reboot /usr/local/bin/fdbk-ruuvi-reporter -v -i 900 --db-connection fdbk_dynamodb_plugin > /home/pi/.reporter-log.txt
- Reboot the Raspberry Pi and check from the AWS console that data is being transmitted.
To access the data via fdbk development server on your development computer: Install fdbk
and fdbk_dynamodb_plugin
. Configure AWS credentials with read access rights to both topics and data tables. Run fdbk-server
, which is provided by fdbk
package, with DynamoDB plugin as the DB connection: fdbk-server --db-connection fdbk_dynamodb_plugin
. Navigate to http://localhost:8080/overview to access overview of the data.
Development
Installation
Run:
pip install fdbk_ruuvi_reporter
to install from PyPI or download this repository and run
python setup.py install
to install from sources.
Testing
Check and automatically fix formatting with:
pycodestyle fdbk_ruuvi_reporter
autopep8 -aaar --in-place fdbk_ruuvi_reporter
Run static analysis with:
pylint -E --enable=invalid-name,unused-import,useless-object-inheritance fdbk_ruuvi_reporter
Run unit tests with command:
python3 -m unittest discover -s tst/
Get test coverage with commands:
coverage run --branch --source fdbk_ruuvi_reporter/ -m unittest discover -s tst/
coverage report -m
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
Built Distribution
File details
Details for the file fdbk_ruuvi_reporter-3.1.1.tar.gz
.
File metadata
- Download URL: fdbk_ruuvi_reporter-3.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c26c739abb5844375671e7b280bb40e45a7c2ca8e62ab2e43f5e5bcb774d3f |
|
MD5 | 76af5e44cab6ed073efef8cc7fc66fb6 |
|
BLAKE2b-256 | 37f6c4452ad4f441dce311315cc4bcc17d86633ed67ff6d6cc7eaa01886bc9d4 |
File details
Details for the file fdbk_ruuvi_reporter-3.1.1-py3-none-any.whl
.
File metadata
- Download URL: fdbk_ruuvi_reporter-3.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8df406bc29ed1834effdbec7c35ce794bcb00c6a363eea8544e87f4e5f89345 |
|
MD5 | d6df29ad544283ea48dd4005ecb08c12 |
|
BLAKE2b-256 | 5e11dc65c66665cb643433c3d0066e3bc264607af0b00e4aa22e3b547556071d |