Hi there.
In Mac, go to to System preferences click on Energy Saver
1. Click con Battery button > In computer sleep drag to Never. In Display sleep drag to Never. Disable all options: Put the hard disk to sleep, Slightly dim the display and Automatic reduce brightness…
2. Click on Power Adapter: same settings in step #1