Why do I receive 'Failed to open serial port COM* to communicate with the board' or 'Open fail: Port: COM* is not available. No ports are available.' error with MATLAB/Simulink support package for Arduino Hardware
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 6 Aug 2018
Edited: MathWorks Support Team
on 26 Jun 2024
Why do I receive the following error when trying to connect to Arduino Hardware with the MATLAB support package?
ERROR: Failed to open serial port COM6 to communicate with board Uno. Make
sure there is no other MATLAB arduino object for this board. For
troubleshooting, see Arduino Hardware Troubleshooting.
Correspondingly using the Simulink Support Package for Arduino, why do I receive the following error when building a model for the Arduino?
ERROR: Open fail: Port: COM* is not available. No ports are available.
Use INSTRFIND to determine if other instrument objects are connected to the requested device.
Accepted Answer
MathWorks Support Team
on 1 Aug 2024
Edited: MathWorks Support Team
on 26 Jun 2024
This issue mainly arises when MATLAB tries to connect to the Arduino via more than one connection.
This can happen if there is an existing "arduino" object in the workspace.
Make sure to clear the previous arduino objects before calling the arduino function again, or simulating a model on the Arduino.
To clear an arduino object "my_arduino":
>> clear my_arduino
Additionally check that other MATLAB instances are not connected to the Arduino.
If this does not resolve the error, please contact MathWorks Technical Support at:
0 Comments
More Answers (0)
See Also
Categories
Find more on Arduino Hardware 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!