Running into another issue with the AT commands in Python. Following the Quectel steps for setting up MQTT communication with SSL cert-based authentication, I am running into an issue and getting an error. Here is my code:
from cellulariot import cellulariot
import time
node = cellulariot.CellularIoTApp() # for Sixfab CellularIoT App. Shield
node.USER_BUTTON = 22 # default was 24
node.BG96_POWERKEY = 5 # default was 11
node.setupGPIO()
if node.getModemStatus() == 1:
node.enable()
node.powerUp()
node.sendATComm("ATE1", "OK\r\n")
node.setCATM1Band(node.LTE_CATM1_ANY)
node.getBandConfiguration()
node.setMode(node.CATM1_MODE)
node.connectToOperator()
node.sendATComm("AT+QMTCFG=\"SSL\",0,1,2", "OK\r\n")
f = open("/home/pi/amznca1.pem", "r")
node.sendATComm("AT+QFUPL=\"amznca1.pem\",1186,100", "CONNECT\r\n")
node.sendATComm(f.read(), "OK\r\n")
f.close()
f = open("/home/pi/cert.pem", "r")
node.sendATComm("AT+QFUPL=\"cert.pem\",1224,100", "CONNECT\r\n")
node.sendATComm(f.read(), "OK\r\n")
f.close()
f = open("/home/pi/private.pem", "r")
node.sendATComm("AT+QFUPL=\"private.pem\",1675,100", "CONNECT\r\n")
node.sendATComm(f.read(), "OK\r\n")
f.close()
node.sendATComm("AT+QSSLCFG=\"cacert\",2,\"amznca1.pem\"", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"clientcert\",2,\"cert.pem\"", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"clientkey\",2,\"private.pem\"", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"seclevel\",2,2", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"sslversion\",2,4", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"ciphersuite\",2,0xFFFF", "OK\r\n")
node.sendATComm("AT+QSSLCFG=\"ignorelocaltime\",1", "OK\r\n")
node.sendATComm("AT+QMTOPEN=0,\"xxxxxxxxxxxxx-ats.iot.us-east-1.amazonaws.com\",8883", "OK\r\n")
node.sendATComm("AT+QMTCONN=0,\"SomeIoTDevice\"", "\r\n")
This is where I get an error:
AT+QMTCONN=0,"SomeIoTDevice"
ERROR
'AT+QMTCONN=0,"SomeIoTDevice"\r\r\nERROR\r\n'
I am guessing some syntax error, as I have been getting a lot at every step. Any ideas?
Thanks.