{
    "ok": true,
    "data": {
        "title": "EP-0106",
        "rev_id": 10666,
        "updated_at": "2021-08-27T10:25:15+00:00",
        "chunk_count": 34,
        "chunks": [
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "",
                "chunk_index": 0,
                "content": "# EP-0106",
                "char_count": 9,
                "token_estimate": 3
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "DockerPi Sensor Hub Development Board",
                "chunk_index": 1,
                "content": "<figure>\n<img src=\"Sensorhub2.jpg\" title=\"Sensorhub2.jpg\" width=\"300\" alt=\"Sensorhub2.jpg\" \/>\n<figcaption aria-hidden=\"true\">Sensorhub2.jpg<\/figcaption>\n<\/figure>",
                "char_count": 162,
                "token_estimate": 41
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Description",
                "chunk_index": 2,
                "content": "The DockerPi SensorHub for obtaining environmental parameters in the Internet of Things.\nIt integrates various environmental sensors: temperature sensors, humidity sensors, air pressure sensors, lighting and thermal infrared sensors.\nYou can use them in smart homes.\nTo obtain various parameters in life, these parameters can be processed to control the home reasonably and intelligently.\nFor example, the temperature of the temperature sensor can be used to control the heating device or the air conditioner.\nThe thermal infrared sensor can detect if someone is in the living room.",
                "char_count": 582,
                "token_estimate": 146
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "ChangeLog",
                "chunk_index": 3,
                "content": "-   2020-05-07: DockerPi Sensor Hub Development Board V2.0 Changed Temperature Sensor from DHT11 to DHT12.\n\n<img src=\"Banb8.jpg\" title=\"Banb8.jpg\" width=\"500\" alt=\"Banb8.jpg\" \/>",
                "char_count": 177,
                "token_estimate": 45
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Features",
                "chunk_index": 4,
                "content": "-   DockerPi Series\n-   Programmable\n-   Read directly(without programming)\n-   Extend the GPIO Pins\n-   Ext. Temperature Detection, Thermistor Detection Temperature Range -30℃\\~127℃\n-   OnBoard Temperature DHT11 -20℃\\~60℃\n-   P. Temperature Sensor -40℃\\~80℃.\n-   Humidity detection, sensor detection range 20% Rh \\~ 95% Rh\n-   Light intensity detection, detection range: 0Lux\\~1800Lux\n-   Pressure detection, detection range: 300 Pa \\~ 1100 hPa\n-   Biopsy test (biopsy test with corresponding indicator), maximum detection angle of 100 degrees, maximum distance of 12m\n-   Can Stack with other Stack board\n-   Independent of the mainboard hardware (require I2C support)",
                "char_count": 670,
                "token_estimate": 168
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Official Compatibility Test",
                "chunk_index": 5,
                "content": "Not only support the following development boards, other development boards can be compatible if they have I2C peripherals. (Note: some software changes may be required)\n\n| Platform                  | DockerPi Sensor Hub | Notes                                |\n|---------------------------|---------------------|--------------------------------------|\n| Raspberry Pi All Platform | √                   | Not Include CM Series & EOL Platform |\n| Banana Pi M3              | √                   | Python 3 & Modify DEVICE_BUS to 2    |\n| Orange Pi Zero            | √                   | Python 3 & Modify DEVICE_BUS to 0    |",
                "char_count": 625,
                "token_estimate": 157
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Package Includes",
                "chunk_index": 6,
                "content": "-   1 x Sensor Hub development board\n-   4 x M2.5x12 copper stick\n-   8 x M2.5x6 screws and nuts\n-   1 x NTC temperature sensor (waterproof)\n-   1 x Introductions\n\n<img src=\"Sensorhub9.jpg\" title=\"Sensorhub9.jpg\" width=\"320\" alt=\"Sensorhub9.jpg\" \/>",
                "char_count": 248,
                "token_estimate": 62
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V2.0",
                "chunk_index": 7,
                "content": "|                                                                       |                                                                       |                                                                       |\n|-----------------------------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------|\n| <figure>\n <img src=\"Banb1.jpg\" title=\"Banb1.jpg\" width=\"320\" alt=\"Banb1.jpg\" \/>\n <figcaption aria-hidden=\"true\">Banb1.jpg<\/figcaption>\n <\/figure>                                                              | <figure>\n                                                                         <img src=\"Banb2.jpg\" title=\"Banb2.jpg\" width=\"320\" alt=\"Banb2.jpg\" \/>\n                                                                         <figcaption aria-hidden=\"true\">Banb2.jpg<\/figcaption>\n                                                                         <\/figure>                                                              | <figure>",
                "char_count": 1080,
                "token_estimate": 270
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V2.0",
                "chunk_index": 8,
                "content": "<img src=\"Banb3.jpg\" title=\"Banb3.jpg\" width=\"320\" alt=\"Banb3.jpg\" \/>\n                                                                                                                                                 <figcaption aria-hidden=\"true\">Banb3.jpg<\/figcaption>\n                                                                                                                                                 <\/figure>                                                              |",
                "char_count": 486,
                "token_estimate": 122
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V2.0",
                "chunk_index": 9,
                "content": "|                                                                       |                                                                       |                                                                       |\n|-----------------------------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------|\n| <figure>\n <img src=\"Banb4.jpg\" title=\"Banb4.jpg\" width=\"320\" alt=\"Banb4.jpg\" \/>\n <figcaption aria-hidden=\"true\">Banb4.jpg<\/figcaption>\n <\/figure>                                                              | <figure>\n                                                                         <img src=\"Banb5.jpg\" title=\"Banb5.jpg\" width=\"320\" alt=\"Banb5.jpg\" \/>\n                                                                         <figcaption aria-hidden=\"true\">Banb5.jpg<\/figcaption>\n                                                                         <\/figure>                                                              | <figure>",
                "char_count": 1080,
                "token_estimate": 270
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V2.0",
                "chunk_index": 10,
                "content": "<img src=\"Banb6.jpg\" title=\"Banb6.jpg\" width=\"320\" alt=\"Banb6.jpg\" \/>\n                                                                                                                                                 <figcaption aria-hidden=\"true\">Banb6.jpg<\/figcaption>\n                                                                                                                                                 <\/figure>                                                              |",
                "char_count": 486,
                "token_estimate": 122
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 11,
                "content": "|                                                                                      |                                                                                      |                                                                                      |\n|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Sensorhub1.jpg\" title=\"Sensorhub1.jpg\" width=\"320\" alt=\"Sensorhub1.jpg\" \/>\n <figcaption aria-hidden=\"true\">Sensorhub1.jpg<\/figcaption>\n <\/figure>                                                                             | <figure>\n                                                                                        <img src=\"Sensorhub2.jpg\" title=\"Sensorhub2.jpg\" width=\"320\" alt=\"Sensorhub2.jpg\" \/>\n                                                                                        <figcaption aria-hidden=\"true\">Sensorhub2.jpg<\/figcaption>",
                "char_count": 1100,
                "token_estimate": 275
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 12,
                "content": "<\/figure>                                                                             | <figure>\n                                                                                                                                                                               <img src=\"Sensorhub3.jpg\" title=\"Sensorhub3.jpg\" width=\"320\" alt=\"Sensorhub3.jpg\" \/>\n                                                                                                                                                                               <figcaption aria-hidden=\"true\">Sensorhub3.jpg<\/figcaption>\n                                                                                                                                                                               <\/figure>                                                                             |",
                "char_count": 853,
                "token_estimate": 214
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 13,
                "content": "|                                                                                      |                                                                                      |                                                                                      |\n|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Sensorhub4.jpg\" title=\"Sensorhub4.jpg\" width=\"320\" alt=\"Sensorhub4.jpg\" \/>\n <figcaption aria-hidden=\"true\">Sensorhub4.jpg<\/figcaption>\n <\/figure>                                                                             | <figure>\n                                                                                        <img src=\"Sensorhub5.jpg\" title=\"Sensorhub5.jpg\" width=\"320\" alt=\"Sensorhub5.jpg\" \/>\n                                                                                        <figcaption aria-hidden=\"true\">Sensorhub5.jpg<\/figcaption>",
                "char_count": 1100,
                "token_estimate": 275
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 14,
                "content": "<\/figure>                                                                             | <figure>\n                                                                                                                                                                               <img src=\"Sensorhub6.jpg\" title=\"Sensorhub6.jpg\" width=\"320\" alt=\"Sensorhub6.jpg\" \/>\n                                                                                                                                                                               <figcaption aria-hidden=\"true\">Sensorhub6.jpg<\/figcaption>\n                                                                                                                                                                               <\/figure>                                                                             |",
                "char_count": 853,
                "token_estimate": 214
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 15,
                "content": "|                                                                                      |                                                                                      |                                                                                      |\n|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Sensorhub7.jpg\" title=\"Sensorhub7.jpg\" width=\"320\" alt=\"Sensorhub7.jpg\" \/>\n <figcaption aria-hidden=\"true\">Sensorhub7.jpg<\/figcaption>\n <\/figure>                                                                             | <figure>\n                                                                                        <img src=\"Sensorhub8.jpg\" title=\"Sensorhub8.jpg\" width=\"320\" alt=\"Sensorhub8.jpg\" \/>\n                                                                                        <figcaption aria-hidden=\"true\">Sensorhub8.jpg<\/figcaption>",
                "char_count": 1100,
                "token_estimate": 275
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Gallery > DockerPi Sensor Hub Development Board V1.0",
                "chunk_index": 16,
                "content": "<\/figure>                                                                             | <figure>\n                                                                                                                                                                               <img src=\"Sensorhub9.jpg\" title=\"Sensorhub9.jpg\" width=\"320\" alt=\"Sensorhub9.jpg\" \/>\n                                                                                                                                                                               <figcaption aria-hidden=\"true\">Sensorhub9.jpg<\/figcaption>\n                                                                                                                                                                               <\/figure>                                                                             |",
                "char_count": 853,
                "token_estimate": 214
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Mechanical Drawings",
                "chunk_index": 17,
                "content": "<img src=\"Mechanical_sensorhub0.png\" title=\"Mechanical_sensorhub0.png\" width=\"600\" alt=\"Mechanical_sensorhub0.png\" \/>",
                "char_count": 117,
                "token_estimate": 30
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Register Map",
                "chunk_index": 18,
                "content": "**All registers are Read Only**.\n\n**Device Addr:0x17**.",
                "char_count": 55,
                "token_estimate": 14
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Register Map",
                "chunk_index": 19,
                "content": "| Register Address | Function              | Value                                    |\n|------------------|-----------------------|------------------------------------------|\n| 0x01             | TEMP_REG              | Ext. Temperature \\[Unit:degC\\]           |\n| 0x02             | LIGHT_REG_L           | Light Brightness Low 8 Bit \\[Unit:Lux\\]  |\n| 0x03             | LIGHT_REG_H           | Light Brightness High 8 Bit \\[Unit:Lux\\] |\n| 0x04             | STATUS_REG            | Status Function                          |\n| 0x05             | ON_BOARD_TEMP_REG     | OnBoard Temperature \\[Unit:degC\\]        |\n| 0x06             | ON_BOARD_HUMIDITY_REG | OnBoard Humidity \\[Uinit:%\\]             |\n| 0x07             | ON_BOARD_SENSOR_ERROR | 0(OK) - 1(Error)                         |\n| 0x08             | BMP280_TEMP_REG       | P. Temperature \\[Unit:degC\\]             |\n| 0x09             | BMP280_PRESSURE_REG_L | P. Pressure Low 8 Bit \\[Unit:Pa\\]        |\n| 0x0A             | BMP280_PRESSURE_REG_M | P. Pressure Mid 8 Bit \\[Unit:Pa\\]        |\n| 0x0B             | BMP280_PRESSURE_REG_H | P. Pressure High 8 Bit \\[Unit:Pa\\]       |",
                "char_count": 1143,
                "token_estimate": 286
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Register Map",
                "chunk_index": 20,
                "content": "| 0x0C             | BMP280_STATUS         | 0(OK) - 1(Error)                         |\n| 0x0D             | HUMAN_DETECT          | 0(No Active Body) - 1(Active Body)       |",
                "char_count": 175,
                "token_estimate": 44
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Register Map",
                "chunk_index": 21,
                "content": "| STATUS_REG    | 0x04     |\n|---------------|----------|\n| Default Value | 0        |\n| Description   | Reserved |\n\n-   T_OVR(Read Only)\n\n1.  Read 1 means Ext. Temperature Overflow.\n2.  Read 0 means Ext. Temperature works well.\n\n-   T_FAIL(Read Only)\n\n1.  Read 1 means Ext. Temperature Not Found.\n2.  Read 0 means Ext. Temperature works well.\n\n-   L_OVR(Read Only)\n\n1.  Read 1 means Light Brightness Overflow.\n2.  Read 0 means Light Brightness works well.\n\n-   T_FAIL(Read Only)\n\n1.  Read 1 means Light Brightness Not Found.\n2.  Read 0 means Light Brightness works well.",
                "char_count": 571,
                "token_estimate": 143
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Configuring I2C(Raspberry Pi)",
                "chunk_index": 22,
                "content": "Run sudo raspi-config and follow the prompts to install i2c support for the ARM core and linux kernel\nGo to **Interfacing Options** <img src=\"Raspi-config-1.png\" title=\"Raspi-config-1.png\" width=\"320\" alt=\"Raspi-config-1.png\" \/> then **I2C** <img src=\"Raspi-config-2.png\" title=\"Raspi-config-2.png\" width=\"320\" alt=\"Raspi-config-2.png\" \/> Enable! <img src=\"Raspi-config-3.png\" title=\"Raspi-config-3.png\" width=\"320\" alt=\"Raspi-config-3.png\" \/> Done! <img src=\"Raspi-config-4.png\" title=\"Raspi-config-4.png\" width=\"320\" alt=\"Raspi-config-4.png\" \/>",
                "char_count": 546,
                "token_estimate": 137
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language C(Raspberry Pi)",
                "chunk_index": 23,
                "content": "-   Create source code and name it \"sensor.c\"\n\n<!-- -->\n\n#include <stdio.h>\n    #include <stdint.h>\n    #include <wiringPi.h>\n    #include <wiringPiI2C.h>\n\n#define TEMP_REG 0x01\n    #define LIGHT_REG_L 0x02\n    #define LIGHT_REG_H 0x03\n    #define STATUS_REG 0x04\n    #define ON_BOARD_TEMP_REG 0x05\n    #define ON_BOARD_HUMIDITY_REG 0x06\n    #define ON_BOARD_SENSOR_ERROR 0x07\n    #define BMP280_TEMP_REG 0x08\n    #define BMP280_PRESSURE_REG_L 0x09\n    #define BMP280_PRESSURE_REG_M 0x0A\n    #define BMP280_PRESSURE_REG_H 0x0B\n    #define BMP280_STATUS 0x0C\n    #define HUMAN_DETECT 0x0D\n\nuint8_t aReceiveBuf[0x0D + 1];\n\nint main(void)\n    {\n\nint fd;\n        int i = 0;\n        fd = wiringPiI2CSetup(0x17);\n\nif (fd < 0)\n            printf(\"Extend board Can not be initialized, please enable I2C and try again!\\n\", fd);\n\nfor (i = TEMP_REG; i <= HUMAN_DETECT; i++)\n        {\n            aReceiveBuf[i] = wiringPiI2CReadReg8(fd, i);\n        }",
                "char_count": 939,
                "token_estimate": 235
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language C(Raspberry Pi)",
                "chunk_index": 24,
                "content": "if (aReceiveBuf[STATUS_REG] & 0x01)\n        {\n            printf(\"Off-chip temperature sensor overrange!\\n\");\n        }\n        else if (aReceiveBuf[STATUS_REG] & 0x02)\n        {\n            printf(\"No external temperature sensor!\\n\");\n        }\n        else\n        {\n            printf(\"Current external Sensor Temperature = %d Celsius\\n\", (int)aReceiveBuf[TEMP_REG]);\n        }\n\nif (aReceiveBuf[STATUS_REG] & 0x04)\n        {\n            printf(\"Onboard brightness sensor overrange!\\n\");\n        }\n        else if (aReceiveBuf[STATUS_REG] & 0x08)\n        {\n            printf(\"Onboard brightness sensor failure!\\n\");\n        }\n        else\n        {\n            printf(\"Current onboard sensor brightness = %d Lux\\n\", (int)(aReceiveBuf[LIGHT_REG_H] << 8) | (aReceiveBuf[LIGHT_REG_L]));\n        }\n\nprintf(\"Current onboard sensor temperature = %d Celsius\\n\", (int)aReceiveBuf[ON_BOARD_TEMP_REG]);\n        printf(\"Current onboard sensor humidity = %d %%\\n\", (int)aReceiveBuf[ON_BOARD_HUMIDITY_REG]);\n        if (aReceiveBuf[ON_BOARD_SENSOR_ERROR] != 0)\n        {\n            printf(\"Onboard temperature and humidity sensor data may not be up to date!\\n\");\n        }",
                "char_count": 1163,
                "token_estimate": 291
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language C(Raspberry Pi)",
                "chunk_index": 25,
                "content": "if (aReceiveBuf[BMP280_STATUS] == 0)\n        {\n\nprintf(\"Current barometer temperature = %d Celsius\\n\", (int)aReceiveBuf[BMP280_TEMP_REG]);\n            printf(\"Current barometer pressure = %d Pascal\\n\", (int)aReceiveBuf[BMP280_PRESSURE_REG_L] | (int)aReceiveBuf[BMP280_PRESSURE_REG_M] << 8 | (int)aReceiveBuf[BMP280_PRESSURE_REG_H] << 16);\n        }\n        else\n        {\n            printf(\"Onboard barometer works abnormally!\\n\");\n        }\n\nif (aReceiveBuf[HUMAN_DETECT] == 1)\n        {\n            printf(\"Live body detected within 5 seconds!\\n\");\n        }\n        else\n        {\n            printf(\"No humans detecte!\\n\");\n        }\n\nreturn 0;\n    }\n\nCompile!\n\n`gcc sensor.c -lwiringPi -o sensor`\nExec It!\n\n`.\/sensor`",
                "char_count": 723,
                "token_estimate": 181
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Python(Raspberry Pi)",
                "chunk_index": 26,
                "content": "The following code is recommended to be executed using Python 3 and install the **smbus** library:\n\nimport smbus\n\nDEVICE_BUS = 1\n    DEVICE_ADDR = 0x17\n\nTEMP_REG = 0x01\n    LIGHT_REG_L = 0x02\n    LIGHT_REG_H = 0x03\n    STATUS_REG = 0x04\n    ON_BOARD_TEMP_REG = 0x05\n    ON_BOARD_HUMIDITY_REG = 0x06\n    ON_BOARD_SENSOR_ERROR = 0x07\n    BMP280_TEMP_REG = 0x08\n    BMP280_PRESSURE_REG_L = 0x09\n    BMP280_PRESSURE_REG_M = 0x0A\n    BMP280_PRESSURE_REG_H = 0x0B\n    BMP280_STATUS = 0x0C\n    HUMAN_DETECT = 0x0D\n\nbus = smbus.SMBus(DEVICE_BUS)\n\naReceiveBuf = []\n\naReceiveBuf.append(0x00) # 占位符\n\nfor i in range(TEMP_REG,HUMAN_DETECT + 1):\n        aReceiveBuf.append(bus.read_byte_data(DEVICE_ADDR, i))\n\nif aReceiveBuf[STATUS_REG] & 0x01 :\n        print(\"Off-chip temperature sensor overrange!\")\n    elif aReceiveBuf[STATUS_REG] & 0x02 :\n        print(\"No external temperature sensor!\")\n    else :\n        print(\"Current off-chip sensor temperature = %d Celsius\" % aReceiveBuf[TEMP_REG])",
                "char_count": 979,
                "token_estimate": 249
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Python(Raspberry Pi)",
                "chunk_index": 27,
                "content": "if aReceiveBuf[STATUS_REG] & 0x04 :\n        print(\"Onboard brightness sensor overrange!\")\n    elif aReceiveBuf[STATUS_REG] & 0x08 :\n        print(\"Onboard brightness sensor failure!\")\n    else :\n        print(\"Current onboard sensor brightness = %d Lux\" % (aReceiveBuf[LIGHT_REG_H] << 8 | aReceiveBuf[LIGHT_REG_L]))\n\nprint(\"Current onboard sensor temperature = %d Celsius\" % aReceiveBuf[ON_BOARD_TEMP_REG])\n    print(\"Current onboard sensor humidity = %d %%\" % aReceiveBuf[ON_BOARD_HUMIDITY_REG])\n\nif aReceiveBuf[ON_BOARD_SENSOR_ERROR] != 0 :\n        print(\"Onboard temperature and humidity sensor data may not be up to date!\")\n\nif aReceiveBuf[BMP280_STATUS] == 0 :\n        print(\"Current barometer temperature = %d Celsius\" % aReceiveBuf[BMP280_TEMP_REG])\n        print(\"Current barometer pressure = %d pascal\" % (aReceiveBuf[BMP280_PRESSURE_REG_L] | aReceiveBuf[BMP280_PRESSURE_REG_M] << 8 | aReceiveBuf[BMP280_PRESSURE_REG_H] << 16))\n    else :\n        print(\"Onboard barometer works abnormally!\")\n\nif aReceiveBuf[HUMAN_DETECT] == 1 :\n        print(\"Live body detected within 5 seconds!\")\n    else:\n        print(\"No humans detected!\")",
                "char_count": 1138,
                "token_estimate": 285
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Java(Raspberry Pi)",
                "chunk_index": 28,
                "content": "Creat a new file named :SensorHub.java and paste following codes:\n\nimport java.io.IOException;\n    import java.util.Arrays;\n\nimport com.pi4j.io.i2c.I2CBus;\n    import com.pi4j.io.i2c.I2CDevice;\n    import com.pi4j.io.i2c.I2CFactory;\n    import com.pi4j.io.i2c.I2CFactory.UnsupportedBusNumberException;\n    import com.pi4j.platform.PlatformAlreadyAssignedException;\n    import com.pi4j.util.Console;\n\npublic class SensorHub {\n\n\/\/SensorHub Address\n        public static final int DOCKERPI_SENSORHUB_BOARD = 0x17;",
                "char_count": 510,
                "token_estimate": 128
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Java(Raspberry Pi)",
                "chunk_index": 29,
                "content": "\/\/SensorHub's functions\n        public static final byte TEMP_REG = (byte) 0x01;\n        public static final byte LIGHT_REG_L = (byte) 0x02;\n        public static final byte LIGHT_REG_H = (byte) 0x03;\n        public static final byte STATUS_REG = (byte) 0x04;\n        public static final byte ON_BOARD_TEMP_REG = (byte) 0x05;\n        public static final byte ON_BOARD_HUMIDITY_REG = (byte) 0x06;\n        public static final byte ON_BOARD_SENSOR_ERROR = (byte) 0x07;\n        public static final byte BMP280_TEMP_REG = (byte) 0x08;\n        public static final byte BMP280_PRESSURE_REG_L = (byte) 0x09;\n        public static final byte BMP280_PRESSURE_REG_M = (byte) 0x0A;\n        public static final byte BMP280_PRESSURE_REG_H = (byte) 0X0B;\n        public static final byte BMP280_STATUS = (byte) 0x0C;\n        public static final byte HUMAN_DETECT = (byte) 0x0D;\n\npublic static void main(String[] args)\n                throws InterruptedException, PlatformAlreadyAssignedException, IOException, UnsupportedBusNumberException {\n\nfinal Console console = new Console();\n\nI2CBus i2c = I2CFactory.getInstance(I2CBus.BUS_1);\n                    I2CDevice device = i2c.getDevice(DOCKERPI_SENSORHUB_BOARD);",
                "char_count": 1198,
                "token_estimate": 300
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Java(Raspberry Pi)",
                "chunk_index": 30,
                "content": "int i = 0;\n\nif(device.read(DOCKERPI_SENSORHUB_BOARD) < 0)\n                        console.println(\"External board Can not be initialized, please enable I2C and try again!\",device.read(DOCKERPI_SENSORHUB_BOARD));\n                    else\n                        console.println(\"External board has been initialized\");\n\nif((device.read(STATUS_REG) & 0x01) == 0x01)\n                        console.println(\"off-chip temperature sensor overrange!\");\n                    else if((device.read(STATUS_REG) & 0x02) == 0x02)\n                        console.println(\"No external temperature sensor!\");\n\nelse {\n                        console.println(\"the temp of air is :\" + device.read(TEMP_REG) + \"centigrade\");\n                    }",
                "char_count": 725,
                "token_estimate": 182
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Java(Raspberry Pi)",
                "chunk_index": 31,
                "content": "if((device.read(STATUS_REG) & 0x04) == 0x04) {\n                        console.println(\"Onboard brightness sensor overrange!\");\n                    }\n                    else if((device.read(STATUS_REG) & 0x08) == 0x08) {\n                        console.println(\"Onboard brightness sensor failure!\");\n                    }\n                    else {\n                        console.println(\"Current onboard sensor brightness is :\" + (device.read(LIGHT_REG_L) | device.read(LIGHT_REG_H) << 8) + \"lux\");\n                    }\n\nif(device.read(ON_BOARD_SENSOR_ERROR) == 1)\n                        console.println(\"Onboard temperature and humidity sensor data may not be up to date!\");\n\nconsole.println(\"the temp of sensor on board is :\" + device.read(ON_BOARD_TEMP_REG) + \"centigrade\");\n                    console.println(\"the humidity of sensor is :\" + device.read(ON_BOARD_HUMIDITY_REG) + \"%\");",
                "char_count": 893,
                "token_estimate": 224
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Program in Language Java(Raspberry Pi)",
                "chunk_index": 32,
                "content": "if(device.read(BMP280_STATUS) == 0) {\n                        console.println(\"the temp of air pressure sensor is :\" + device.read(BMP280_TEMP_REG) + \"centigrade\");\n                        console.println(\"the air pressure is :\" + (device.read(BMP280_PRESSURE_REG_L) | device.read(BMP280_PRESSURE_REG_M) << 8 | device.read(BMP280_PRESSURE_REG_H) << 16) + \"pa\");\n                    }\n                    else\n                        console.println(\"Onboard barometer works abnormally!\");\n\nif(device.read(HUMAN_DETECT) == 1) {\n                        console.println(\"Live body detected within 5 seconds!\");\n                    }\n                    else {\n                        console.println(\"No humans detecte!\");\n                    }\n                }\n\n}\n\n-   Compile it and running :\n\n<!-- -->\n\njavac SensorHub.java -classpath .:classes:\/opt\/pi4j\/lib\/'*'\n\nsudo java -classpath .:classes:\/opt\/pi4j\/lib\/'*' SensorHub",
                "char_count": 923,
                "token_estimate": 231
            },
            {
                "title": "EP-0106",
                "rev_id": 10666,
                "heading_path": "Keywords",
                "chunk_index": 33,
                "content": "SensorHub， Docker pi, humidity, temperature, airpressure, NTC, pir sensor, DHT11, DHT12, light sensor.",
                "char_count": 102,
                "token_estimate": 26
            }
        ]
    }
}