Unable to connect Arduino to Matlab R2015b (Linux)
5 views (last 30 days)
Show older comments
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 Comment
Sivakumaran Chandrasekaran
on 5 Jan 2016
use simulink option. get arduino library block installed. and then proceed. it will work
Answers (1)
Usha Duddu
on 7 Jan 2016
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 Comments
See Also
Categories
Find more on I2C Devices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!