Micro-channel (XI) using a debugging aid device ID and application filing process

The following process simulation of a device from a micro-channel application hardware product IP, this ID is filing into effect, check their bindings owner, the owner to send a message to the binding of a series of http request process.

Obtaining a micro-channel key

Following the success of the public need access to a computer IP number of the device whitelist computer skills. (Public numbers - Developer options)

Normal should be your own server (IP whitelist) request to write a script every two hours to micro-channel server once stored on their servers txt inside, and then we went to a unified txt (database also OK) take to avoid repeating multiple devices resulting in failure to apply and use key to exhaustion.

 

 

 

https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx4ccfdb6e5d7775fa&secret=010745d29f2179d9dafe2d7798c483c7  

 

2 acquires a new device ID assigned

 

 

 

https://api.weixin.qq.com/device/getqrcode?access_token=25_vLLTmbfSZjMoZAS94915GYrUddEUbRjVJzBGXZDPqE-HVGL5VU9XjX0V03gHabA5hyutrlj2UInLL2Kyg52HxWwggjPEeLbC81hq_KDIkckO7nh1w0e_Wpb04jwQRWiAFABCH&product_id=52715

Step 2 device which generates a two-dimensional code ID and the URL of the device, the device ID used when each product ID, two-dimensional code has links to enable a user to generate a two-dimensional code numbered scan public binding apparatus.

But the device has not been registered and filing, temporarily not use, need to go through three steps before they can use.

 

3 Device Registration and authorization

 

 

https://api.weixin.qq.com/device/authorize_device?access_token=25_vLLTmbfSZjMoZAS94915GYrUddEUbRjVJzBGXZDPqE-HVGL5VU9XjX0V03gHabA5hyutrlj2UInLL2Kyg52HxWwggjPEeLbC81hq_KDIkckO7nh1w0e_Wpb04jwQRWiAFABCH

  

{
    "device_num": "1",
    "device_list": [
        {
            "id": "gh_e93c1b3098b9_cc9b2685cee91b87",
            "mac": "28-D2-44-5B-AB-35",
            "connect_protocol": "4",
            "auth_key": "",
            "close_strategy": "1",
            "conn_strategy": "1",
            "crypt_method": "0",
            "auth_ver": "0",
            "manu_mac_pos": "-1",
            "ser_mac_pos": "-2",
            "ble_simple_protocol": "0"
        }
    ],
    "op_type": "0",
    "product_id": "52715"
}

  received

 

 

 

{
    "resp": [
        {
            "base_info": {
                "device_type": "gh_e93c1b3098b9",
                "device_id": "gh_e93c1b3098b9_cc9b2685cee91b87"
            },
            "errcode": 100008,
            "errmsg": "mac invalid"
        }
    ]
}

  

Step 2 back to the inside, a two-dimensional micro-letter code returns a device ID and the URL of the device, when the product ID for each device ID, two-dimensional code has links to enable a user to generate a two-dimensional code numbered scan public binding apparatus.

 "deviceid": "gh_e93c1b3098b9_cc9b2685cee91b87",
 "qrticket":"http://we.qq.com/d/AQCCdUjol1e2RkGSXWepv_1QFWq9HJabtaerktSK"

3-1 hardware devices. This device type and device ID attached ESP8266 (or other chips) code, each device has a unique.

 "device_type": "gh_e93c1b3098b9"
 "device_id": "gh_e93c1b3098b9_cc9b2685cee91b87"

3-2 micro-channel binding device user.

 "qrticket":"http://we.qq.com/d/AQCCdUjol1e2RkGSXWepv_1QFWq9HJabtaerktSK"  

Generating a two-dimensional code inside the forage-dimensional code, the two-dimensional code attached to the apparatus body, for scanning micro-channel users.

 

 After seeing the public micro-channel number - My equipment - one more device

 

 

4 micro-channel master query the device binding (can be more than one person)

 

 

 

 

https://api.weixin.qq.com/device/get_openid?access_token=19_qLywZOTSRQsE3NhNthVSL-MCFtpgC26QZZlard0yjaXAxW3G3TtNCnoTneMQrQtK-CcpjsruX084iVuLFBsuVRmJJgYKCSlJhcASOH5To_dHPe7jPj30HpGBIif22Pn3be77Hu8Z56KVs8LTOREbAIAYB1&device_type=gh_e93c1b3098b9&device_id=gh_e93c1b3098b9_dae1c2072212185c

  

5 to the user a message

 

 

 

https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=19_uIzAk_rDxS4CLZoAk5016hvXmrjGw-jnH3zPQnZwnZhcw_H7PpfQvWl2KX4vZtl5ykxCJKiRk5ED-rSZs88g-cvq2qkHFKEwSh8ga_phKkg8VNfJbf_u8oB2R7cGhksmBUXpukZ6UhyM729BWXYhAIAPQR

  

  {
  	
  	
    "touser":"ognVI6GpDeseo6Qe_S7hGPgwlt8E",
    "msgtype":"text",
    "text":
    {
         "content":"文本内容<a href=http://www.qq.com >!",
    }
    
    
}

  

Guess you like

Origin www.cnblogs.com/kekeoutlook/p/11479308.html