BH01 -- Bluetooth to LoRaWAN Hub
Table of Contents:
- 1. Introduction
- 2. Configure BH01-LB to connect to LoRaWAN network
- 2.1 How it works
- 2.2 Quick guide to connect to LoRaWAN server (OTAA)
- 2.3 Uplink Payload
- 2.3.1 Device Status, FPORT=5
- 2.3.2 Working Modes & Sensor Data. Uplink via FPORT=2
- 2.3.2.1 Parameter Description
- 2.3.2.1.1 Parameter a: type mode
- 2.3.2.1.2 Parameter b: The effective data length of the interception
- 2.3.2.1.3 Parameter c: intercepted valid data position
- 2.3.2.1.4 Parameter d: The starting position of the intercepted valid data
- 2.3.2.1.5 Parameter e: scan and filter data length
- 2.3.2.1.6 Parameter f: Scan filtered data location
- 2.3.2.1.7 Parameter g: the starting position of the scanned filtered data
- 2.3.2.1.8 Parameter h: scan filtered data
- 2.3.2.1 Parameter Description
- 2.3.3 Decode payload
- 2.4 Payload Decoder file
- 2.5 Frequency Plans
- 3. Configure BH01-LB
- 4. Battery & Power Consumption
- 5. OTA Firmware update
- 6. Order Info
- 7. Packing Info
- 8. Support
1. Introduction
1.1 What is BH01 Bluetooth to LoRaWAN Hub
BH01-LB Bluetooth to LoRaWAN Hub is an edge communication node device designed for IoT scenarios. It uses the BLE Bluetooth module to scan and collect data from surrounding Bluetooth temperature and humidity sensors (such as BCN02, iBeacon beacons) in real time, and then transmits the data to the cloud platform over long distances using the LoRaWAN protocol, achieving seamless connection between Bluetooth devices and low-power wide area networks. It is designed for outdoor use and powered by 8500mAh Li/SOCl2 battery for long term use.BH01-LB is designed to facilitate developers to quickly deploy industrial level LoRa and IoT solutions. It help users to turn the idea into apractical application and make the Internet of Things a reality. It is easy to program, create and connect your things everywhere.
BH01-LB wireless part is based on SX1262 allows the user to send data and reach extremely long ranges at low data-rates.It provides ultra-long range spread spectrum communication and high interference immunity whilst minimising current consumption.It is suitable for cold chain warehouse monitoring, smart agricultural environment monitoring, asset tracking and urban infrastructure health management. It combines the flexibility of Bluetooth and the wide coverage of LoRaWAN, which can significantly reduce the deployment cost of the Internet of Things.
BH01-LB has a built-in BLE module, user can configure the sensor remotely via Mobile Phone. It also support OTA upgrade via private LoRa protocol for easy maintaining.
1.2 Features
- LoRaWAN 1.0.3 Class A
- Ultra-low power consumption
- Open-Source hardware/software
- Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
- Support Bluetooth v5.1 and LoRaWAN remote configure
- Support wireless OTA update firmware
- Uplink on periodically
- Downlink to change configure
- 8500mAh Li/SOCl2 Battery
1.3 Specification
Common DC Characteristics:
- Supply Voltage: Built-in Battery , 2.5v ~ 3.6v
- Operating Temperature: -40 ~ 85°C
I/O Interface:
- Battery output (2.6v ~ 3.6v depends on battery)
- +5v controllable output
- 3 x Interrupt or Digital IN/OUT pins
- 3 x one-wire interfaces
- 1 x UART Interface
- 1 x I2C Interface
LoRa Spec:
- Frequency Range, Band 1 (HF): 862 ~ 1020 Mhz
- Max +22 dBm constant RF output vs.
- RX sensitivity: down to -139 dBm.
- Excellent blocking immunity
Battery:
- Li/SOCI2 un-chargeable battery
- Capacity: 8500mAh
- Self-Discharge: <1% / Year @ 25°C
- Max continuously current: 130mA
- Max boost current: 2A, 1 second
Power Consumption
- Sleep Mode: 5uA @ 3.3v
- LoRa Transmit Mode: 125mA @ 20dBm, 82mA @ 14dBm
1.4 Sleep mode and working mode
Deep Sleep Mode: Sensor doesn't have any LoRaWAN activate. This mode is used for storage and shipping to save battery life.
Working Mode: In this mode, Sensor will work as LoRaWAN Sensor to Join LoRaWAN network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode.
1.5 Button & LEDs
Behavior on ACT | Function | Action |
---|---|---|
Pressing ACT between 1s < time < 3s | Send an uplink | If sensor is already Joined to LoRaWAN network, sensor will send an uplink packet, blue led will blink once. |
Pressing ACT for more than 3s | Active Device | Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to JOIN LoRaWAN network. |
Fast press ACT 5 times. | Deactivate Device | Red led will solid on for 5 seconds. Means device is in Deep Sleep Mode. |
1.6 BLE connection
BH01-LB supports BLE remote configure.
BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case:
- Press button to send an uplink
- Press button to active device.
- Device Power on or reset.
If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
1.7 Pin Definitions
1.8 Mechanical
1.9 Hole Option
BH01-LB has different hole size options for different size sensor cable. The options provided are M12, M16 and M20. The definition is as below:
2. Configure BH01-LB to connect to LoRaWAN network
2.1 How it works
BH01-LB is configured as LoRaWAN OTAA Class A mode by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN network, you need to input the OTAA keys in the LoRaWAN IoT server and press the button to activate the BH01-LB.It will automatically join the network via OTAA and start scanning nearby Bluetooth devices, sending the scanned device information to the network.The default uplink interval is 20 minutes.
2.2 Quick guide to connect to LoRaWAN server (OTAA)
Following is an example for how to join the TTN v3 LoRaWAN Network. Below is the network structure; we use the LPS8v2 as a LoRaWAN gateway in this example.
The LPS8v2 is already set to connected to TTN network , so what we need to now is configure the TTN server.
Step 1: Create a device in TTN with the OTAA keys from BH01-LB.
Each BH01-LB is shipped with a sticker with the default device EUI as below:
You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
Register the device
Add APP EUI and DEV EUI
Add APP EUI in the application
Add APP KEY
Step 2: Activate BH01-LB
Press the button for 5 seconds to activate the BH01-LB.
Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to JOIN LoRaWAN network. Green led will solidly turn on for 5 seconds after joined in network.
After join success, it will start to upload messages to TTN and you can see the messages in the panel.
2.3 Uplink Payload
2.3.1 Device Status, FPORT=5
Users can use the downlink command(0x26 01) to ask BH01-LB to send device configure detail, include device configure status. BH01-LB will uplink a payload via FPort=5 to server.
The Payload format is as below.
Device Status (FPORT=5) | |||||
Size (bytes) | 1 | 2 | 1 | 1 | 2 |
Value | Sensor Model | Firmware Version | Frequency Band | Sub-band | BAT |
Example parse in TTNv3
Sensor Model: For SN50v3-LB, this value is 0x44
Firmware Version: 0x0100, Means: v1.0.0 version
Frequency Band:
0x01: EU868
0x02: US915
0x03: IN865
0x04: AU915
0x05: KZ865
0x06: RU864
0x07: AS923
0x08: AS923-1
0x09: AS923-2
0x0a: AS923-3
0x0b: CN470
0x0c: EU433
0x0d: KR920
0x0e: MA869
Sub-Band:
AU915 and US915:value 0x00 ~ 0x08
CN470: value 0x0B ~ 0x0C
Other Bands: Always 0x00
Battery Info:
Check the battery voltage.
Ex1: 0x0B45 = 2885mV
Ex2: 0x0B49 = 2889mV
2.3.2 Working Modes & Sensor Data. Uplink via FPORT=2
BH01-LB has different working mode for the connections of different type of sensors. This section describes these modes. Use can use the AT Command:
AT+MODEL=abcdefgh to set BH01-LB to different working modes.
For example:
AT+MODEL=030500190b0004ff4c000215011223344556 (turn on scanning Bluetooth ibeacon beacons)
Parameter a = 0x03: Set the scanning mode to Bluetooth ibeacon beacons.
Parameter b = 0x05: Set the intercepted data length to 5.
Parameter c = 0x00: Set the intercepted data position to the broadcast packet.
Parameter d = 0x19: Set the intercepted data starting position 25.
Parameter e = 0x0b: Set the filter data length to 11.
Parameter f = 0x00: Set the filter data position to the scan reply response packet.
Parameter g = 0x04: Set the filter data starting position 4.
Parameter h = 0xff4c000215011223344556: Set the filter data to 0xff4c000215011223344556 (0xff is AD Type).
2.3.2.1 Parameter Description
2.3.2.1.1 Parameter a: type mode
Modes 4 to 16 (a = 0x04 to 0x16) are user-defined scanning device modes based on the sensor used.
Mode 1 (a = 0x01): Bluetooth Temperature Tag (TAH02) mode
Mac address (6 bytes) | 0xEE 3B 14 28 32 D1 | / |
Sensor type (1 byte) | 0x03 | Temperature sensor |
Sensor data length (1 byte) | 0x04 | Data length |
Temperature (2 bytes) | 0x2701 | Temperature: 29.5℃ |
Battery (1 byte) | 0x64 | Battery: 100% |
RSSI (1 byte) | 0xC3 | 1 meter output power: -61db |
AT+MODEL=0104: Start scanning Bluetooth temperature tag (TAH02)mode.
AT+MODEL=0100: Turn off scanning for Bluetooth temperature tags (TAH02)mode.
Mode 2 (a = 0x02): Bluetooth temperature and humidity (ES01) mode
Mac address (6 bytes) | 0xEE 3B 14 28 32 D1 | / |
Sensor type (1 byte) | 0x03 | Temperature and humidity sensor |
Sensor data length (1 byte) | 0x05 | Data length |
Humidity (1 byte) | 0x4C | THumidity: 76% |
Temperature (2 bytes) | 0x2701 | Temperature: 29.5℃ |
Battery (1 byte) | 0x64 | Battery: 100% |
RSSI (1 byte) | 0xC3 | 1 meter output power: -61db |
AT+MODEL=0205: Enable Bluetooth temperature and humidity scanning (ES01)mode.
AT+MODEL=0200: Disable Bluetooth temperature and humidity scanning (ES01)mode.
Mode 3 (a = 0x03): Bluetooth ibeacon mode
Mac address (6 bytes) | 0xEE 3B 14 28 32 D1 | / |
Sensor type (1 byte) | 0x01 | ibeacon beacon |
Sensor data length (1 byte) | 0x06 | Data length |
Major (2byte) | 0x1122 | / |
Minor (2byte) | 0x004c | / |
Measured Power(1byte) | 0x64 | Measured Bluetooth transmission power |
RSSI (1 byte) | 0xC3 | 1 meter output power: -61db |
AT+MODEL=030500190b0004ff4c000215011223344556: Enable the Bluetooth ibeacon beacon scanning mode.
AT+MODEL=0300: Disable the Bluetooth ibeacon beacon scanning mode.
Mode 4 to 16(a = 0x04 to 0x16: user-defined scanning device mode
Note: Different scanning modes can work at the same time.
If the user needs to scan Bluetooth temperature and humidity (ES01) and Bluetooth Temperature Tag (TAH02) at the same time, then just input the following continuously:
AT+MODEL=0104
AT+MODEL=0205
2.3.2.1.2 Parameter b: The effective data length of the interception
b equals 0: indicates that the scanning of the corresponding modes 1 to 16 is canceled.
b is not equal to 0: set the b parameter according to the valid data intercepted by the sensor time.
For example,
in mode 1 (a = 0x01), the default parameter b is 4.
In mode 2 (a = 0x02), the default parameter b is 5.
When it is mode 1 and 2, scanning can be performed after setting the b parameter; the subsequent parameter cdefgh does not need to be set.Mode 1 (a = 0x01): Bluetooth Temperature Tag (TAH02)
In other modes,users need to set the following cdefgh parameters to enable this mode.
2.3.2.1.3 Parameter c: intercepted valid data position
c = 0x00: in the broadcast packet
c = 0x01: in the scan reply packet.
Note: Generally, there are two types of scan data: broadcast packets (31 bytes) and scan response packets (31 bytes).
There is at least one type of broadcast packet. You can use a mobile phone to scan and obtain the complete scan data.
Both the broadcast packet and the scan reply packet are composed of several unit data;
the unit data format is length+AD Type+AD Data.
Therefore, the broadcast packet and the scan reply packet are distinguished according to this rule. The following is a partial AD Type:
For example, the following figure is the complete scan data; related data analysis:
0x020106
length = 0x02
AD Type = 0x01
data = 0x06
1AFF4C0002150112233445566778899AABBCCDDEEFF027177073C31107ADE8F
Length = 0x1A
AD Type = 0xFF (this is a custom data type of the Bluetooth manufacturer)
data =0x4C0002150112233445566778899AABBCCDDEEFF027177073C3
1107ADE8F3D4B88494A0AAF5E20F23155A95
length = 0x02
AD Type = 0x01 (uuid)
data = 0xADE8F3D4B88494A0AAF5E20F23155A95
0C084557383045434343434600
length = 0x02
AD Type = 0x08 (Bluetooth name)
data = 0x4557383045434343434600
2.3.2.1.4 Parameter d: The starting position of the intercepted valid data
The starting position starts from 0.
The broadcast packet and the scan reply packet are two different packets, and the interception should start from 0.
The maximum is no more than 30.
2.3.2.1.5 Parameter e: scan and filter data length
The maximum value is 31.
2.3.2.1.6 Parameter f: Scan filtered data location
f = 0x00: The data location of the scan filter is in the broadcast packet
f = 0x01: The data location of the scan filter is in the scan reply packet
2.3.2.1.7 Parameter g: the starting position of the scanned filtered data
The starting position starts from 0.
The broadcast packet and the scan reply packet are two different packets, and the filtering data should start from 0.
The maximum is no more than 30.
2.3.2.1.8 Parameter h: scan filtered data
It is recommended to use data with UUID and Bluetooth name to filter out unnecessary scan data.
Generally, the more scan filter data there is, the less interference can be filtered.
The data starting from the starting position 0 to the data including UUID or Bluetooth name part can be used as filter data.
2.3.3 Decode payload
While using TTN V3 network, you can add the payload format to decode the payload.
The payload decoder function for TTN V3 are here:
BH01-LB TTN V3 Payload Decoder: https://github.com/dragino/dragino-end-node-decoder
2.3.3.1 Battery Info
Check the battery voltage for BH01-LB.
Ex1: 0x0B45 = 2885mV
Ex2: 0x0B49 = 2889mVxe
2.3.3.2 Battery Output - BAT pin
The BAT pin of BH01-LB is connected to the Battery directly. If users want to use BAT pin to power an external sensor. User need to make sure the external sensor is of low power consumption. Because the BAT pin is always open. If the external sensor is of high power consumption. the battery of SN50v3-LB/LS will run out very soon.
2.4 Payload Decoder file
In TTN, use can add a custom payload so it shows friendly reading
In the page Applications --> Payload Formats --> Custom --> decoder to add the decoder from:
https://github.com/dragino/dragino-end-node-decoder/tree/main/SN50_v3-LB
2.5 Frequency Plans
The SN50v3-LB/LS uses OTAA mode and below frequency plans by default. Each frequency band use different firmware, user update the firmware to the corresponding band for their country.
http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/
3. Configure BH01-LB
3.1 Configure Methods
BH01-LB supports below configure method:
- AT Command via Bluetooth Connection (Recommended): BLE Configure Instruction.
- AT Command via UART Connection : See UART Connection.
- LoRaWAN Downlink. Instruction for different platforms: See IoT LoRaWAN Server section.
3.2 General Commands
These commands are to configure:
- General system settings like: uplink interval.
- LoRaWAN protocol & radio related command.
They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/
3.3 Commands special design for BH01-LB
These commands only valid for BH01-LB, as below:
3.3.1 Set Transmit Interval Time
Feature: Change LoRaWAN End Node Transmit Interval.
AT Command: AT+TDC
Command Example | Function | Response |
---|---|---|
AT+TDC=? | Show current transmit Interval | 30000 |
AT+TDC=60000 | Set Transmit Interval | OK |
Downlink Command: 0x01
Format: Command Code (0x01) followed by 3 bytes time value.
If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
- Example 1: Downlink Payload: 0100001E // Set Transmit Interval (TDC) = 30 seconds
- Example 2: Downlink Payload: 0100003C // Set Transmit Interval (TDC) = 60 seconds
3.3.2 Get Device Status
Send a LoRaWAN downlink to ask the device to send its status.
Downlink Payload: 0x26 01
Sensor will upload Device Status via FPORT=5. See payload section for detail.
3.3.3 Set Workmode
Feature: Switch working mode.
AT Command: AT+MODEL=abcdefgh
Command Example | Function | Response |
---|---|---|
AT+MODEL=? | Get the scan filter model . | OK |
AT+MODEL=0104 | Set the working mode to TAH02. | OK END_TRANSFER_CONDITION |
Downlink Command: 0x08
Format: Command Code
· Example 1: Downlink Payload:
08 01 05 ---> AT+MODEL=0105
· Example 2: Downlink Payload:
08 03 05 00 19 0b 00 04 ff 4c 00 02 15 01 12 23 34 45 56 ---> AT+MODEL=030500190b0004ff4c000215011223344556 0x08 03 05 00 19 0b 00 04 ff 4c 00 02 15 01 12 23 34 45 56
3.3.4 Set up filtering of devices by signal strength
Feature: Filter Scan Devices
AT Command:AT+FILTERRSSI=XX
Command Example | Function | Response |
---|---|---|
AT+FILTERRSSI=? | Get the RSSI range of the scanned device | 0 OK |
AT+FILTERRSSI=-70 | Set the RSSI range of the scanning device to -70~0 | OK |
Downlink Command:0x09
Format: Command Code
· Example: Downlink Payload:
09 BA ---> AT+FILTERRSSI=-70
-70 is converted from signed to unsigned to decimal 186, and 186 is converted from decimal to hexadecimal to BA.
4. Battery & Power Consumption
BH01-LB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
Battery Info & Power Consumption Analyze .
5. OTA Firmware update
User can change firmware BH01-LB to:
- Change Frequency band/ region.
- Update with new features.
- Fix bugs.
Firmware and changelog can be downloaded from : Firmware download link
Methods to Update Firmware:
- (Recommanded way) OTA firmware update via wireless: http://wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/
- Update through UART TTL interface: Instruction.
6. Order Info
Part Number: BH01-LB-XX-YY
XX: The default frequency band
- AS923: LoRaWAN AS923 band
- AU915: LoRaWAN AU915 band
- EU433: LoRaWAN EU433 band
- EU868: LoRaWAN EU868 band
- KR920: LoRaWAN KR920 band
- US915: LoRaWAN US915 band
- IN865: LoRaWAN IN865 band
- CN470: LoRaWAN CN470 band
YY: Hole Option
- 12: With M12 waterproof cable hole
- 16: With M16 waterproof cable hole
- 20: With M20 waterproof cable hole
- NH: No Hole
7. Packing Info
Package Includes:
- BH01-LB Bluetooth to LoRaWAN Hub
Dimension and weight:
- Device Size: cm
- Device Weight: g
- Package Size / pcs : cm
- Weight / pcs : g
8. Support
- Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule.
- Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to support@dragino.cc