Arduino on Matlab within Ubuntu 14.04

1 次查看(过去 30 天)
Hi, I installed Matlab 2015b on Ubuntu 14.04 => Works fine. Then also installed the Arduino support package => No warnings or errors...
Yesterday, I wanted to connect the Arduino UNO:
a = arduino('/dev/ttyUSB0')
what resulted in an error. I tried this answer and made the java file. That did not work. I find the arduino when I list the USB ports. It says Bus 007 Device 002 ... Arduino UNO R3. And in the device list I find the corresponding file which properties gave me the "/dev/ttyUSB0" address.
Has anybody a hint I could try?
  5 个评论
Andreas Schmid
Andreas Schmid 2016-2-11
编辑:Andreas Schmid 2016-2-11
Thank you Juan, I tried all this, but in the end it did not work out. I was in contact with Mathworks support and they found out that in my Ubuntu distribution one package was missing.
So in the end this worked out:
Install the Matlab Arduino-Kit Install the missing Arduino dependencies: sudo apt-get install openjdk-6-jre avr-libc gcc-avr Create the symbolic link: sudo ln -s /dev/ttyACM0 /dev/ttyS100 Create a file called java.opts in the folder where Matlab starts (To find out where this is, start Matlab and type
pwd
in the command line)
The file tells Matlab where to find the connection, so this line must be contained: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS100:/dev/ttyACM0
That's about it :-)
wei shulin
wei shulin 2018-4-18
Hi,Juan Reyes thank you for your help , it really helps me out.

请先登录,再进行评论。

回答(1 个)

marwa diwiny
marwa diwiny 2016-11-12
编辑:Walter Roberson 2016-11-13
Please I need the help, I tried many times, but in vain, I don't know where is the problem and it can't recognize the arduino functions
>> a= arduino('/dev/ttyACM0')
The port /dev/ttyACM0 is already used by MATLAB
If you are sure that the board is connected to /dev/ttyACM0
then delete the object, execute:
delete(instrfind({'Port'},{'/dev/ttyACM0'}))
to delete the port, disconnect the cable, reconnect it,
and then create a new arduino object
Error using arduino (line 54)
Port /dev/ttyACM0 already used by MATLAB

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by