adafruit / adafruit/Adafruit_CircuitPython_MiniMQTT

_wait_for_msg raises empty MMQTTException when using iotcentral_device to connect to IoT Central

Open
#173 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
81
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Following the readme & examples of connecting to IoT Central found [here](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT) I can't seem to connect successfully due to __wait_for_msg_ failing.

`Traceback (most recent call last):
File "code.py", line 105, in
File "/lib/adafruit_azureiot/iotcentral_device.py", line 184, in connect
File "/lib/adafruit_azureiot/iot_mqtt.py", line 434, in subscribe_to_twins
File "/lib/adafruit_azureiot/iot_mqtt.py", line 327, in _get_device_settings
File "/lib/adafruit_azureiot/iot_mqtt.py", line 465, in loop
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 1009, in loop
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 1037, in _wait_for_msg
MMQTTException:

Code done running.`

I'm using Pico W adafruit-circuitpython-raspberry_pi_pico_w-en_US-8.2.1 with adafruit-circuitpython-azureiot-8.x-mpy-2.5.15 and adafruit-circuitpython-minimqtt-8.x-mpy-7.4.1

I added back in a socket timeout removed with [this specific change](https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/commit/6e3ed77608516d1cdcab9280f299ec84c931afb8#diff-ed5d6af26d778ffe55c444bd3cc480b8d80c833bc13fc8e300d2fe3f672bf930L1005) and it started to work again from what I've observed so far.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in adafruit_minimqtt/adafruit_minimqtt.py at _wait_for_msg and trace the call path shown through iot_mqtt.py and iotcentral_device.py. Compare the behavior with the linked socket-timeout change and reproduce using the IoT Central example on a Pico W; done means the connection no longer raises an empty MMQTTException.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.