本帖最后由 czweb 于 2018-2-6 02:46 编辑
我用方法三、自定义服务器
1.在windows的 apache 的 cgi-bin 下跑;
2.py文件的第一行已经修改为我的python安装路径,python版本是3.6;
3.apache是配置好三个秘钥ssl的,谷歌浏览器访问绿色的小锁访问正常的https网址;
4.浏览器里单独访问三个py文件可以正常找到;
结果:天猫精灵控制台无法刷出设备列表,看日志错误如下:
[Tue Feb 06 00:09:27.686939 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64118] AH01215: GET /cgi-bin/tmallx1/authorize.py?redirect_uri=https&client_id==https://hass的公网域名:8123&response_type=code&state=0.45\r: D:/xampp/cgi-bin/tmallx1/authorize.py, referer: https://h5.bot.tmall.com/vue/
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: POST /cgi-bin/tmallx1/access.py?\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: client_id=https://hass的公网域名:8123\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: redirect_uri=https://open.bot.tmall.com/oauth/callback\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: client_secret=密码\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: grant_type=authorization_code\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:32.917948 2018] [cgi:error] [pid 5348:tid 1620] [client 127.0.0.1:64120] AH01215: code=4ad21b7fd08b9c91314190ef441e1fba5d6aa449\r: D:/xampp/cgi-bin/tmallx1/access.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: POST /cgi-bin/tmallx1/gate.py?\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: \r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "header": {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "messageId": "902c920c-d886-4905-bc65-4d5569585729",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "name": "DiscoveryDevices",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "namespace": "AliGenie.Iot.Device.Discovery",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "payLoadVersion": 1\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: },\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "payload": {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "accessToken": "https://hass的公网域名:8123?密码"\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: }\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: }\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: HA GET https://hass的公网域名:8123/api/states?api_password=密码\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: D:\\Program Files\\Python3.6.0\\lib\\site-packages\\urllib3\\connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: InsecureRequestWarning)\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: RESPONSE {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "header": {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "messageId": "902c920c-d886-4905-bc65-4d5569585729",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "name": "DiscoveryDevicesResponse",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "namespace": "AliGenie.Iot.Device.Discovery",\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "payLoadVersion": 1\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: },\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "payload": {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "devices": [\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: {\r: D:/xampp/cgi-bin/tmallx1/gate.py
[Tue Feb 06 00:09:40.113962 2018] [cgi:error] [pid 5348:tid 1628] [client 127.0.0.1:64123] AH01215: "deviceId": "switch.pc2",\r: D:/xampp/cgi-bin/tmallx1/gate.py
|