Connecting to AWS IoT

Hi,

Just received my Pico LTE board this week. Trying to get it to connect w/AWS IoT. Thonny is installed, the certs/keys have been loaded in to the ‘cert’ directory on the Pico LTE board, and look to be installed in the Quectel module.

I know these certs are good and I can connect to AWS IoT and pub/sub successfully with those keys/certs using a Raspberry Pi 4. No issues with that, so I expect the same keys/certs to work on the Pico LTE board as well.

However, this is the response when trying to use the mqtt_publish.py code on the Pico LTE…

%Run -c $EDITOR_CONTENT

MPY: soft reboot
INFO: Publishing data to AWS IoT…
INFO: Certificates found in PicoLTE.
INFO: Result {‘status’: 1, ‘response’: ‘Missing parameters : host’, ‘interval’: 0}

Not sure what the missing parameters are. The config.json file should be setup correctly but I have a few questions…

  1. Should the ‘Device Shadow URL’ for the Host Address (that can be copied with one click from AWS IoT) include the https:// and end after ‘…amazonaws.com’ (like the normal Endpoint) or should it include the entire string through /shadow? The Sixfab Pico LTE documentation seems to imply drop the https:// and the string after the amazonaws.com.

  2. In the Sixfab Assets tab for an activated asset, should the Pico LTE show an antenna icon indicating ‘Device is connected to the cellular network’ like my other Sixfab LTE assets? My Pico LTE asset does not show the connected to cellular network icon. I have tried changing the SIM between active and inactive. When active the SIM icon is green. The blue LED on the Pico LTE board is On/Blue intermittently flashing Off, which I believe means it’s Idle.

Thanks for the help.

JT

Update on debugging this issue. I added the ‘debug.set_level(0)’ to get any/all debug info. Looks like the failure is happening with opening the MQTT connection.

Reviewing the Quectel AWS MQTT documentation for the BG96 shows the following which implies that command should drop the https:// for the host address URL. But that doesn’t work either for the ‘mqtt_publish.py’.

Still unclear what host parameters are missing :confused:

JT

//Start MQTT SSL connection
AT+QMTOPEN=0,“a2sgasbshsff52-ats.iot.us-west-2.amazonaws.com”,8883

MPY: soft reboot
DEBUG: Power status: 0
DEBUG: Power status: 0
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: COM: {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
INFO: Publishing data to AWS IoT…
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: is_connected_to_broker : {‘response’: [‘OK’], ‘status’: 1}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: has_opened_connection : {‘response’: [‘OK’], ‘status’: 1}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: deactivate_pdp_context : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\n+QFLST: “/security/cacert.pem”,1187\r\n+QFLST: “/security/client.pem”,1220\r\n+QFLST: “/security/user_key.pem”,1679\r\n\r\nOK\r\n’]
DEBUG: Processed: [‘+QFLST: “/security/cacert.pem”,1187’, ‘+QFLST: “/security/client.pem”,1220’, ‘+QFLST: “/security/user_key.pem”,1679’, ‘OK’]
INFO: Certificates found in PicoLTE.
DEBUG: load_certificates : {‘response’: ‘Certificates found in PicoLTE.’, ‘status’: 0}
DEBUG: Response: [‘\r\n+CREG: 0,5\r\n\r\nOK\r\n’]
DEBUG: Processed: [‘+CREG: 0,5’, ‘OK’]
DEBUG: Desired: +CREG: 0,5
DEBUG: check_network_registration : {‘response’: [‘+CREG: 0,5’, ‘OK’], ‘status’: 0}
DEBUG: success : {‘response’: [‘+CREG: 0,5’, ‘OK’], ‘status’: 0}
DEBUG: register_network : {‘status’: 0, ‘response’: [‘+CREG: 0,5’, ‘OK’], ‘interval’: 0}
DEBUG: Response: [‘\r\n+CGACT: 1,1\r\n\r\nOK\r\n’]
DEBUG: Processed: [‘+CGACT: 1,1’, ‘OK’]
DEBUG: Desired: +CGACT: 1,1
DEBUG: check_pdp_context_status : {‘response’: [‘+CGACT: 1,1’, ‘OK’], ‘status’: 0}
DEBUG: success : {‘response’: [‘+CGACT: 1,1’, ‘OK’], ‘status’: 0}
DEBUG: get_pdp_ready : {‘status’: 0, ‘response’: [‘+CGACT: 1,1’, ‘OK’], ‘interval’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_ca_cert : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_client_cert : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_client_key : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_sec_level : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_version : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_cipher_suite : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_ignore_local_time : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: success : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: configure_for_x509_certification : {‘status’: 0, ‘response’: [‘OK’], ‘interval’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_version_config : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: Response: [‘\r\nOK\r\n’]
DEBUG: Processed: [‘OK’]
DEBUG: set_ssl_mode_config : {‘response’: [‘OK’], ‘status’: 0}
DEBUG: open_connection : {‘response’: ‘Missing parameters : host’, ‘status’: 1}
DEBUG: failure : {‘response’: ‘Missing parameters : host’, ‘status’: 1}
INFO: Result {‘status’: 1, ‘response’: ‘Missing parameters : host’, ‘interval’: 0}

Update today. Seems to be working now, both pub and sub. No changes… :thinking: