# Problem with running command line items

**URL:** https://discourse.julialang.org/t/problem-with-running-command-line-items/5623
**Category:** General Usage
**Created:** [August 29, 2017, 5:34pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623 "2017-08-29T17:34:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 29, 2017, 5:34pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/1 "2017-08-29T17:34:49Z")

</div>

Hi,

I’ve read the docs about pipelines, run, readchomp, and the blogs on shelling and pipes, but I can’t figure out how to get these simple commands to work. This is what I would do at a linux command prompt:

read -r line \< /dev/ttyACM0  
echo $line

Since, Julia doesn’t have native support for serial port stuff, I’m going to the basic command line. This is basically just reading a line of data from the serial port and printing it. I would like to be able to run these command and stuff the result in a variable that I can interrogate. Can anyone help with this?

Thanks

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [August 29, 2017, 6:08pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/2 "2017-08-29T18:08:04Z")

</div>

`read` appears to be a bash-specific function, not an installed program, so julia can’t run it directly. For example:

```julia
julia> run(`read`)
ERROR: could not spawn `read`: no such file or directory (ENOENT)
Stacktrace:
 [1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at ./process.jl:360
 [2] #373 at ./process.jl:512 [inlined]
 [3] setup_stdio(::Base.##373#374{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:499
 [4] #spawn#372(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:511
 [5] run(::Cmd) at ./process.jl:650

```

But reading a line from a serial port should just be as simple as:

```julia
julia> line = readline("/dev/tty/ACM0")

```

Does that work?

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 29, 2017, 6:19pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/3 "2017-08-29T18:19:26Z")

</div>

Yes, that works. Thanks. Now (again) - I just have to get it working with root permissions. Fun, fun!

Frank

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 29, 2017, 8:36pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/4 "2017-08-29T20:36:30Z")

</div>

One of the problems with just trying to do a readline() on the serial device is timing. That’s why most languages have a set of serial port functions. You have baudrate, etc. that has to be considered.

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [August 29, 2017, 9:23pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/5 "2017-08-29T21:23:26Z")

</div>

> [@Frank\_Applin](#):
>
> That’s why most languages have a set of serial port functions.

You could try using this package:

> **[GitHub - JuliaIO/LibSerialPort.jl: Julia wrapper for the libserialport c library](https://github.com/JuliaIO/LibSerialPort.jl)**
>
> Julia wrapper for the libserialport c library. Contribute to JuliaIO/LibSerialPort.jl development by creating an account on GitHub.

Or this package, which uses PySerial, though there is an open PR to switch the backend to libserialport, though it seems to have stalled a bit.

> **[GitHub - JuliaIO/SerialPorts.jl: SerialPort IO streams in Julia backed by...](https://github.com/JuliaIO/SerialPorts.jl)**
>
> SerialPort IO streams in Julia backed by pySerial. - GitHub - JuliaIO/SerialPorts.jl: SerialPort IO streams in Julia backed by pySerial.

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 11:15am UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/6 "2017-08-30T11:15:11Z")

</div>

Thanks!! If it works - that will be most helpful!  
Frank

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 11:44am UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/7 "2017-08-30T11:44:11Z")

</div>

This is the error I get:

> Pkg.clone(“[GitHub - JuliaIO/LibSerialPort.jl: Julia wrapper for the libserialport c library](https://github.com/andrewadare/LibSerialPort.jl.git)”)  
> INFO: Cloning LibSerialPort from [GitHub - JuliaIO/LibSerialPort.jl: Julia wrapper for the libserialport c library](https://github.com/andrewadare/LibSerialPort.jl.git)  
> ERROR: GitError(Code:ERROR, Class:Net, curl error: Couldn’t resolve host ‘[github.com](http://github.com)’  
> )  
> Stacktrace:  
> [1] macro expansion at ./libgit2/error.jl:99 [inlined]  
> [2] clone(::String, ::SubString{String}, ::Base.LibGit2.CloneOptions) at ./libgit2/repository.jl:276  
> [3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::SubString{String}) at ./libgit2/libgit2.jl:562  
> [4] clone(::String, ::SubString{String}) at ./pkg/entry.jl:195  
> [5] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}})() at ./pkg/dir.jl:36  
> [6] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}}, ::String) at ./file.jl:70  
> [7] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36  
> [8] clone(::String) at ./pkg/pkg.jl:169

I’m running Julia 0.6.0 on  
Linux NODE-UDOOX86 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86\_64 x86\_64 x86\_64 GNU/Linux

Frank

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 1:35pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/8 "2017-08-30T13:35:05Z")

</div>

OK. I got past the git part, but now, I get the following error:

julia\> Pkg.clone(“[https://github.com/andrewadare/LibSerialPort.jl.git](https://github.com/andrewadare/LibSerialPort.jl.git)”)  
INFO: Initializing package repository /home/julia-user/.julia/v0.6  
INFO: Cloning METADATA from [https://github.com/JuliaLang/METADATA.jl](https://github.com/JuliaLang/METADATA.jl)  
INFO: Cloning LibSerialPort from [https://github.com/andrewadare/LibSerialPort.jl.git](https://github.com/andrewadare/LibSerialPort.jl.git)  
INFO: Computing changes…  
INFO: Cloning cache of BinDeps from [https://github.com/JuliaLang/BinDeps.jl.git](https://github.com/JuliaLang/BinDeps.jl.git)  
INFO: Cloning cache of Compat from [https://github.com/JuliaLang/Compat.jl.git](https://github.com/JuliaLang/Compat.jl.git)  
INFO: Cloning cache of SHA from [https://github.com/staticfloat/SHA.jl.git](https://github.com/staticfloat/SHA.jl.git)  
INFO: Cloning cache of URIParser from [https://github.com/JuliaWeb/URIParser.jl.git](https://github.com/JuliaWeb/URIParser.jl.git)  
INFO: Installing BinDeps v0.6.0  
INFO: Installing Compat v0.31.0  
INFO: Installing SHA v0.5.1  
INFO: Installing URIParser v0.2.0

julia\> Pkg.build(“LibSerialPort”)  
INFO: Building LibSerialPort  
INFO: Attempting to Create directory /home/julia-user/.julia/v0.6/LibSerialPort/deps/downloads  
INFO: Downloading file [http://sigrok.org/download/source/libserialport/libserialport-0.1.1.tar.gz](http://sigrok.org/download/source/libserialport/libserialport-0.1.1.tar.gz)  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
100 178 100 178 0 0 341 0 --:–:-- --:–:-- --:–:-- 341  
100 395k 100 395k 0 0 125k 0 0:00:03 0:00:03 --:–:-- 194k  
INFO: Done downloading file [http://sigrok.org/download/source/libserialport/libserialport-0.1.1.tar.gz](http://sigrok.org/download/source/libserialport/libserialport-0.1.1.tar.gz)  
INFO: Attempting to Create directory /home/julia-user/.julia/v0.6/LibSerialPort/deps/src  
INFO: Attempting to Create directory /home/julia-user/.julia/v0.6/LibSerialPort/deps  
INFO: Directory /home/julia-user/.julia/v0.6/LibSerialPort/deps already created  
INFO: Changing Directory to /home/julia-user/.julia/v0.6/LibSerialPort/deps/src/libserialport-0.1.1  
INFO: Changing Directory to /home/julia-user/.julia/v0.6/LibSerialPort/deps/src/libserialport-0.1.1  
ar: `u' modifier ignored since `D’ is the default (see `U’)  
============================[ERROR: LibSerialPort]============================

LoadError: Provider BinDeps.BuildProcess failed to satisfy dependency libserialport  
while loading /home/julia-user/.julia/v0.6/LibSerialPort/deps/build.jl, in expression starting on line 27

================================================================================

================================[BUILD ERRORS]================================

WARNING: LibSerialPort had build errors.

- packages with build errors remain installed in /home/julia-user/.julia/v0.6
- build the package(s) and all dependencies with `Pkg.build("LibSerialPort")`
- build a single package by running its `deps/build.jl` script

Any ideas?

---

<div class="post-metadata">

### Author: ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)
#### Post date: [August 30, 2017, 1:43pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/9 "2017-08-30T13:43:38Z")

</div>

Not sure; FWIW, `Pkg.build("LibSerialPort")` works for me on Julia 0.6, Ubuntu 16.04.

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 2:03pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/10 "2017-08-30T14:03:49Z")

</div>

I deleted the Julia directory, deleted the .Julia directory and did a fresh install of Julia 0.6.0. I still get the same error. Could it be because I’m running a 32-bit version of Julia (which I need)?

Frank

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [August 30, 2017, 2:16pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/11 "2017-08-30T14:16:02Z")

</div>

> [@Frank\_Applin](#):
>
> Could it be because I’m running a 32-bit version of Julia (which I need)?

Could be. You can try building `libserialport` yourself and see if you run into any errors. If it works and it’s in your path `Pkg.build` will be able to find it. Perhaps also good to make an issue at LibSerialPort.jl that the build script might not work on 32 bits.

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 2:39pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/12 "2017-08-30T14:39:08Z")

</div>

Well, making progress. I did:

sudo apt-get install libserialport-dev:i386

Went back into Julia and did:

julia\> Pkg.build(“LibSerialPort”)  
INFO: Building LibSerialPort

julia\> using LibSerialPort

julia\> list\_ports()  
/dev/ttyACM0  
ERROR: ccall: could not find function sp\_get\_port\_description in library /usr/lib/i386-linux-gnu/libserialport.so  
Stacktrace:  
[1] sp\_get\_port\_description(::Ptr{LibSerialPort.SPPort}) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:174  
[2] #list\_ports#29(::Int32, ::Function) at /home/julia-user/.julia/v0.6/LibSerialPort/src/high-level-api.jl:104  
[3] list\_ports() at /home/julia-user/.julia/v0.6/LibSerialPort/src/high-level-api.jl:98

julia\>

So, at least it got the name of the port. I’ll try some other methods and see if they work.

Frank

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [August 30, 2017, 3:31pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/13 "2017-08-30T15:31:22Z")

</div>

Be sure to check if the binaries you got are also version 0.1.1 as expected in the package. Perhaps the package build script should add a validate function to make sure the found libraries can be used.

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 3:54pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/14 "2017-08-30T15:54:33Z")

</div>

> [@visr](#):
>
> 0.1.1

Success!! That was it. Uninstalled what I had and installed:

libserialport-dev\_0.1.1-1\_i386.deb

julia\> Pkg.build(“LibSerialPort”)  
INFO: Building LibSerialPort

julia\> readdir(joinpath(Pkg.dir(“LibSerialPort”), “deps/usr/lib”))  
6-element Array{String,1}:  
“libserialport.a”  
“libserialport.la”  
“libserialport.so”  
“libserialport.so.0”  
“libserialport.so.0.1.0”  
“pkgconfig”

julia\> using LibSerialPort

julia\> list\_ports()  
/dev/ttyS4  
Description: ttyS4  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyS5  
Description: ttyS5  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyACM0  
Description: UDOO X86 - K71212271  
Transport type: SP\_TRANSPORT\_USB

julia\>

Thanks for all the help!!

Frank

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [August 30, 2017, 4:06pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/15 "2017-08-30T16:06:47Z")

</div>

Great 🙂  
I’d still recommend you make a GitHub issue about 32 bit builds, with a link to this discussion. It could save others time when they see the issue. Or perhaps it is easily fixed.

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 4:08pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/16 "2017-08-30T16:08:19Z")

</div>

I guess I cheered to soon. Just trying use a bit of code from the test.

julia\> port = sp\_get\_port\_by\_name(“/dev/ttyACM0”)  
Ptr{LibSerialPort.SPPort} @0x0b4ccdf8

julia\> sp\_open(port, SP\_MODE\_READ\_WRITE)  
OS error code 25: Inappropriate ioctl for device  
ERROR: From /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl: 111:

libserialport returned SP\_ERR\_FAIL - Host OS reported a failure.  
Stacktrace:  
[1] handle\_error(::LibSerialPort.SPReturn, ::String) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:106  
[2] sp\_open(::Ptr{LibSerialPort.SPPort}, ::LibSerialPort.SPMode) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:155

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 4:40pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/17 "2017-08-30T16:40:42Z")

</div>

> [@Frank\_Applin](#):
>
> OS error code 25: Inappropriate ioctl for device

I don’t know if this helps at all. I did a dmesg to show info. on the port I’m using.

[66975.607774] cdc\_acm 1-4:1.0: ttyACM0: USB ACM device  
[67018.291186] usb 1-4: USB disconnect, device number 45  
[67018.565441] usb 1-4: new full-speed USB device number 46 using xhci\_hcd  
[67018.758199] usb 1-4: New USB device found, idVendor=8087, idProduct=0aba  
[67018.758216] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3  
[67018.758227] usb 1-4: Product: UDOO X86  
[67018.758236] usb 1-4: Manufacturer: UDOO  
[67018.758242] usb 1-4: SerialNumber: K71212271  
[67023.185173] usb 1-4: USB disconnect, device number 46  
[67023.461549] usb 1-4: new full-speed USB device number 47 using xhci\_hcd  
[67023.593098] usb 1-4: New USB device found, idVendor=8087, idProduct=0ab6  
[67023.593109] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3  
[67023.593116] usb 1-4: Product: UDOO X86  
[67023.593122] usb 1-4: Manufacturer: UDOO  
[67023.593126] usb 1-4: SerialNumber: K71212271  
[67023.595835] cdc\_acm 1-4:1.0: ttyACM0: USB ACM device

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 4:48pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/18 "2017-08-30T16:48:53Z")

</div>

And, just to add to the fun - I plugged in an arduino Uno to my Udoo x86 board, started up Julia, and did the following:

julia\> using LibSerialPort

julia\> list\_ports()  
/dev/ttyS4  
Description: ttyS4  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyS5  
Description: ttyS5  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyACM0  
Description: UDOO X86 - K71212271  
Transport type: SP\_TRANSPORT\_USB  
/dev/ttyACM1  
Description: ttyACM1 - 64933303732351117121  
Transport type: SP\_TRANSPORT\_USB

julia\> port = sp\_get\_port\_by\_name(“/dev/ttyACM1”)  
Ptr{LibSerialPort.SPPort} @0x09189138

julia\> sp\_open(port, SP\_MODE\_READ\_WRITE)  
OS error code 13: Permission denied  
ERROR: From /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl: 111:

libserialport returned SP\_ERR\_FAIL - Host OS reported a failure.  
Stacktrace:  
[1] handle\_error(::LibSerialPort.SPReturn, ::String) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:106  
[2] sp\_open(::Ptr{LibSerialPort.SPPort}, ::LibSerialPort.SPMode) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:155

I think I’ll start looking for another solution - maybe on where I don’t need the serial port.

Frank

---

<div class="post-metadata">

### Author: ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)
#### Post date: [August 30, 2017, 5:47pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/19 "2017-08-30T17:47:33Z")

</div>

Do you have write permissions to `/dev/ttyACM*`?

---

<div class="post-metadata">

### Author: ![Frank\_Applin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frank_applin/32/1654_2.png) [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)
#### Post date: [August 30, 2017, 6:09pm UTC](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623/20 "2017-08-30T18:09:39Z")

</div>

I did on ttyACM0, but not ttyACM1.

So, I did:

chmod a+rw /dev/ttyACM1

ls -l /dev/ttyACM\*  
crw-rw-rw- 1 root dialout 166, 0 Aug 30 13:35 /dev/ttyACM0  
crw-rw-rw- 1 root dialout 166, 1 Aug 30 13:54 /dev/ttyACM1

Ran Julia:

julia\> using LibSerialPort

julia\> list\_ports()  
/dev/ttyS4  
Description: ttyS4  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyS5  
Description: ttyS5  
Transport type: SP\_TRANSPORT\_NATIVE  
/dev/ttyACM0  
Description: UDOO X86 - K71212271  
Transport type: SP\_TRANSPORT\_USB  
/dev/ttyACM1  
Description: ttyACM1 - 64933303732351117121  
Transport type: SP\_TRANSPORT\_USB

julia\> port = sp\_get\_port\_by\_name(“/dev/ttyACM1”)  
Ptr{LibSerialPort.SPPort} @0x0acb0f90

julia\> sp\_open(port, SP\_MODE\_READ\_WRITE)  
OS error code 25: Inappropriate ioctl for device  
ERROR: From /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl: 111:

libserialport returned SP\_ERR\_FAIL - Host OS reported a failure.  
Stacktrace:  
[1] handle\_error(::LibSerialPort.SPReturn, ::String) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:106  
[2] sp\_open(::Ptr{LibSerialPort.SPPort}, ::LibSerialPort.SPMode) at /home/julia-user/.julia/v0.6/LibSerialPort/src/wrap.jl:155

I’m looking for another approach. I am experimenting with doing remote calls on 3 different development boards that I have on a small local Beowulf cluster: Raspberry Pi, Beaglebone Black, and Udoo x86. I want to demonstrate how you can remotely control sensors attached to different GPIOs [from my desktop running Julia].

I have it working with a digital PIR [motion] sensor on the RPi, and an analog light sensor on the BeagleBone. The interesting thing about the Udoo X86 is that it has an Arduino 101 built directly on the board. It also has GPIOs that I have gotten to work, but I thought it would be cool to connect up to an Arduino script that was running and access it from Julia (remotely) - hence the need for the serial routines. I can just do a readline() and get values, but the timing will never be synced.

I would like to take all of this information that I have been gathering and programming and do a talk at the next Julia Conference. That’s what this all about - lots of experimenting.

[Next page](https://discourse.julialang.org/t/problem-with-running-command-line-items/5623.md?page=2)
