Traceback (most recent call last):
File “”, line 37, in
File “”, line 24, in https_test
OSError: [Errno 7111] ECONNREFUSED
I’ve tested different file paths (relative “cert/aws.key” vs absolute “/flash/cert/aws.key”) without success. Uploading the key file through XCTU (securely as well as insecurely) didn’t change the error message received. The three files (aws.key, aws.crt, aws.ca) are the exact same ones that work successfully in Python3 using a Juypter Notebook.
The AWS IoT policy attached to the certificate is the most permissive.
I have the same issue. I’m getting a slightly different error.
Traceback (most recent call last):
File “”, line 48, in
File “”, line 36, in https_test
OSError: [Errno 7005] EIO
Correct. You have to remove the -ats from the account name in the endpoint url. You also have to make sure that you use the legacy PEM from Symantec. I’ve been using it like this for about a month now. Make sure that if the device restarts, that you set up the profiles again for the socket. You don’t have to reimport the certs if you don’t want to.
I have a XBee 3 cellular (LTE-M) and I am having this exact problem. The XBee device was running fine and sending data to AWS using the downloaded Amazon Root CA1 and other certificate files for the past week. Today I have suddenly started getting the OSError: [Errno 7111] ECONNREFUSED on MQTT connect. I have tried creating a new thing and downloading new certificates but I am still having the same issue. Does anyone know if there is a quota or other AWS setting that could cause this to suddenly be an issue?
Thanks for the replies. I have found that if I swap SIM cards I can get a successful connection for a while but the problem seems to just come back after a while. I have another device that is consistently writing to our endpoint with without issue. How do you send a " ATSD1 command". I can not find any documentation on it.
After more testing, I have found If I swap sim cards my Xbee3 I can connect and continuously write to AWS. If I then restart the device my connections are then refused [Errno 7111] ECONNREFUSED. Using the shutdown command before restarting does not appear to fix this issue. I have observed this behavior with two different Xbee device that set up as different AWS “Things”. I am using Hologram sim cards.
This is sounding like you may have a socket that is stuck open on the server or within the carrier. Are you using the Close socket functions at all? If not, you should.
Which radio is this on? What firmware version are you running?
What are you placing in for the APN? Is it the APN that the carrier desires or is it the default connection APN?
I am using firmware 1161C on XCB Global LTE-M radio. I am using a hologram card my APN is “hologram”. It is connecting to a T-Moble network. I am able to establish a cell connection fine.
Is there a setting or something else that is reset when a new sim card is used vs just shutting down the radio and restarting the device?
To test the connection I am using the basic umqtt.simple library.
It sounds like you’ve taken the correct steps, but the ECONNREFUSED error usually means the connection to the server is being refused. Please double-check that the AWS IoT endpoint hostname is correct and includes -ats, verify the file paths in your MicroPython code, and ensure the Digi XBee has internet access. Confirm that the AWS IoT policy allows iot:Connect, iot:Publish, iot:Subscribe, and iot:Receive, and that the port used (usually 8883 for MQTT over TLS) is correct. Also, ensure there are no firewall rules blocking the connection. If the issue persists, enabling detailed logging on the AWS IoT side may provide more insights.