Home/Support/Support Forum/aws connect issues using umqtt and XBee LTE-M

aws connect issues using umqtt and XBee LTE-M

0 votes
I have had issues getting MQTT working for AWS even using the Amazon Root CA1 for the ca_certs file.

Have used example aws_https_pc.py to verify connection to AWS (with same key / ca / crt files.)

When using digi example to connect using umqtt.simple, connect() never returns a valid result. Instead, returns:

File "/flash/lib/umqtt/simple.py", line 71, in connect
OSError: [errno 7005] EIO

Thoughts?
asked Nov 26, 2018 in XBee3 Cellular by jmcchristian New to the Community (0 points)
I've received the same type of error as you described and haven't yet found a good solution.  

In the mean time, you could try the desktop Python 3 script below just to verify the CA,Cert and Key are setup correctly.  ( https://www.digi.com/resources/documentation/digidocs/90002219/default.htm#tasks/t_test_connection.htm%3FToc )

### Python 3 certificate test script ###
# AWS IoT Account for this Thing
host = b'ABCDEFG1234567'
region = b'us-east-1'
aws_endpoint = b'%s.iot.%s.amazonaws.com' % (host, region)
 
# This Thing's type and name
thing_type = b'XBee_Cellular'
thing_name = b'IMEI_63890'
 
import socket, ssl
  
s = socket.socket()
w = ssl.wrap_socket(s,
    keyfile='cert/aws.key',
    certfile='cert/aws.crt',
    ca_certs='cert/aws.ca')
w.connect((aws_endpoint, 8443))
w.write(b'GET /things/%s/shadow HTTP/1.0\r\nHost: %s\r\n\r\n' % (thing_name, aws_endpoint))
print(str(w.read(1024), 'utf-8'))
w.close()
##########################################
I'm getting the same thing on the device.
Are you saying that it works with aws_https_pc.py but not on the device? If so, where did you get the aws_https_pc.py file from?
Have you gotten anywhere with trying to connect with the device?
In my experience, the aws_https_pc.py script does work on my desktop computer running python3 but it doesn't work running the micropython script on the device.  

Both the python3 test script and the micropython script were from this link:

https://www.digi.com/resources/documentation/digidocs/90002219/default.htm#tasks/t_test_connection.htm%3FToc

I want to test the AWS certificate authority which may be trusted on my destkop and not on the cell Xbee.  However, I havne't been able to dedicate time to figure it out.

As soon as I achieve a breakthrough, I'll post here.

Please log in or register to answer this question.

1 Answer

0 votes
I'm getting the same issue. I have also tried it with the MQTT publish example. I know the the certificates work because I've tested them with MQTTfx. Please help digi.
answered Dec 20, 2018 by theguy159 New to the Community (3 points)
...