Cannot connect MATLAB to Arduino board due to connection timeout error -> [??? Error using ==> arduino>arduino.arduino at 102]
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am trying to connect MATLAB to an Arduino Duemilanove using the MATLAB IO Support Package. It did work in the past (couple of weeks ago) using this board but now for some reason it does not want to connect to the board. When I use the "a=arduino('COM4')" it appears with the error:
??? Error using ==> arduino>arduino.arduino at 102
Connection unsuccessful, please make sure that the Arduino is powered on, running either srv.pde,
adiosrv.pde or mororsrv.pde, and that the board is connected to the indicated serial port. You might also
try to unplug and re-plug the USB cable before attempting a reconnection.
The argument at line 102 of the arduino.m file is as follows:
% exit if there was no answer
if isempty(chk)
delete(a);
error('*Connection unsuccessful, please make sure that the Arduino is powered on, running either srv.pde, adiosrv.pde or mororsrv.pde, and that the board is connected to the indicated serial port. You might also try to unplug and re-plug the USB cable before attempting a reconnection.*');
end
I have uploaded adiosvr.pde to the target board and closed down the Arduino IDE (as recommended by the readme.txt file). I have hunted on the web high and low through forums and so on but cannot find a viable solution to my problem. I am fairly new to MATLAB and the IDE language but I am an engineering student working on my dissertation and this is kind of imperative to the whole success of it. It's so frustrating that it was working and now it isn't. I haven't changed or removed anything.
ANY help would be greatly, greatly appreciated.
Regards,
Euan Millar
1 个评论
Gautam Vallabha
2012-4-9
What changed in the last couple of weeks? Are you using a different board?
(make sure that COM4 is the correct port for the Arduino. If you have other serial USB devices connected to your system, a new COM port may have gotten assigned to the Duemilanove).
回答(3 个)
Aminat
2012-4-9
I have the same problem. I got it to work okay in the IDE environment but for some reason it's not working in the Matlab environment. Please reply when you find any answers.
0 个评论
Aminat
2012-4-9
Hi! I figured out the answer...you have to establish a connection between the IDE and Matlab to control the serial port. The details are at this link/in the readme for matlab support package.
0 个评论
Brais Gonzalez
2017-11-21
Answer for Error using arduino (line 104) Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
The answer is: 1 In the Arduino software(IDE). You need write the code, which you find in file "adioes.pde" There are three files adio, adioe, adioes. A for analog D for digital I for input O for Output E for encoder S for Servo. If you need a Servo o a encoder, you need put the code more complete adioes. 2 Compile this code and send to arduino. Close the IDE 3 To open matlab and to write a=arduino("COMxx") 4 You has finalized the Arduino instalation
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!