求助小爱同学&树莓派控制电脑开机报错-Arduino中文社区 - Powered by Discuz! Archiver

小明没吃饱 发表于 2021-10-1 21:51

求助小爱同学&树莓派控制电脑开机报错

root@raspberrypi:/opt# python3 p.py
url: https://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=4850f4648643&miType=outlet
Device Auth Data: {'detail': {'broker': 'blinker', 'deviceName': 'E452B9DAIS9M8OL98BS414LK', 'host': 'mqtts://broker.diandeng.tech', 'iotId': '7ScKMZn8qCrTR4eGBCtBt6ooF4', 'iotToken': 'QykAMBvY4gaCm3Red6AKAURQGqtcmnJE', 'port': '1884', 'productKey': 'blinker', 'uuid': 'fc2be11d22af11ec8df55254'}, 'message': 1000}
deviceName: E452B9DAIS9M8OL98BS414LK
iotId: 7ScKMZn8qCrTR4eGBCtBt6ooF4
iotToken: QykAMBvY4gaCm3Red6AKAURQGqtcmnJE
productKey: blinker
uuid: fc2be11d22af11ec8df55254
broker: blinker
clientID:
userName:
password: QykAMBvY4gaCm3Red6AKAURQGqtcmnJE
subtopic:
pubtopic:
Traceback (most recent call last):
File "p.py", line 21, in <module>
    Blinker.begin(auth)
File "/usr/local/lib/python3.7/dist-packages/Blinker-0.2.0-py3.7.egg/Blinker/Blinker.py", line 171, in begin
    bProto.conn1.start(auth, bProto.aliType, bProto.duerType, bProto.miType)
File "/usr/local/lib/python3.7/dist-packages/Blinker-0.2.0-py3.7.egg/BlinkerAdapters/BlinkerMQTT.py", line 328, in start
    self.client.connect(self.bmqtt.host, self.bmqtt.port, 60)
File "/usr/local/lib/python3.7/dist-packages/paho_mqtt-1.5.1-py3.7.egg/paho/mqtt/client.py", line 940, in connect
    bind_address, bind_port, clean_start, properties)
File "/usr/local/lib/python3.7/dist-packages/paho_mqtt-1.5.1-py3.7.egg/paho/mqtt/client.py", line 1005, in connect_async
    raise ValueError('Invalid host.')
ValueError: Invalid host.


小明没吃饱 发表于 2021-10-1 21:53

各位大佬我的是树莓派4b 系统内核版本是5.10.17-v8+,我的python运行环境是不是有问题

topdog 发表于 2021-10-2 00:02

1,看一下python安装在哪里?
where python
2,安装或者内联一下python3.7
sudo apt-get install python3.7
sudo ln -s /usr/bin/python3.7 /usr/bin/python

小明没吃饱 发表于 2021-10-2 00:20

topdog 发表于 2021-10-2 00:02
1,看一下python安装在哪里?
where python
2,安装或者内联一下python3.7


python安装没有问题
root@raspberrypi:/opt# whereis python
python: /usr/bin/python /usr/bin/python3.7-config /usr/bin/python3.7 /usr/bin/python3.7m-config /usr/bin/python3.7m /usr/bin/python2.7 /usr/bin/python2.7-config /usr/lib/python3.7 /usr/lib/python2.7 /etc/python /etc/python3.7 /etc/python2.7 /usr/local/lib/python3.7 /usr/local/lib/python2.7 /usr/include/python3.7 /usr/include/python3.7m /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz

小明没吃饱 发表于 2021-10-2 00:21

小明没吃饱 发表于 2021-10-2 00:20
python安装没有问题
root@raspberrypi:/opt# whereis python
python: /usr/bin/python /usr/bin/python3. ...

root@raspberrypi:/opt# python --version
Python 3.7.3
页: [1]
查看完整版本: 求助小爱同学&树莓派控制电脑开机报错