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

runtests.jl fails using Windows Subsystem for Linux(WSL) #49

Open
flothieben opened this issue Mar 4, 2020 · 1 comment
Open

runtests.jl fails using Windows Subsystem for Linux(WSL) #49

flothieben opened this issue Mar 4, 2020 · 1 comment

Comments

@flothieben
Copy link

Hi there,
for arduino communication using windows subsystem for linux it would be great to able to use LibSerialPort.

include(".julia/packages/LibSerialPort/xvkkM/test/runtests.jl")                                                                                                                                                                      Usage: test-low-level-api.jl port [baudrate]  
Available ports:                                                                                                                                                                                    OS error code 2: No such file or directory                      
                                                                                                                                                                             Low level API: Error During Test at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:28

Got exception outside of a @test 
LoadError: From /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/wrap.jl: 141:      
libserialport returned SP_ERR_FAIL - Host OS reported a failure.       
                                                                                                                                                                      Stacktrace:     
                                                                                                                                                                                                                              [1] error(::String) at ./error.jl:33           
                                                                                                                                                                                              [2] handle_error(::SPReturn, ::String) at /home/flothieben/.julia/packages/LibSerialPort/xvkkM
/src/wrap.jl:136                                                                                                                              
 [3] sp_list_ports at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/wrap.jl:164 [inlined]    

 [4] #list_ports#29(::Int64, ::typeof(list_ports)) at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/high-level-api.jl:114                                                                                                          
[5] list_ports at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/high-level-api.jl:114 [inlined]                                                                                                                                   
[6] test_low_level_api() at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-low-level-api.jl:211                                                                                                                              
[7] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-low-level-api.jl:241
 [8] include at ./boot.jl:328 [inlined]   
[9] include_relative(::Module, ::String) at ./loading.jl:1105        
[10] include(::Module, ::String) at ./Base.jl:31      
[11] include(::String) at ./client.jl:424     
[12] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:29    
[13] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107
[14] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:29     
[15] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107
[16] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:28  
[17] include at ./boot.jl:328 [inlined]       
[18] include_relative(::Module, ::String) at ./loading.jl:1105                   
[19] include(::Module, ::String) at ./Base.jl:31               
[20] include(::String) at ./client.jl:424             
[21] top-level scope at REPL[3]:1             
[22] eval(::Module, ::Any) at ./boot.jl:330          
[23] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86           
[24] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118 [inlined]           
[25] (::REPL.var"#26#27"{REPL.REPLBackend})() at ./task.jl:333     
in expression starting at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-low-level-api.jl:241 

                                                                                                                                                                                                                                                                                                                                                                   Usage: test-high-level-api.jl port baudrate        
Available ports:    
OS error code 2: No such file or directory    
High level API: Error During Test at /home/flothieben/.julia/packages/LibSerialPort/xvkkM
/test/runtests.jl:35          
Got exception outside of a @test          
LoadError: From /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/wrap.jl: 141:        
libserialport returned SP_ERR_FAIL - Host OS reported a failure.     
Stacktrace:         
[1] error(::String) at ./error.jl:33          
[2] handle_error(::SPReturn, ::String) at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/wrap.jl:136        
[3] sp_list_ports at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/wrap.jl:164 [inlined]   
[4] #list_ports#29(::Int64, ::typeof(list_ports)) at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/high-level-api.jl:114
[5] list_ports at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/src/high-level-api.jl:114 [inlined] 
[6] test_high_level_api() at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-high-level-api.jl:75  
[7] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-high-level-api.jl:96
[8] include at ./boot.jl:328 [inlined]         
[9] include_relative(::Module, ::String) at ./loading.jl:1105               
[10] include(::Module, ::String) at ./Base.jl:31    
[11] include(::String) at ./client.jl:424         
[12] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:36  
[13] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 
 [14] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:36    
[15] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107
[16] top-level scope at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:28  
[17] include at ./boot.jl:328 [inlined]              
[18] include_relative(::Module, ::String) at ./loading.jl:1105                     
[19] include(::Module, ::String) at ./Base.jl:31                    
[20] include(::String) at ./client.jl:424  
[21] top-level scope at REPL[3]:1            
[22] eval(::Module, ::Any) at ./boot.jl:330     
[23] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build
/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86          
[24] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118 [inlined]        
[25] (::REPL.var"#26#27"{REPL.REPLBackend})() at ./task.jl:333       
in expression starting at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/test-high-level-api.jl:96            
Test Summary:    | Error  Total   
LibSerialPort    |     2      2    
Low level API  |     1      1  
High level API |     1      1    
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 2 errored, 0 broken.        
in expression starting at /home/flothieben/.julia/packages/LibSerialPort/xvkkM/test/runtests.jl:14 
@mgkuhn
Copy link
Collaborator

mgkuhn commented Nov 18, 2020

Did you specify the port and baud rate to use?

See the comment at the top of https://github.com/JuliaIO/LibSerialPort.jl/blob/master/test/runtests.jl

These tests require a serial device to echo bytes written from the host computer.
For example, these hardware configurations should work:

  • A standalone USB-to-UART adapter (e.g. FTDI FT232) in loopback mode (TX and RX pins jumped).
  • A USB-to-serial equipped, arduino-compatible microcontroller running examples/serial_example.ino.
  • The USB-to-serial chip on some microcontroller boards can be used directly, bypassing the micro.
    For example, an Arduino UNO R3 can be connected via USB with RESET grounded and TX wired to RX.
    Run the tests locally using
$ julia test/runtests.jl <port address> <baudrate>

Which working serial-port devices do you have available in /dev under your WSL setup?

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