Skip to content

adafruit_minimqtt: Fix issue #86 with multiple poll() PINGREQs #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

ajlennon
Copy link
Contributor

@ajlennon ajlennon commented Aug 7, 2021

If I set timeout to zero there is a problem as the poll() call will be
called multiple times while a ping request is outstanding and this
results in multiple ping requests being made. I see 3-5 at a time with
DEBUG logging on.

This is because self._timestamp is being reset after self.ping()

The solution seems to be pretty straightforward which is to reset
self._timestamp() before sending the ping()

Signed-off-by: Alex J Lennon ajlennon@dynamicdevices.co.uk

If I set timeout to zero there is a problem as the poll() call will be
called multiple times while a ping request is outstanding and this
results in multiple ping requests being made. I see 3-5 at a time with
DEBUG logging on.

This is because self._timestamp is being reset after self.ping()

The solution seems to be pretty straightforward which is to reset
self._timestamp() before sending the ping()

Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk>
@brentru brentru self-requested a review August 9, 2021 14:18
@brentru
Copy link
Member

brentru commented Aug 9, 2021

Thanks for the PR!

@brentru brentru merged commit 62d1921 into adafruit:main Aug 9, 2021
@ajlennon
Copy link
Contributor Author

ajlennon commented Aug 9, 2021

Any time :) Thanks for all your hard work on the libraries!

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 11, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 1.3.3 from 1.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#16 from apendley/extended_tone_demo

Updating https://github.com/adafruit/Adafruit_CircuitPython_MIDI to 1.4.2 from 1.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#40 from jepler/no-reuse-exception
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#39 from jepler/use-generator
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#38 from EMATech/mtc

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.1.1 from 5.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#87 from DynamicDevices/ajl/fix-multiple-pingreqs

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_Ducky
rtwfroody pushed a commit to rtwfroody/Adafruit_CircuitPython_MiniMQTT that referenced this pull request Sep 18, 2022
…ingreqs

adafruit_minimqtt: Fix issue adafruit#86 with multiple poll() PINGREQs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants