Unable to connect Arduino to Matlab R2015b (Linux)
5 次查看(过去 30 天)
显示 更早的评论
When I try to connect the Arduino I get the following:
>> a = arduino('/dev/arduino', 'Uno')
Cannot find Arduino hardware on port /dev/arduino. Make sure Arduino hardware is properly plugged in. Otherwise, please specify both port and board type. For more information, see arduino function reference page.
'/dev/arduino' is a symbolic link to '/dev/ttyUSB0', if I don't use a symbolic link, I get an error about the port not being a symbolic link. The board I am trying to connect is a Seeeduino v3.0 which has a Duemilanove w/ATmega 328 bootloader. I tried other types of boards rather than the Uno, but none of them seem to work and the 'Duemilanove' option does not exist.
Is the Duemilanove supported? Any ideas on how to get it connected to Matlab?
Using Matlab R2015b on Ubuntu 14.04 (64-bit).
1 个评论
Sivakumaran Chandrasekaran
2016-1-5
use simulink option. get arduino library block installed. and then proceed. it will work
回答(1 个)
Usha Duddu
2016-1-7
Hi Joan
I understand that you are running into "Cannot find Arduino hardware on port /dev/arduino. Make sure Arduino hardware is properly plugged in." error when you try connecting the arduino device to MATLAB. I also understand that you are running into errors if you do not use symbolic link of the port.
Below is the workaround to connect to arduino device using "/dev/ttyUSB0"-
Create a file named java.opts. Include the following line in the file
-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0
where /dev/ttyUSB0 is the name of your serial port. In order to enter multiple ports/file descriptors separate them by colons(:). Put the java.opts file in the userpath directory in MATLAB, and navigate to that directory before starting MATLAB.
After you perform above steps execute "instrhwinfo('serial')". This should list the available serial ports.
2. As far as connecting arduino device with symbolic link is concerned, make sure that symlink begins with the string 'tty'. For example '/dev/ttyarduino'. Update java.opts to include symlink and restart MATLAB.
Hope this helps.
Thanks
Usha
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!