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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omron-2jcie-bu01-interact-0.1.0.tar.gz.
File metadata
- Download URL: omron-2jcie-bu01-interact-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8817e0a1dceab0cb1e5cf33645733c9ce87a2c012fa94efcacc263db016d2ee
|
|
| MD5 |
7a93533b0bf569e1e2af4290bb7e4b56
|
|
| BLAKE2b-256 |
3b64519e4ad69fc9a513fd8b977e94dfaa720afae91f9064f22f72072cb6f415
|
File details
Details for the file omron_2jcie_bu01_interact-0.1.0-py3-none-any.whl.
File metadata
- Download URL: omron_2jcie_bu01_interact-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1da4337241186351f14b8585c1c9cb96a1838aaabbeee7e58b3fc38b0c79e219
|
|
| MD5 |
ea1071a703591dd9a85555ad5e1b9846
|
|
| BLAKE2b-256 |
4420565f903f0dd213dae5f275e68c1325dd6197b075b3caaa66ba033eebca2b
|