Skip to main content

API for OMRON 2JCIE-BU01 Environment Sensor

Project description

Module and sample code for obtaining data with OMRON 2JCIE-BU01 Environment Sensor by Python. The codes work with Python 3.6 and above. This module supports USB serial communication and BLE. This module depends on pySerial(serial communication) and Bleak(BLE).

Example:

# Obtain sensing data via serial communication
from omron_2jcie_bu01 import Omron2JCIE_BU01
sensor = Omron2JCIE_BU01.serial("/dev/ttyUSB0") # Linux
sensor = Omron2JCIE_BU01.serial("COM5")         # Windows
devinfo = sensor.info()
data = sensor.latest_data_long()

# Obtain sensing data via BLE communication
# Read latest data with connection
from omron_2jcie_bu01 import Omron2JCIE_BU01
sensor = Omron2JCIE_BU01.ble("AA:BB:CC:DD:EE:FF")
data1 = sensor.latest_sensing_data()
data2 = sensor.latest_calculation_data()

# Read latest data by scan
def on_scan(data):
    print("SCAN", data)

# Advertising mode: 0x01 (Passive)
sensor.scan(on_scan, scantime=3)

# Advertising mode: 0x03 (Active)
sensor.scan(on_scan, scantime=3, active=True)

# Notify sensing data
def on_notify(sender, tpl):
    print(f"{sender} {tpl}")

sensor.start_notify(0x5012, on_notify)
sensor.start_notify(0x5013, on_notify)
sensor.sleep(5)
sensor.stop_notify(0x5012)
sensor.stop_notify(0x5013)

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

omron-2jcie-bu01-interact-0.1.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

omron_2jcie_bu01_interact-0.1.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file omron-2jcie-bu01-interact-0.1.1.tar.gz.

File metadata

File hashes

Hashes for omron-2jcie-bu01-interact-0.1.1.tar.gz
Algorithm Hash digest
SHA256 384612e6ab09d2c92c79705d6c2282c8c95fb44f7cc68e0b5197525a27769c06
MD5 4f323618ae0fe7ace5650b7c68d10809
BLAKE2b-256 9de2f879e8bcc019d03b16a0df9131f37aea7499f502302a4af13a9e48f17357

See more details on using hashes here.

File details

Details for the file omron_2jcie_bu01_interact-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for omron_2jcie_bu01_interact-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83da20975c324aeba045b5e635f4680c27126ca9fa0958ec9afa44d7de985f67
MD5 0ee204f1e438d39ad30d02900d68f9aa
BLAKE2b-256 60abc9ef0696c6e1209203c3c396af5a15d6892a84d9f43485229897d5409bac

See more details on using hashes here.

Supported by

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