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

pywintypes.error: (87, 'SetWaitableTimer', 'The parameter is incorrect.') #1695

Open
ovianao opened this issue Nov 21, 2023 · 2 comments
Open
Labels

Comments

@ovianao
Copy link

ovianao commented Nov 21, 2023

Describe the bug

When attempting to start a periodic signal, get:
pywintypes.error: (87, 'SetWaitableTimer', 'The parameter is incorrect.')

There was something related resolved here, but this issue is still present:
#1654

To Reproduce

Install a latest version of python-can, including 4.2.2 or 4.3.0.
Create a periodic signal, and attempt to start it.

Expected behavior

No error observed.

Additional context

The following error is observed:

OS and version: Windows 10 Version 1809, OS Build 17763.1637
Python version: 3.7 or 3.8
python-can version: 4.2.2 or 4.3.0
python-can interface/s (if applicable): python-ics==908.12

Traceback and logs
Traceback (most recent call last):
  File "test2.py", line 8, in <module>
    bus.send_periodic(msg, period=1000, duration=5000)
  File "c:\temp\venv38\lib\site-packages\can\bus.py", line 269, in send_periodic
    self._send_periodic_internal(msgs, period, duration, modifier_callback),
  File "c:\temp\venv38\lib\site-packages\can\bus.py", line 319, in _send_periodic_internal
    task = ThreadBasedCyclicSendTask(
  File "c:\temp\venv38\lib\site-packages\can\broadcastmanager.py", line 269, in __init__
    self.start()
  File "c:\temp\venv38\lib\site-packages\can\broadcastmanager.py", line 285, in start
    win32event.SetWaitableTimer(
pywintypes.error: (87, 'SetWaitableTimer', 'The parameter is incorrect.')
import can

with can.Bus() as bus:
    msg = can.Message(
        arbitration_id=0xC0FFEE, data=[0, 0, 0, 0, 0, 0, 0, 0], is_extended_id=False
    )
    
    bus.send_periodic(msg, period=1000, duration=5000)
@ovianao ovianao added the bug label Nov 21, 2023
@zariiii9003
Copy link
Collaborator

zariiii9003 commented Nov 21, 2023

What's your pywin32 version? You can check with pip list

Do you really want a period of 1000 seconds?

@ovianao
Copy link
Author

ovianao commented Nov 21, 2023

I have pywin32 version 306.
The 1000 seconds was just an example. I also tried with a period=1, duration=5 and the end result is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants