-
Notifications
You must be signed in to change notification settings - Fork 127
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
Multiple changes #7
base: master
Are you sure you want to change the base?
Conversation
Changed structure to be clearly arranged and to make it usable as module. Updated mqtt_as to not use some workarounds needed for ESP32 with loboris port. Updated README.
removed config dictionary to save ~100-200B which is especially important on esp8266. Moved config dictionary to config.py to still make it possible to configure the library using that dict.
Minimal version for esp8266 saving another 150-250B by removing functions for esp32 and sonoff and by removing not needed functions.
extended class Lock with method locked() returning self._locked to make it more useful outside of mqtt_as
Added misssing documentation about changes made for chaning the way the constructor is called, usage in loboris fork and esp8266 minimal version. Also put all remote_mqtt tests in sepearate folder.
Development version is now master branch
Added information about all the changes compared to base repo of Peter Hinich
Added information about the changes compared to base repo of Peter Hinch (sorry wrote your name wrong)
Added information about all the changes compared to base repo of Peter Hinich
Added information about the changes compared to base repo of Peter Hinch (sorry wrote your name wrong)
# Conflicts: # README.md
When having many subscribe/unsubscribes in a short time, a reliability problem became apparent: The next subscription had been send before the last one received its confirmation from the broker, resulting in an endless reconnect as the received pid did not match the last pid sent to the broker. Solution: Added an additional Lock for subscribe/unsubscribe to wait until the confirmation is received or try again.
Increased reliability by putting qos>0 publications under a lock too, so self.pid can't get overwritten by another qos>0 publication. This is probably really improbable but this makes the reliability update complete.
The pyboard D commit looks good. |
I haven't forgotten these, but they do impose substantial API changes on existing users. By contrast my latest commit has zero API changes :) Re 1,2,4 I'm still unsure whether the gains, particularly from using a package and replacing the config dictionary, justify the API disruption. I originally started out with lots of constructor args and changed to the dict. This does have some advantages. For example it is initialised with default args in the library but you can modify it with project-level defaults in config.py. So, in a project where (say) the server IP or WiFi credentials change, you just distribute a new config.py. You can, of course, pass **config to the multi-parameter constructor, but if you're going to do that you might as well stick with the dict. 7 (retained messages) is definitely worth doing. Right now I'm busy trying to understand some weird behaviour of Pyboard D applications and am trying to produce a decent test case. |
Thanks for your answer. 1,2,4 would be nice to have if a new version already changes the API. 7 (retained messages) is where the biggest API change lays because the function that is being called when a new message is received now takes 3 args instead of 2. 6 unsubscribe: I use it often. On topic "home/device/state" I keep the retained status that the device has. On topic "home/device/state/set" the device receives commands to change that state to a new state. 8 is also useful with only subscribe as I had problems subscribing from different uasyncio coros in short succession. Pause/Resume might be helpful for battery powered devices to properly disconnect from the server to save power. Once your new version is stable and ready, I can pull those changes and create pull requests only with the changes you want to implement. That will hopefully make it easier for you. Good luck hunting down the problems with the Pyboard D! Hope you can find it soon. |
Just as an update as time has passed:
|
� Conflicts: � README_mqtt_as.md � mqtt_as.py � tests/range.py � tests/range_ex.py � tests/unclean.py
� Conflicts: � tests/lowpower.py � tests/mqtt_as_cancel.py
Can be implemented similarly for unsubscribe and subscribe.
� Conflicts: � mqtt_as.py � mqtt_as_cancel.py
and removed locks added as workarounds. Concurrent publish/(un)subscribe operations will now work correctly. The locks workaround making them execute after each other is not needed anymore.
which other components might depend on.
� Conflicts: � README_mqtt_as.md � mqtt_as.py � mqtt_as/mqtt_as_cancel.py � mqtt_as/ssl.py � mqtt_as_cancel.py � tests/mqtt_as_timeout.py � tests/range.py � tests/ssl.py � tests/tls.py � tests/tls32.py � tests/tls8266.py
� Conflicts: � README_mqtt_as.md
the other timeout files and tests still need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you.
I think the changes for the new uasyncio should be a separate PR rather than an addendum to this very large one. Then I could simply do a merge.
Ah yes, I forgot that this PR pulls all the changes from my master repository. I guess this can be closed since you won't be merging the remaining changes anyway. |
This pull request is merely to give you an overview of the changes I made, so you can have them in mind when looking at the code. I know you'll only start working on this once you check the module for the new hardware and retest the reliability. Thanks for your efforts with this module.
Changes:
making it possible to just clone the repo and copy it to espXXXX/modules also reducing file clutter in this directory.