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

ERROR_SEM_TIMEOUT (semaphore timeout) when using with Windows 10 and Ruby from RubyInstaller #52

Open
synthead opened this issue Jul 27, 2023 · 1 comment

Comments

@synthead
Copy link

synthead commented Jul 27, 2023

Related to synthead/timex_datalink_client#308.

When using Ruby from RubyInstaller running Windows 10, rubyserial raises ERROR_SEM_TIMEOUT (RubySerial::Error) while using an example script with the timex_datalink_client gem. This is a semaphore timeout in Windows that appears to be raised from FFI. This is while using a Teensy LC as a serial device.

Here is the exception:

C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rubyserial-0.6.0/lib/rubyserial/windows.rb:73:in `write': ERROR_SEM_TIMEOUT (RubySerial::Error)
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client/notebook_adapter.rb:35:in `block (2 levels) in write'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client/notebook_adapter.rb:32:in `each'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client/notebook_adapter.rb:32:in `block in write'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client/notebook_adapter.rb:31:in `each'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client/notebook_adapter.rb:31:in `write'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/timex_datalink_client-0.12.1/lib/timex_datalink_client.rb:113:in `write'
        from ./timexTest.rb:132:in `<main>'

Steps to reproduce:

  1. Have a Windows 10 machine handy with Ruby installed from RubyInstaller.
  2. Install the timex_datalink_client gem at version 0.12.1.
  3. Have a serial device ready. (Note: The timex_datalink_client gem only writes data to the device, so any arbitrary serial device will work. If you want, you can use a Teensy LC and flash it with https://github.com/synthead/timex-datalink-arduino/releases/tag/v1.0.0 if you want an exact reproduction case.)
  4. Copy the complete code example for Timex Datalink protocol 1 to a file, and run it with Ruby.
  5. Observe the error above.
@synthead synthead changed the title ERROR_SEM_TIMEOUT (semaphore timeout) when using with Windows 10 and RubyInstaller ERROR_SEM_TIMEOUT (semaphore timeout) when using with Windows 10 with Ruby from RubyInstaller Jul 27, 2023
@synthead synthead changed the title ERROR_SEM_TIMEOUT (semaphore timeout) when using with Windows 10 with Ruby from RubyInstaller ERROR_SEM_TIMEOUT (semaphore timeout) when using with Windows 10 and Ruby from RubyInstaller Jul 27, 2023
@hunterboerner
Copy link
Contributor

@deadprogram any thoughts?

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

2 participants