> For the complete documentation index, see [llms.txt](https://docs.net2grid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.net2grid.com/integration-guide/device-and-onboarding.md).

# Device & Onboarding

## SBWF4602/4612

The NET2GRID SBWF4602/4612 is a low-cost home energy gateway (also referred to as a SmartBridge) that collects energy data through the P1 port of DSMR meters. Data is made available either via a local HTTP service on the home network, or optionally via the NET2GRID platform connection.

### Installation

The P1 meter interface can typically be accessed directly by the end user installing the SmartBridge:

* All smart meters using the SMR5.0 protocol support plug-and-play installation.
* Older smart meters may require an additional power cable.
* If the P1 port is already in use, the SmartBridge can be installed using a P1-splitter.

### **LED Status**

The LED provides at-a-glance feedback on the device's connection state:

<table><thead><tr><th width="124.64453125">Status</th><th width="131.21875">Timing</th><th>Description</th></tr></thead><tbody><tr><td>Off</td><td>n/a</td><td>No power; system reset pending</td></tr><tr><td>Fast Blink</td><td>0.3 sec</td><td>Bluetooth (if rebooted) and WiFi access point active</td></tr><tr><td>Slow Blink</td><td>1 sec</td><td>Waiting for WiFi and platform connection</td></tr><tr><td>Solid on</td><td>n/a</td><td>Connected with platform and operational</td></tr></tbody></table>

## Bluetooth Onboarding

All NET2GRID SmartBridges support Bluetooth (v4.2) and Wi-Fi (2.4GHz), which enable a seamless onboarding experience: the user's smartphone discovers the SmartBridge over Bluetooth, retrieves the list of nearby Wi-Fi networks, and passes along credentials so the device can connect to the NET2GRID platform.

All Bluetooth communication is performed through GATT attributes (characteristics), each identified by a Universal Unique IDentifier (UUID). The **UUID 4E04**, is used to send bluetooth command to the device, and supports the following values:

| Command                  | Value |
| ------------------------ | ----- |
| Factory Reset            | `00`  |
| Discover Wi-Fi networks  | `01`  |
| Connect to Wi-Fi network | `02`  |

### **Onboarding Process**

Upon device boot, the connection process of the next flowchart is followed. Initially, upon device boot, the device checks for stored Wi-Fi credentials.

1. If this is the first onboarding and there are no credentials, LED flashes fast, it waits until they are provided as described in the next paragraphs. If the network connection fails with the provided credentials, the Access Point and Bluetooth remain enabled.
2. If stored credentials exist:
   1. The device attempts to connect using them.
   2. If the connection fails, the device enables the Access Point and Bluetooth while waiting for new credentials. LED flashes fast. It can accept new credentials at this stage, but also tries to connect to the stored credentials every minute.

If the device disconnects, it will make 10 attempts to reconnect to the network. If all 10 attempts fail, only the Access Point will be enabled. In order to use Bluetooth to provide new credentials, the device must be re-booted.

<figure><img src="https://881570964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoRiIN2dSWhexNqjVHrZc%2Fuploads%2FiZJ6HJ5rOApfQwC91wts%2Fimage.png?alt=media&amp;token=eb3240ae-92e2-4f53-93a8-e50a6433c218" alt=""><figcaption></figcaption></figure>

#### **Step 1: Discover and Connect to the SmartBridge**

1. Ensure the SmartBridge is powered on (connected to the smart meter) — the LED will be blinking.
2. Search for a Bluetooth device advertised with the `sbwf` prefix, and connect to it.
3. Set the MTU to at least 128 bytes.
4. Read the value of **UUID 4E08** to retrieve device information, returned as JSON:

```json
{
  "id": "84df:0c00:0010:0000",
  "mf": "NET2GRID",
  "model": "SBWF4602",
  "fw": "2.10.1",
  "hw": "1",
  "batch": "XXX-CCC-180731"
}
```

> **Important:** Do not use the Bluetooth MAC address to identify the device — only the `id` value from the JSON response is valid.

#### **Step 2: Discover Wi-Fi Networks**

Once connected to the SmartBridge, a Wi-Fi scan must be performed so the user can select the correct network and provide valid credentials. Follow the steps below to retrieve the list of available Wi-Fi networks.

1. Ensure the MTU is set to at least 128 bytes.
2. Enable notifications on **UUID 4E06**.
3. Trigger the Wi-Fi scan by writing `01` to the command attribute (**UUID 4E04**).
4. Discovered networks are returned via notification, one per SSID:

```json
{ "ssid": "example_ssid", "rssi": -74 }
```

#### **Step 3: Connect to a Wi-Fi Network**

At this stage, the user selects the desired Wi-Fi network from the scan list and provides the corresponding password. With this information, the SmartBridge can initiate the Wi-Fi connection process. The process is the following:

1. Enable notifications on **UUID 4E05**.
2. Write the selected SSID (UTF-8) to **UUID 4E02**.
3. Write the Wi-Fi password (UTF-8) to **UUID 4E03**.
4. Trigger the Wi-Fi connection by writing `02` to the command attribute (**UUID 4E04**).
5. The join result is returned via notification on UUID 4E05:
   * One or more `01` (Join in Progress) notifications — up to 10 attempts
   * A final `00` (Success) notification once connected
6. On success, the SmartBridge closes the Bluetooth session and the LED turns solid on.
7. The SmartBridge checks for a potential firmware update and reboots if needed.

#### Join Result

All join results of the Wi-Fi join command can be found in the table below.

<table data-header-hidden><thead><tr><th width="151.9921875"></th><th width="200.0390625"></th><th></th></tr></thead><tbody><tr><td><strong>Status Code</strong></td><td><strong>Meaning</strong></td><td><strong>Description</strong></td></tr><tr><td>0x00</td><td>Success</td><td>Device successfully joined the network.</td></tr><tr><td>0x01</td><td>Join in Progress</td><td>Device is attempting join - wait for next notification.</td></tr><tr><td>0x02</td><td>Beacon Timeout</td><td>Access point no longer in range.</td></tr><tr><td>0x03</td><td>No AP Found</td><td>Access point not found. Check SSID and retry.</td></tr><tr><td>0x04</td><td>Authentication Failed</td><td>Unable to join. Check key and retry.</td></tr><tr><td>0x05</td><td>Association Failed</td><td>Check SSID / access point and retry.</td></tr><tr><td>0x06</td><td>Handshake Timeout</td><td>Check SSID / access point and retry.</td></tr><tr><td>0x07</td><td>No Attempt</td><td>Device did not yet receive join command from client.</td></tr><tr><td>0x08</td><td>Function Error</td><td>Internal error. No join attempt was made.</td></tr><tr><td>0x09</td><td>SSID Error</td><td>Invalid SSID from client. No join attempt was made.</td></tr><tr><td>0x0A</td><td>Unknown Error</td><td>-</td></tr></tbody></table>

> 📘 The status codes **0x04**, **0x05** and **0x06** cannot be guaranteed to exactly mean what is listed above. For instance, a wrong password could end up in a handshake timeout, so **0x06** instead of **0x04**.
>
> These 3 cases should be treated the same way, and the entire SSID discovery and password entry loop should be retried upon failure.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.net2grid.com/integration-guide/device-and-onboarding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
