Aws IoT seems to require python3, but 2.7 won't leave
-
I am having connection issues trying to get aws iot started on my 2+. From what I am finding on the errors, it seems to be an issue with python 2.7. How do I get just python3 installed? I thought I had uninstalled 2.7, but it is still here/back. Unless ignoring the installation of 2.7, and just doing an alias python=python3 is the right call (but where since we don't have bash.rc)?
-
Could you be more specific? What and how are you trying to start? Is it a python script? It so, look at its header line (
#!/
like ) and change it to#!/usr/bin/env python3
or#!/usr/bin/python3
- check paths if they are correct for Omega2+.
-
Starting to think it might be an aws iot code issue. This is trying to set up a new device, and using their setup script. It at least starts to work, because on the aws monitor dashboard I see connections. This is the output it gives. I am posting this on their sdk issues too https://github.com/aws/aws-iot-device-sdk-python/issues/85
root@Omega-3199:~# ./start.sh
Running pub/sub sample application...
2017-11-01 05:13:53,808 - AWSIoTPythonSDK.core.protocol.internal.clients - DEBUG - Initializing MQTT layer...
2017-11-01 05:13:53,817 - AWSIoTPythonSDK.core.protocol.internal.clients - DEBUG - Registering internal event callbacks to MQTT layer...
2017-11-01 05:13:53,822 - AWSIoTPythonSDK.core.protocol.internal.workers - DEBUG - Event consuming thread started
2017-11-01 05:13:53,825 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - MqttCore initialized
2017-11-01 05:13:53,828 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Client id: basicPubSub
2017-11-01 05:13:53,832 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Protocol version: MQTTv3.1.1
2017-11-01 05:13:53,834 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Authentication type: TLSv1.2 certificate based Mutual Auth.
2017-11-01 05:13:53,838 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring endpoint...
2017-11-01 05:13:53,842 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring certificates...
2017-11-01 05:13:53,845 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring reconnect back off timing...
2017-11-01 05:13:53,848 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Base quiet time: 1.000000 sec
2017-11-01 05:13:53,852 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Max quiet time: 32.000000 sec
2017-11-01 05:13:53,855 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Stable connection time: 20.000000 sec
2017-11-01 05:13:53,859 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring offline requests queueing: max queue size: -1
2017-11-01 05:13:53,864 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring offline requests queue draining interval: 0.500000 sec
2017-11-01 05:13:53,869 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring connect/disconnect time out: 10.000000 sec
2017-11-01 05:13:53,873 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Configuring MQTT operation time out: 5.000000 sec
2017-11-01 05:13:53,876 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Performing sync connect...
2017-11-01 05:13:53,879 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Performing async connect...
2017-11-01 05:13:53,883 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Keep-alive: 30.000000 sec
2017-11-01 05:13:53,886 - AWSIoTPythonSDK.core.protocol.mqtt_core - DEBUG - Passing in general notification callbacks to internal client...
2017-11-01 05:13:53,890 - AWSIoTPythonSDK.core.protocol.internal.clients - DEBUG - Filling in fixed event callbacks: CONNACK, DISCONNECT, MESSAGE
Traceback (most recent call last):
File "aws-iot-device-sdk-python/samples/basicPubSub/basicPubSub.py", line 89, in <module>
myAWSIoTMQTTClient.connect()
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/MQTTLib.py", line 408, in connect
return self._mqtt_core.connect(keepAliveIntervalSecond)
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 168, in connect
self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event))
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 179, in connect_async
rc = self._internal_async_client.connect(keep_alive_sec, ack_callback)
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 113, in connect
rc = self._paho_client.connect(host, port, keep_alive_sec)
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 654, in connect
return self.reconnect()
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 797, in reconnect
ciphers=self._tls_ciphers)
File "/usr/lib/python2.7/ssl.py", line 943, in wrap_socket
ciphers=ciphers)
File "/usr/lib/python2.7/ssl.py", line 552, in init
self._context.load_verify_locations(ca_certs)
ssl.SSLError: unknown error (_ssl.c:2947)
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/lib/python2.7/site-packages/AWSIoTPythonSDK/core/protocol/internal/workers.py", line 137, in _dispatch
File "/usr/lib/python2.7/threading.py", line 289, in exit
File "/usr/lib/python2.7/threading.py", line 216, in exit
File "/usr/lib/python2.7/threading.py", line 203, in release
<type 'exceptions.TypeError'>: 'NoneType' object is not callable