This is a sample program to acquire sensing data from the Omron environmental sensors 2JCIE-BL and 2JCIE-BU via the BLE interface.
Each sensor can acquire the following values respectively.
-
2JCIE-BL Environment Sensor (Bag Type)
- Temperature
- Relative humidity
- Ambient light
- UV index
- Pressure
- Sound noise
- Discomfort index
- Heat stroke
-
2JCIE-BU Environment Sensor (USB Type)
- Temperature
- Relative humidity
- Ambient light
- Barometric pressure
- Sound noise
- 3-Axis acceleration
- VOC Detection
- Discomfort index
- Heat stroke
- Seismic Detection
-
sample_2jciebl-bu-ble.py
This sample program that scans the advertising packet emitted by the environmental sensor with Bluetooth Low Energy and outputs the included sensing data to the log file.
Specify the environmental sensor type of data acquisition target with the option at startup.
Note: Pre-setting is necessary when using 2JCIE-BL01 Environment Sensor (Bag Type).-
2JCIE-BL Environment Sensor (Bag Type)
The following values are output.- Company ID
- Temperature
- Relative humidity
- Ambient light
- UV Index
- Barometric pressure
- Sound Noise
- eTVOC
- eCO2
-
2JCIE-BU Environment Sensor (USB Type)
- Company ID
- Sequence Number
- Temperature
- Relative humidity
- Ambient light
- UV Index
- Pressure
- Sound Noise
- Discomfort Index
- Heat stroke
- Battery Voltage
-
DEMO:
By running sample_2jciebl-bu-ble.py you can check the sensing data on the console.
A log file called sample.log is created and data is output.
- It is necessary to install dependency software beforehand.
Dependencies - Open Terminal and execute the following command.
$ mkdir omron_sensor $ cd omron_sensor $ git clone https://github.com/omron-devhub/2jciebl-bu-ble-raspberrypi.git
This is a procedure to operate the sample program.
Note: When using 2JCIE-BL Environment Sensor (Bag Type), Pre-set is required.
-
2JCIE-BL Environment Sensor (Bag Type) Open Terminal and execute the following command.
$ sudo python3 sample_2jciebl-bu-ble.py -m bag
Stop wiht Ctrl + C.
-
2JCIE-BU Environment Sensor (USB Type) Open Terminal and execute the following command.
$ sudo python3 sample_2jciebl-bu-ble.py -m usb
Stop wiht Ctrl + C.
2jciebl-bu-ble-raspberrypi requires the following dependencies.
Thank you to all our contributors!
Download the BLE device utility application "BLE Scanner" to your smartphone.
Change the beacon mode of the environment sensor by the following procedure.
- Find and connect a BLE device named Env (EnvSensor - BL01)
- Open "0C4C3040-7700-46F4-AA96D5E974E32A54" of CUSTOM SERVICE
- Open "0C4C3042-7700-46F4-AA96D5E974E32A54" of CUSTOM CHERACTERISTIC
- Tap Write Value "0808A000000A00320400"
- Tap Read Value to see if the set value is reflected
- Turn off the connection and confirm that the name of the device has changed to EP- BL01.
Change the measurement interval of the environment sensor by the following procedure.
- Open 0C4C3010-7700-46F4-AA96D5E974E32A54 of CUSTOM SERVICE
- Open 0C4C3011-7700-46F4-AA96D5E974E32A54 of CUSTOM CHERACTERISTIC
- Tap Write Value an arbitrary value in the range of 1 to 3600 sec.
Example: If 60 seconds, write "3C" - Tap Read Value to see if the set value is reflected