-
Notifications
You must be signed in to change notification settings - Fork 21
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
OS error code 5: Input/output
error on ubuntu
#42
Comments
Same test failures in
Nevertheless, reading the port works: list_ports()
/dev/ttyUSB1
port = "/dev/ttyUSB1"
LibSerialPort.open(port, 115200) do s
#write(s, "input")
ret = readuntil(s, '\n', 1.0) #try to readline with a 1 second timeout
@show ret
end
ret = "1527654 310\r\n"
"1527654 310\r\n" (after uploading the example to an arduino) Great, thanks for this package ! |
Since there have been significant changes since this issue was raised: does it still exist in |
Still v0.5.0(tests) pkg> test LibSerialPort
Testing LibSerialPort
Status `/tmp/jl_G2u8mt/Project.toml`
[a05a14c7] LibSerialPort v0.5.0
[220460dc] libserialport_jll v0.1.2+0
[8f399da3] Libdl `@stdlib/Libdl`
[8dfed614] Test `@stdlib/Test`
Status `/tmp/jl_G2u8mt/Manifest.toml`
[a05a14c7] LibSerialPort v0.5.0
[220460dc] libserialport_jll v0.1.2+0
[0dad84c5] ArgTools `@stdlib/ArgTools`
[56f22d72] Artifacts `@stdlib/Artifacts`
[2a0f44e3] Base64 `@stdlib/Base64`
[ade2ca70] Dates `@stdlib/Dates`
[f43a241f] Downloads `@stdlib/Downloads`
[b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
[b27032c2] LibCURL `@stdlib/LibCURL`
[76f85450] LibGit2 `@stdlib/LibGit2`
[8f399da3] Libdl `@stdlib/Libdl`
[56ddb016] Logging `@stdlib/Logging`
[d6f4376e] Markdown `@stdlib/Markdown`
[ca575930] NetworkOptions `@stdlib/NetworkOptions`
[44cfe95a] Pkg `@stdlib/Pkg`
[de0858da] Printf `@stdlib/Printf`
[3fa0cd96] REPL `@stdlib/REPL`
[9a3f8284] Random `@stdlib/Random`
[ea8e919c] SHA `@stdlib/SHA`
[9e88b42a] Serialization `@stdlib/Serialization`
[6462fe0b] Sockets `@stdlib/Sockets`
[fa267f1f] TOML `@stdlib/TOML`
[a4e569a6] Tar `@stdlib/Tar`
[8dfed614] Test `@stdlib/Test`
[cf7118a7] UUIDs `@stdlib/UUIDs`
[4ec0a83e] Unicode `@stdlib/Unicode`
[deac9b47] LibCURL_jll `@stdlib/LibCURL_jll`
[29816b5a] LibSSH2_jll `@stdlib/LibSSH2_jll`
[c8ffd9c3] MbedTLS_jll `@stdlib/MbedTLS_jll`
[14a3606d] MozillaCACerts_jll `@stdlib/MozillaCACerts_jll`
[83775a58] Zlib_jll `@stdlib/Zlib_jll`
[8e850ede] nghttp2_jll `@stdlib/nghttp2_jll`
[3f19e933] p7zip_jll `@stdlib/p7zip_jll`
Testing Running tests...
Usage: test-low-level-api.jl port [baudrate]
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
Usage: test-low-level-api.jl port [baudrate]
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
0
1
1
0.1.1
1
0
1
1:0:1
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
OS error code 5: Input/output error
Low level API: Error During Test at /home/ederag/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:37
Test threw exception
Expression: test_low_level_api(port, baudrate) == nothing
libserialport returned SP_ERR_FAIL - Host OS reported a failure.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] check(ret::SPReturn)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/zyrgR/src/wrap.jl:299
[3] sp_open
@ ~/.julia/packages/LibSerialPort/zyrgR/src/wrap.jl:341 [inlined]
[4] test_low_level_api(::String, ::Vararg{String, N} where N)
@ Main ~/.julia/packages/LibSerialPort/zyrgR/test/test-low-level-api.jl:157
[5] macro expansion
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:37 [inlined]
[6] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[7] macro expansion
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:35 [inlined]
[8] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[9] top-level scope
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:34
Usage: test-high-level-api.jl port baudrate
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
Usage: test-high-level-api.jl port baudrate
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
OS error code 5: Input/output error
High level API: Error During Test at /home/ederag/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:43
Test threw exception
Expression: test_high_level_api(port, baudrate) == nothing
libserialport returned SP_ERR_FAIL - Host OS reported a failure.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] check(ret::SPReturn)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/zyrgR/src/wrap.jl:299
[3] sp_open(port::Ptr{LibSerialPort.Lib.SPPort}, mode::SPMode)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/zyrgR/src/wrap.jl:341
[4] open(portname::String, baudrate::Int64; mode::SPMode, ndatabits::Int64, parity::SPParity, nstopbits::Int64)
@ LibSerialPort ~/.julia/packages/LibSerialPort/zyrgR/src/LibSerialPort.jl:463
[5] open
@ ~/.julia/packages/LibSerialPort/zyrgR/src/LibSerialPort.jl:462 [inlined]
[6] test_high_level_api(::String, ::Vararg{String, N} where N)
@ Main ~/.julia/packages/LibSerialPort/zyrgR/test/test-high-level-api.jl:96
[7] macro expansion
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:43 [inlined]
[8] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[9] macro expansion
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:41 [inlined]
[10] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[11] top-level scope
@ ~/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:34
Test Summary: | Pass Error Total
LibSerialPort | 2 2 4
Low level API | 1 1 2
High level API | 1 1 2
ERROR: LoadError: Some tests did not pass: 2 passed, 0 failed, 2 errored, 0 broken.
in expression starting at /home/ederag/.julia/packages/LibSerialPort/zyrgR/test/runtests.jl:20
ERROR: Package LibSerialPort errored during testing master(tests) pkg> add LibSerialPort#master
Cloning git-repo `https://github.com/JuliaIO/LibSerialPort.jl.git`
Updating git-repo `https://github.com/JuliaIO/LibSerialPort.jl.git`
Resolving package versions...
Updating `~/share/prog/julia/tests/Project.toml`
[a05a14c7] ~ LibSerialPort v0.5.0 ⇒ v0.5.0 `https://github.com/JuliaIO/LibSerialPort.jl.git#master`
Updating `~/share/prog/julia/tests/Manifest.toml`
[a05a14c7] ~ LibSerialPort v0.5.0 ⇒ v0.5.0 `https://github.com/JuliaIO/LibSerialPort.jl.git#master`
Precompiling project...
1 dependency successfully precompiled in 1 seconds (247 already precompiled)
(tests) pkg> test LibSerialPort
Testing LibSerialPort
Status `/tmp/jl_QrRy9N/Project.toml`
[a05a14c7] LibSerialPort v0.5.0 `https://github.com/JuliaIO/LibSerialPort.jl.git#master`
[220460dc] libserialport_jll v0.1.2+0
[8f399da3] Libdl `@stdlib/Libdl`
[8dfed614] Test `@stdlib/Test`
Status `/tmp/jl_QrRy9N/Manifest.toml`
[a05a14c7] LibSerialPort v0.5.0 `https://github.com/JuliaIO/LibSerialPort.jl.git#master`
[220460dc] libserialport_jll v0.1.2+0
[0dad84c5] ArgTools `@stdlib/ArgTools`
[56f22d72] Artifacts `@stdlib/Artifacts`
[2a0f44e3] Base64 `@stdlib/Base64`
[ade2ca70] Dates `@stdlib/Dates`
[f43a241f] Downloads `@stdlib/Downloads`
[b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
[b27032c2] LibCURL `@stdlib/LibCURL`
[76f85450] LibGit2 `@stdlib/LibGit2`
[8f399da3] Libdl `@stdlib/Libdl`
[56ddb016] Logging `@stdlib/Logging`
[d6f4376e] Markdown `@stdlib/Markdown`
[ca575930] NetworkOptions `@stdlib/NetworkOptions`
[44cfe95a] Pkg `@stdlib/Pkg`
[de0858da] Printf `@stdlib/Printf`
[3fa0cd96] REPL `@stdlib/REPL`
[9a3f8284] Random `@stdlib/Random`
[ea8e919c] SHA `@stdlib/SHA`
[9e88b42a] Serialization `@stdlib/Serialization`
[6462fe0b] Sockets `@stdlib/Sockets`
[fa267f1f] TOML `@stdlib/TOML`
[a4e569a6] Tar `@stdlib/Tar`
[8dfed614] Test `@stdlib/Test`
[cf7118a7] UUIDs `@stdlib/UUIDs`
[4ec0a83e] Unicode `@stdlib/Unicode`
[deac9b47] LibCURL_jll `@stdlib/LibCURL_jll`
[29816b5a] LibSSH2_jll `@stdlib/LibSSH2_jll`
[c8ffd9c3] MbedTLS_jll `@stdlib/MbedTLS_jll`
[14a3606d] MozillaCACerts_jll `@stdlib/MozillaCACerts_jll`
[83775a58] Zlib_jll `@stdlib/Zlib_jll`
[8e850ede] nghttp2_jll `@stdlib/nghttp2_jll`
[3f19e933] p7zip_jll `@stdlib/p7zip_jll`
Testing Running tests...
Usage: test-low-level-api.jl port [baudrate]
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
Usage: test-low-level-api.jl port [baudrate]
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
0
1
1
0.1.1
1
0
1
1:0:1
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
OS error code 5: Input/output error
Low level API: Error During Test at /home/ederag/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:37
Test threw exception
Expression: test_low_level_api(port, baudrate) == nothing
libserialport returned SP_ERR_FAIL - Host OS reported a failure.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] check(ret::SPReturn)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:299
[3] sp_open
@ ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:341 [inlined]
[4] test_low_level_api(::String, ::Vararg{String, N} where N)
@ Main ~/.julia/packages/LibSerialPort/2Zjh2/test/test-low-level-api.jl:157
[5] macro expansion
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:37 [inlined]
[6] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[7] macro expansion
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:35 [inlined]
[8] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[9] top-level scope
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:34
Usage: test-high-level-api.jl port baudrate
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
Usage: test-high-level-api.jl port baudrate
Available ports:
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
OS error code 5: Input/output error
High level API: Error During Test at /home/ederag/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:43
Test threw exception
Expression: test_high_level_api(port, baudrate) == nothing
libserialport returned SP_ERR_FAIL - Host OS reported a failure.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] check(ret::SPReturn)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:299
[3] sp_open(port::Ptr{LibSerialPort.Lib.SPPort}, mode::SPMode)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:341
[4] open(portname::String, baudrate::Int64; mode::SPMode, ndatabits::Int64, parity::SPParity, nstopbits::Int64)
@ LibSerialPort ~/.julia/packages/LibSerialPort/2Zjh2/src/LibSerialPort.jl:463
[5] open
@ ~/.julia/packages/LibSerialPort/2Zjh2/src/LibSerialPort.jl:462 [inlined]
[6] test_high_level_api(::String, ::Vararg{String, N} where N)
@ Main ~/.julia/packages/LibSerialPort/2Zjh2/test/test-high-level-api.jl:96
[7] macro expansion
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:43 [inlined]
[8] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[9] macro expansion
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:41 [inlined]
[10] macro expansion
@ /usr/local/build/julia-1.6.1_build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[11] top-level scope
@ ~/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:34
Test Summary: | Pass Error Total
LibSerialPort | 2 2 4
Low level API | 1 1 2
High level API | 1 1 2
ERROR: LoadError: Some tests did not pass: 2 passed, 0 failed, 2 errored, 0 broken.
in expression starting at /home/ederag/.julia/packages/LibSerialPort/2Zjh2/test/runtests.jl:20
ERROR: Package LibSerialPort errored during testing With an arduino connected on `readuntil` missingjulia> using LibSerialPort
julia> list_ports()
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
julia> port = "/dev/ttyUSB0"
"/dev/ttyUSB0"
julia> LibSerialPort.open(port, 115200) do s
#write(s, "input")
ret = readuntil(s, '\n', 1.0) #try to readline with a 1 second timeout
@show ret
end
ERROR: MethodError: no method matching readuntil(::SerialPort, ::Char, ::Float64)
Closest candidates are:
readuntil(::AbstractString, ::Any...; kw...) at io.jl:471
readuntil(::IO, ::AbstractChar; keep) at io.jl:771
readuntil(::IO, ::T; keep) where T at io.jl:786
...
Stacktrace:
[1] (::var"#1#2")(s::SerialPort)
@ Main ./REPL[10]:3
[2] open(::var"#1#2", ::String, ::Vararg{Any, N} where N; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:330
[3] open(::Function, ::String, ::Int64)
@ Base ./io.jl:328
[4] top-level scope
@ REPL[10]:1
Edit: Updated mwejulia> list_ports()
/dev/ttyUSB0
Description: FT232R USB UART - A800eKOI
Transport type: SP_TRANSPORT_USB
julia> # Modify these as needed
portname = "/dev/ttyS0"
"/dev/ttyS0"
julia> baudrate = 115200
115200
julia> # Snippet from examples/mwe.jl
LibSerialPort.open(portname, baudrate) do sp
sleep(2)
if bytesavailable(sp) > 0
println(String(read(sp)))
end
write(sp, "hello\n")
sleep(0.1)
println(readline(sp))
end
OS error code 5: Input/output error
ERROR: libserialport returned SP_ERR_FAIL - Host OS reported a failure.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] check(ret::LibSerialPort.Lib.SPReturn)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:299
[3] sp_open(port::Ptr{LibSerialPort.Lib.SPPort}, mode::SPMode)
@ LibSerialPort.Lib ~/.julia/packages/LibSerialPort/2Zjh2/src/wrap.jl:341
[4] open(portname::String, baudrate::Int64; mode::SPMode, ndatabits::Int64, parity::SPParity, nstopbits::Int64)
@ LibSerialPort ~/.julia/packages/LibSerialPort/2Zjh2/src/LibSerialPort.jl:463
[5] open(portname::String, baudrate::Int64)
@ LibSerialPort ~/.julia/packages/LibSerialPort/2Zjh2/src/LibSerialPort.jl:462
[6] open(::var"#11#12", ::String, ::Vararg{Any, N} where N; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:328
[7] open(::Function, ::String, ::Int64)
@ Base ./io.jl:328
[8] top-level scope
@ REPL[24]:2 The arduino can be read on ttyUSB0 at 115200 bps with the arduino-1.8.15 monitor. |
I stumbled over this will trying to read an rfcomm0 port using v0.5.0. Still need to verify if Python has the same problem. |
The underlying problem behind |
Test errors on master. Ubuntu 18.04. User in the dialout group.
The text was updated successfully, but these errors were encountered: