Simulink model not stopping when running over Wifi - AEK Rev1

Hi,

I am working in the self-balancing bike of the original Engineering Kit with the MKR1000. I can get the simulink model to run over wif-fi correctly and the motorcycle to respond (i.e. I can receive the signals from the sensor and turn the motors on and off over wi-fi).

However, whenever I want to stop the model, I press the stop button and the model just hangs. It appears if the model continues running. The feedback from the sensors stops. But simulink keeps running the model, and the only way of stopping it is forcing the model to close. This is very inconvenient as you have to restart the model again from your last saved point.

Has anyone encounter this problem? Or is anyone able to stop the model successfully over wi-fi as if the board was connected via the USB cable?

Thanks for the help!