Bluetooth Onboarding
Bluetooth onboarding of the NET2GRID SmartBridge
All NET2GRID SmartBridges are capable of setting up a Bluetooth (v4.2) and Wi-Fi (2.4GHz) connection. Both are necessary for a seamless onboarding experience. This page gives an overview how to get SmartBridges online to unlock smart meter data.
Follow steps below to get the SmartBridge online.
- Device preparation
Ensure that the SmartBridge is turned on by connecting it to the smart meter, the LED will be blinking. - Discover and connect SmartBridge
Search for a Bluetooth device with the name starting withsbwf
, this is the standard NET2GRID advertised name. When found the device, connect the smartphone with the SmartBridge. - Get Wi-Fi network list
Retrieve the list of Wi-Fi networks. - Enter credentials
Enter Wi-Fi credentials and let the SmartBridge connect to the platform. - Onboard call
Do theonboard
call, with the EUI/MAC address to connect the account and the SmartBridge.
More detailed instruction can be found on this page below.
Communication
All Bluetooth communication goes via Bluetooth attributes. These attributes are recognised with a Universal Unique IDentifier (UUID), all UUIDs are differentiated with a hexadecimal code. There is one UUID (4E04
) that is used for multiple commands, a list of all commands is shown below. The commands are explained in the coming chapters. Other UUID are used to transfer different kind of information, all will be explained in the corresponding section.
Available commands for the SmartBridge via UUID 4E04
:
00
- Factory Reset01
- Discover Wi-Fi networks02
- Connect to Wi-Fi network
Discover and connect SmartBridge
After discovering all Bluetooth devices, find the SmartBridge that can typically be found based on the sbwf
prefix. Connect to the SmartBridge and verify that all is working in this stage by requesting the device details. The id
is necessary to connect the account to the SmartBridge. The exact procedure is described below.
- Ensure MTU is set to at least 128 bytes
- Read the value of the UUID
4E08
- The SmartBridge info is returned as a JSON string, see below for an example.
Successful info result
{ "id":"84df:0c00:0010:0000", "mf":"NET2GRID", "model":"SBWF4602", "fw":"2.10.1", "hw":"1", "batch":"XXX-CCC-180731" }
- Store the value of "id" (EUI) for later use in the CE-API user onboarding call
PUT {{url}}/registration/onboard/{{EUI}}
Note that the EUI of the BLE device is not to be used for this.
Connecting with Wi-Fi
Once connected to the SmartBridge, a Wi-Fi scan needs to be execute in order to let the user connect to the correct Wi-Fi with the right credentials. Follow the steps below to get the list of scanned Wi-Fi networks.
- Ensure MTU is set to at least 128 bytes
- Turn on notification of characteristic
4e06
. - Write a byte (array) with
01
to UUID4E04
, this will trigger the scan functionality. - All discovered Wi-Fi SSIDs will be notified in JSON format, see below for successful and error response.
Successful found Wi-Fi network
{ “ssid” : ”example_ssid” , “rssi”, -74 }
Error
{ “result” : “err” }
Enter credentials
In this stage the user is able to choose the right Wi-Fi network of a list of networks. After selecting the network, the user should enter the Wi-Fi password. With this information the next actions can be executed.
- Turn on notification of UUID
4E05
. - Write the Wi-Fi SSID in UTF-8 format to UUID
4E02
. - Write the Wi-Fi password in UTF-8 format to UUID
4E03
- Give the "Wi-Fi connect command" by writing a byte (array) with
02
to UUID4E04
. - UUID
4E04
will return a join result, the result of a successful join is:- First a join in progress (
01
) - Second a success (
00
) - Finally, the Bluetooth will be disconnected by the SmartBridge
- First a join in progress (
Join result
All join results of the Wi-Fi join command can be found in the table below.
Status Code | Meaning | Description |
---|---|---|
0x00 | Success | Device successfully joined the network |
0x01 | Join in progress | Device is attempting join - wait for next notification |
0x02 | Beacon Timeout | Access point no longer in range |
0x03 | No AP Found | Access point not found. Check SSID and retry |
0x04 | Authentication Failed | Unable to join. Check key and retry |
0x05 | Association Failed | Check SSID / access point and retry |
0x06 | Handshake Timeout | Check SSID / access point and retry |
0x07 | No Attempt | Device did not yet receive join command from client |
0x08 | Function Error | Internal error. No join attempt was made |
0x09 | SSID Error | Invalid SSID from client. No join attempt was made |
0x0A | Unknown Error | - |
Onboard call
At this stage the SmartBridge is online, now the onboard call can be done with the id
that was saved during the discovery step.
Updated 3 months ago