This project aims to implement a simple Bluetooth-Ethernet Thin Gateway, the sensor measures and collects data from the device's environment and the gateway requests the results via BLE.
When the device is connected to a sensor peripheral the gateway reads the BLE characteristics to retrieve the measured temperature and humidity. The measurement results are uploaded to dweet.io via the Ethernet Click board.
The block diagram of this application is shown in the image below:
More detailed information can be found in the section How it works.
This code example referred to the following code example. More detailed information can be found here:
- SDK version
- Software Required
- Hardware Required
- Connections Required
- Setup
- How It Works
- Report Bugs & Get Support
- 1x Bluetooth Low Energy Explorer Kit is used for the Data Collector. For example, BGM220-EK4314A
- 1x SLTB010A EFR32BG22 Thunderboard Kit running the Bluetooth - SoC Thunderboard EFR32BG22 (BRD4184A) example (included in the SiSDK)
- 1x ETH WIZ Click
The hardware connection is shown in the image below:
- The ETH WIZ Click can be plugged into the BGM220 Bluetooth Module Explorer Kit via the mikroBus socket
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.
Note
-
Make sure that the Third Party Hardware Drivers extension is installed as part of the SiSDK and the bluetooth_applications repository is added to Preferences > Simplicity Studio > External Repos.
-
SDK Extension must be enabled for the project to install the required components.
-
From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "ethernet".
-
Click Create button on Bluetooth - Ethernet Gateway examples. Example project creation dialog pops up -> click Create and Finish and Project should be generated.

-
Build and flash this example to the board.
-
Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.
-
Copy all attached files in the inc and src folders into the project root folder (overwriting existing).
-
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Platform] → [Driver] → [SPI] → [SPIDRV] → default instance name: mikroe → Set "SPI master chip select (CS) control scheme" to "spidrvCsControlApplication"
- [Platform] → [Driver] → [LED] → [Simple LED] → default instance name: led0
- [Third Party Hardware Drivers] → [Interface] → [W5500 - ETH WIZ Click (Mikroe)]
-
Build and flash this example to the board.
-
From the Simplicity Studio 5 launcher, run the Bluetooth - SoC Thunderboard EFR32BG22 (BRD4184A) demo on the Thunderboard EFR32BG22 board
-
Enable floating-point support for printf
Note
A bootloader needs to be flashed to your board if the project starts from the "Bluetooth - SoC Empty" project, see Bootloader for more information.
-
Initialize the peripherals and the Bluetooth stack.
-
Initialize the ethernet module.
-
Initialize the DHCP client on the ethernet module.
-
Get the gateway IP, subnet mask, and local IP from the DHCP server.
-
Setting DNS server.
-
Get the IP of the remote server:
dweet.io. -
Start scanning for thunderboard sense device filter the result by name:
Thunderboard. -
Connect to the device with the highest RSSI
- If the BLE connection is established:
- Discover environment sensing service and temperature & humidity characteristic.
- Start a timer with period 3s to check the connection is timed out.
- If failed to connect to the device then restart the scanning process.
- If the BLE connection is established:
-
When discovering service and characteristic is finished
- If the temperature & humidity characteristic are found then start a periodic timer to collect sensor data
- If no service and characteristic are found within 3s then restart the scanning process.
-
In periodic timer handler, collect sensor data and send them to the remote server by using HTTP GET request.
- Indicate the Thunderboard Sense device is connected
- These interfaces can be opened from a simple browser (except real-time stream) or most of them can be integrated into dashboards and other services.
- Follow URL: https://dweet.io/follow/<device_name>
- Example:
- Visual dashboard: https://dweet.io/follow/thunderboard-be-gateway
- Read all messages: https://dweet.io/get/dweets/for/thunderboard-be-gateway
- Real-time stream: https://dweet.io/listen/for/dweets/from/thunderboard-be-gateway
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of bluetooth_applications repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of bluetooth_applications repo.