# HJ212-2017

HJ212-2017 is an IoT standard outlining data transmission between pollution monitoring systems and environmental agencies. 

The Neuron HJ212-2017 plugin collects data from devices supporting this standard, with the current version supporting only active data uploads.

## Add Device

Go to **Configuration -> South Devices**, then click **Add Device** to add the driver. Configure the following settings in the popup dialog box.

- Name: The name of this device node.
- Plugin: Select the **HJ212-2017** plugin.

## Device Configuration

After clicking **Create**, you will be redirected to the **Device Configuration** page, where we will set up the parameters required for Neuron to establish a connection with the northbound application. You can also click the device configuration icon on the southbound device card to enter the **Device Configuration** interface.

| Parameter         | Description                                                  |
| ----------------- | ------------------------------------------------------------ |
| **Physical Link** | Choose Serial or TCP connection mode.                        |
| **Serial Device** | Only for **Serial** mode, use a serial device, e.g. /dev/ttyUSB0 |
| **Stop Bits**     | Only for **Serial** mode, stop bits, default 1               |
| **Parity**        | Only for **Serial** mode, parity bit                         |
| **Baud Rate**     | Only for **Serial** mode, baud rate, default 9600            |
| **Data Bits**     | Only for **Serial** mode, byte size, default 8               |
| **IP Address**    | Only for **TCP** mode. <br />When Neuron is used as a client, fill in the IP of the remote device. <br />When Neuron is used as a server, fill in the IP of Neuron locally, 0.0.0.0 can be filled in by default. |
| **Port**          | Only for **TCP** mode. <br />When Neuron is used as a client, fill in the TCP port of the remote device. <br />When Neuron is used as a server, fill in the TCP port of Neuron. |
| **Password**      | Password                                                     |
| **MN**            | Device ID                                                    |
| **ST**            | System code                                                  |

## Configure Data Groups and Tags

After the plug-in is added and configured, the next step is to establish communication between your device and Neuron by adding groups and tags to the Southbound driver.

Once device configuration is completed, navigate to the **South Devices** page. Click on the device card or device row to access the **Group List** page. Here, you can create a new group by clicking on **Create**, then specifying the group name and data collection interval.

Upon successfully creating a group, click on its name to proceed to the **Tag List** page. This page allows you to add device tags for data collection. You'll need to provide information such as the tag address, attributes, and data type.

For information on general configuration items, see [Connect to Southbound Devices](../south-devices.md). The subsequent section will concentrate on configurations specific to the driver.

### Data Types

* STRING
* DOUBLE
* UINT8
* INT8

### Address Format

#### Pollutant Real-time Data

> RT!xxxx-[Rtd\][Flag\][SampleTime\][EFlag]

| Address              | Type   | Description                    |
| -------------------- | ------ | ------------------------------ |
| RT!w01018-Rtd        | double | w01018 real-time data          |
| RT!w01018-Flag       | string | w01018 realtime data flag      |
| RT!w01018-SampleTime | string | w01018 real-time sampling time |
| RT!w01018-EFlag      | string | w01018 device flag             |
| RT!w01018-ZsRtd      | double | w01018 real-time zs data       |

#### Pollutant Minute Data

> MIN!xxxx-[Cou\][Min\][Avg\][Max\][Flag]

| Address          | Type   | Description             |
| ---------------- | ------ | ----------------------- |
| MIN!w01018-Cou   | double | w01018 cumulative value |
| MIN!w01018-Min   | double | w01018 min value        |
| MIN!w01018-Avg   | double | w01018 average value    |
| MIN!w01018-Max   | double | w01018 max value        |
| MIN!w01018-Flag  | string | w01018 data flag        |
| MIN!w01018-ZsMin | double | w01018 min zs value     |
| MIN!w01018-ZsAvg | double | w01018 average zs value |
| MIN!w01018-ZsMax | double | w01018 max zs value     |

#### Pollutant Hour Data

> HOUR!xxxx-[Cou\][Min\][Avg\][Max\][Flag]

| Address           | Type   | Description             |
| ----------------- | ------ | ----------------------- |
| HOUR!w01018-Cou   | double | w01018 cumulative value |
| HOUR!w01018-Min   | double | w01018 min value        |
| HOUR!w01018-Avg   | double | w01018 average value    |
| HOUR!w01018-Max   | double | w01018 max value        |
| HOUR!w01018-Flag  | string | w01018 data flag        |
| HOUR!w01018-ZsMin | double | w01018 min zs value     |
| HOUR!w01018-ZsAvg | double | w01018 average zs value |
| HOUR!w01018-ZsMax | double | w01018 max zs value     |

#### Pollutant Day Data

> DAY!xxxx-[Cou\][Min\][Avg\][Max\][Flag]

| Address          | Type   | Description             |
| ---------------- | ------ | ----------------------- |
| DAY!w01018-Cou   | double | w01018 cumulative value |
| DAY!w01018-Min   | double | w01018 min value        |
| DAY!w01018-Avg   | double | w01018 average value    |
| DAY!w01018-Max   | double | w01018 max value        |
| DAY!w01018-Flag  | string | w01018 data flag        |
| DAY!w01018-ZsMin | double | w01018 min zs value     |
| DAY!w01018-ZsAvg | double | w01018 average zs value |
| DAY!w01018-ZsMax | double | w01018 max zs value     |

## Data Monitoring

After completing the point configuration, you can click **Monitoring** -> **Data Monitoring** to view device information and control devices. For details, refer to [Data Monitoring](../../../admin/monitoring.md).
