InfiniTimeOrg / InfiniTimeOrg/InfiniTime

dfu.py upload fails randomly

Open
#914 2 comments 0 reactions 1 assignee View on GitHub

@JF002 is already working on this.

Since Feb 20, 2023.

bug
Dominant language
C
Stars
3.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Verification
  • I searched for similar bug reports and found none was relevant.
What happened?

When running dfu.py, at some point through the uploading process, I almost always recieve an error such as Exception at line 159: not enough values to unpack (expected 3, got 2) or Exception at line 159: 'NoneType' object is not subscriptable

What should happen instead?

I was expecting the upload to succeed without an error

Reproduction steps

I built InfiniTime with the enable DFU flag. I then ran

sudo ./dfu.py -z /path/to/compiled-dfu.zip -a [mac] --legacy

which failed at a random time during the upload with this error

Exception at line 159: 'NoneType' object is not subscriptable

or this error

Exception at line 159: not enough values to unpack (expected 3, got 2)
More details?

It appears that the first error is coming from this line (160) in ble_legacy_dfu_controller.py

(proc, res, pkts) = self._wait_and_parse_notify()

I do not know where the second error comes from, but the error is printed on this line (167) in dfu.py

print("Exception at line {}: {}".format(sys.exc_info()[2].tb_lineno, e))

Edit: It uploaded once (out of the about seven times I tried)

Version

develop with a slight change of a string ('+' -> '^' in timer.cpp)

Companion app

No response

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.