GithubHelp home page GithubHelp logo

t-pc-public / envsensor-observer-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omronmicrodevices/envsensor-observer-py

0.0 0.0 0.0 29 KB

Python Bluetooth low energy observer example for OMRON Environment Sensor (2JCIE-BL01)

Python 100.00%

envsensor-observer-py's Introduction

envsensor-observer-py

Python Bluetooth low energy observer example for OMRON Environment Sensor (2JCIE-BL01)(2JCIE-BU01).

  • No BLE connections are required
  • Accept advertisements from multiple sensor
  • Collect variety of environmental information from sensor beacon
    • Temperature
    • Humidity
    • Light
    • UV Index
    • Absolute pressure
    • Noise (Sound level)
    • 3-Axis Acceleration
    • Discomfort Index
    • Heatstroke risk indicator
    • Battery voltage
    • RSSI
  • 2JCIE-BU Environment Sensor (USB Type) is now supported (Advertising mode 0x01 & 0x02)
  • Flexible data logging options
    • Local CSV file (rotate every midnight)
    • Local / Remote fluentd daemon
    • Local / Remote InfluxDB
  • Tested on Raspberry Pi 3 model B (built-in Bluetooth connectivity)

Diagram

Requirements

Instructions

These instructions apply only to an up-to-date Raspbian Jessie with PIXEL, the official Raspberry PI distro.

Prerequisite

$ sudo apt-get install python-bluez

When using fluentd forwarder (Optional)

$ sudo pip install fluent-logger

When uploading data to influxDB 0.9 or higher (Optional)

$ sudo pip install influxdb
$ sudo pip install --upgrade influxdb

Device Setup

Sensor

Environment Sensor (2JCIE-BL01) must be configured as a beacon broadcaster (IM/EP).

In this mode of operation, sensor data is included in the advertisement packet to be transmitted.

Please refer to communication interface manual for more details.

Configuration

Open conf.py and edit your configuration.

CSV is saved under ./log/ directory in the script path by default.

You can specify a different log location in your configuration.

Run

  • Normal mode

Only sensor status information is sent to stdout in a set interval.

$ sudo ./envsensor_observer.py

You need to make envsensor_observer.py executable.

You can use Supervisor to start the script running in the background when system boot.

  • Debug mode

Full Bluetooth messages are sent to stdout in addition to the sensor status.

$ sudo ./envsensor_observer.py --debug

or

$ sudo ./envsensor_observer.py -d

Visualization

With Grafana, you can easily visualize any of data stored in InfluxDB through this script.

Dashboard

Note :

It should be noted that this example code is for demonstration purposes only, it is not intended for use in a production environment, is not guaranteed fit for any purpose.

Reference :

envsensor-observer-py's People

Contributors

t-pc-public avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.