micropython / micropython/micropython-lib

umqtt/simple (connect)

Open
#406 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

Trying to run an example, came by: https://github.com/GoogleCloudPlatform/iot-core-micropython

It stops here:

Creating JWT...
Sending message with password eyJ0eXAiOiAiSl
[...] JWId1Qjmb4BjjKHPLITppMbzo1FDBigdmqmw_CwUQXjB2mUyRX8QcUw6ApvZTP98yfrc7gP0lc5eQmVZR0xsSmBlJM_iGJp1vJhkwirpIeXgnILO9w==
Traceback (most recent call last):
File "main.py", line 190, in
File "main.py", line 170, in get_mqtt_client
File "umqtt/simple.py", line 97, in connect
IndexError: bytes index out of range
MicroPython v1.12 on 2019-12-20; ESP32 module with ESP32

and can't conclude de connection, any suggestion of what can be?

follow line 190 in main.py:

client = get_mqtt_client(config.google_cloud_config['project_id'], config.google_cloud_config['cloud_region'], config.google_cloud_config['registry_id'], config.google_cloud_config['device_id'], jwt)

I think the problem is about umqtt/simple.py

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with umqtt/simple.py line 97 and the get_mqtt_client call at main.py lines 170 and 190. Reproduce the connection attempt on MicroPython v1.12 with the ESP32 example, then trace the bytes index error. Done means the example completes the MQTT connection without the exception, with the cause and verification captured.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.