Skip to content
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

Never transmits on Windows in version 0.5 #69

Closed
larsch opened this issue Dec 11, 2020 · 21 comments
Closed

Never transmits on Windows in version 0.5 #69

larsch opened this issue Dec 11, 2020 · 21 comments

Comments

@larsch
Copy link

larsch commented Dec 11, 2020

_ensure_writer just schedules _poll_write which never invokes _write_ready because serial.out_waiting is always zero.

@jabdoa2
Copy link
Contributor

jabdoa2 commented Dec 13, 2020

@larsch according to the docs out_waiting returns the number of bytes in the output buffer. I expected this to be the number of bytes available. Not 100% sure though. Might be as well the number of bytes used in the buffer. However, we shipped 0.4 of pyserial-asyncio to our MPF users and it seemed to have worked fine for all Windows users.

@jabdoa2
Copy link
Contributor

jabdoa2 commented Dec 13, 2020

Ok I found the culprit of that. Fixed that in #70 together with some other windows issues. As subtle behavior change in 0.5 exposed those bugs. My PR should fix them.

@Hedda
Copy link

Hedda commented Dec 14, 2020

Any plans for a quick bug-fix release? E.g. 0.5.2 or similar if using semantic versioning https://semver.org or just 0.6?

@Hedda
Copy link

Hedda commented Jan 18, 2021

@zsquareplusc @rob-smallshire Is it possible for you to release 0.5.1 or 0.6 with bug-fix pyserial-asyncio as suggested in #70 ? Serial writes is broken on Windows 10 with the 0.5 release of pyserial-asyncio. The workaround now is either downgrade pyserial-asyncio to 0.4 or manually install the master branch via Git.

@Hedda
Copy link

Hedda commented Mar 1, 2021

@zsquareplusc @rob-smallshire @septatrix @wolfmanjm Any chance you for a bug-fix release to resolve this issue on Windows?

@sean-marten
Copy link

@zsquareplusc @rob-smallshire Also just ran into this issue on Windows and would really appreciate a bug fix deploy sometime soon if possible, thanks!

@teharris1
Copy link

If this is fixed, can we get it published? This is a big deal for my module.

@teharris1
Copy link

Sorry meant to say "I can confirm the fix by @jabdoa2 fixed the issue." Can this fix be published?

@Carbenium
Copy link

@zsquareplusc I would like to chime in here as well. A release would be very much appreciated.

@Carbenium
Copy link

@bufferoverflow @zsquareplusc Just trying to raise some attention regarding this issue. The committed code works, just a new release is needed, so we can avoid patching the lib manually.

@serializingme
Copy link

I also can confirm that PR #70 fixed the problem. While the fixed version of the package doesn't get published, for those looking to install the fixed version you can leverage pip git support:

  1. Make sure your environment doesn't have the installed version from pypi.org
  2. Remove any entry for pyserial-asyncio in the requirements.txt
  3. Add git+https://github.com/pyserial/pyserial-asyncio.git@master to the requirements.txt file

For manual installation:

pip uninstall pyserial-asyncio
pip install git+https://github.com/pyserial/pyserial-asyncio.git@master

Another option (which isn't as good), is to run the previous version (entry in requirements.txt is something along the lines of pyserial-asyncio==0.4) which doesn't have this issue. I did some tests and (for my usage) it works fine.

@Hedda
Copy link

Hedda commented Aug 24, 2021

Another option (which isn't as good), is to run the previous version (entry in requirements.txt is something along the lines of pyserial-asyncio==0.4) which doesn't have this issue. I did some tests and (for my usage) it works fine.

Another workaround option to whitelisting a specific version could be to use 'pyserial-asyncio!=0.5; platform_system=="Windows"' entry in requirements.txt as then it should specifically blacklist version 0.5 for Windows as a platform only.

Tip would be to also add a comment as why it was blacklisted, ex: 'pyserial-asyncio!=0.5; platform_system=="Windows"', # 0.5 broke writes on Windows

Problem with that is that you currently end up using different versions of pyserial-asyncio on different platforms

@jabdoa2
Copy link
Contributor

jabdoa2 commented Aug 24, 2021

Another option (which isn't as good), is to run the previous version (entry in requirements.txt is something along the lines of pyserial-asyncio==0.4) which doesn't have this issue. I did some tests and (for my usage) it works fine.

Another workaround option to whitelisting a specific version could be to use 'pyserial-asyncio!=0.5; platform_system=="Windows"' entry in requirements.txt as then it should specifically blacklist version 0.5 for Windows as a platform only.

Tip would be to also add a comment as why it was blacklisted, ex: 'pyserial-asyncio!=0.5; platform_system=="Windows"', # 0.5 broke writes on Windows

Problem with that is that you currently end up using different versions of pyserial-asyncio on different platforms

We currently ship exactly that workaround.

@teharris1
Copy link

Problem with that is that you currently end up using different versions of pyserial-asyncio on different platforms

Specifically 0.5 has removed the @coroutine and moved to the more standard async/await approach. So I believe python 3.9 will break with <0.5

@scranen
Copy link

scranen commented Sep 29, 2021

Tagging @bufferoverflow @zsquareplusc again, the latest released version has been broken on Windows for almost 10 months now while a fix is already merged :(

@rob-smallshire
Copy link
Collaborator

@scranen @jabdoa2 @Carbenium Given the unresponsiveness of the folks with the power to publish releases, I think you should seriously contemplate forking this project and publishing it to PyPI under a different name.

@jabdoa2
Copy link
Contributor

jabdoa2 commented Sep 30, 2021

Ok I will do that tonight under the missionpinball org

@zsquareplusc
Copy link
Member

i've now added github actions and keys so that @rob-smallshire can make releases too

@zsquareplusc
Copy link
Member

ah and i made a release (v0.6) and added a document on how to do this.

@bufferoverflow
Copy link
Member

thanks @zsquareplusc !

@rob-smallshire
Copy link
Collaborator

rob-smallshire commented Oct 15, 2021

This fix has been released.

Hedda added a commit to Hedda/Domoticz-Zigbee that referenced this issue Apr 10, 2022
pyserial-asyncio is required by recommend use newer than pyserial-asyncio 0.5 (ie. 0.5 or later)  as 0.5 is broken on Windows OS.

Known issue with pyserial-asyncio 0.5 -> pyserial/pyserial-asyncio#69

https://github.com/zigbeefordomoticz/Domoticz-Zigbee/blob/stable6/requirements.txt

See example [zigpy-znp](https://github.com/zigpy/zigpy-znp) config which exclude use of pyserial-asyncio 0.5 version : 

https://github.com/zigpy/zigpy-znp/blob/dev/setup.cfg

```
install_requires =
    pyserial-asyncio; platform_system!="Windows"
    pyserial-asyncio!=0.5; platform_system=="Windows"  # 0.5 broke writes
```
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

No branches or pull requests