Matlab reconnect after power interrupt?


I am using the MKR1000 as part of the Engineering Kit. I notice that I have to re-run the arduinosetup every time there is a power interrupt. I also noticed that even then Matlab may still not connect to the board. I have to completely power off the board and disconnect the cable and THEN I can reconnect it.

Anyone else with this issue?

The training said we should be able to just have Matlab reconnect using the software script commands.

Add the sketch you use to your next post using code tags ( </> )

Which training ?

Which "arduinosetup" ?

Is your computer a company or EDU loan computer or your very own personal one ?

Really need more information to make any headway here.

I am so sorry.

I am using the new Engineering Kit provided by Arduino.

It uses a Matlab server to communicate with an MKR1000 board.

I am using Windows 7 Homepack Premium SP1

My matlab is 2018a

The instructions say that I can simply clear my arduino instance and re-establish the connection by re-creating the instance (i.e. a = arduino) but that is not true since the board requires a power cycle completely before this works.

I believe this issue is tied to seeing the PORT number change for some reason whenever there is a

[1] power interrupt (i.e. changing from USB power to LiPo)
[2] Anytime the board is programmed

This is just a theory as to why this is happening though!

The MKR series has TWO ports.
The regular one normally used and a secondary one (locally bootloader)

Normally it will change ports briefly during an UPLOAD of a sketch but should then revert back to the primary port.

The secondary one can be called by quickly pressing reset twice and is often used when a sketch has become unstable.
It sounds like that is what you are seeing.
Normally I would suggest uploading a very simple sketch if you have entered bootloader mode such as Blink or BareMinimum from the basic examples in the regular IDE before trying your main sketch again.

Your sketch would still be useful here just to see what is being called and how ?

Newer boards should be up to date on the firmware but that is worth checking too just in case you have an older firmware. There is a sketch in the examples for WiFi101 to check the firmware.

It is not a sketch.

This new way of doing the design is using Matlab as the server that is hosting the design on the board.

The issue I am having is a handshake issue between Matlab and the board so not sure who I actually ask about this one....

Without some form of sketch on the MKR it will not know what to do.

Usually it is something similar to the FIRMATA examples in the regular IDE where the sketch on the MKR talks to an external program about what pins it has available and the state of those pins.
And conversly allows those pins to be manipulated via the client program (Matlab in your case)

It could be as simple as you missed a step ?

Not seen any external control program that can simply manipulate an MCU without some form of program on the MCU to help it do so.

If you have any links to the lessons or teaching material you are using please supply them ?

Thanks ballscrewbob,

Can you access this material:

This is the section where we communicate with matlab and the MKR1000.

In section "CONNECTING MATLAB TO ARDUINO", it has us create a new arduino instance on the matlab server and we can kill or re-create that instance at will.

ISSUE: Now read the section where the LiPo battery is connected. It claims you need to simply clear the old arduino instance and re-create it but that is not true. It does not happen that way. You need to power cycle and re-download the entire board again to continue.

I think this is a bug...

Will have to wait until Monday when the team get back in as I don't have full access to the EDU side.


This does seem like a bug, because I can execute the following commands in MATLAB and not have to reconnect/repower in between.

a = arduino
delete a
a = arduino

It does work every single time.

Hi, I am facing the same issue with arduinosetup that described in this post. Did you find a solution to the problem?


What is the behavior of L Led on double tapping the Reset Button. Also, please uninstall and reinstall Matlab support package for Arduino Hardware and try again.