Cannot connect MATLAB to Arduino board due to connection timeout error -> [??? Error using ==> arduino>arduino.arduino at 102]
13 views (last 30 days)
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
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.*');
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.
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.
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.
Brais Gonzalez on 21 Nov 2017
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